In this small, self-guided workshop you will deploy and migrate a Redis database between hosts in a UCP cluster. You'll follow step-by-step instructions to:
- Add a Docker License to a Docker UCP Cluster.
- Add an extra UCP node the cluster so we can migrate a database between hosts.
- Use Docker compose to deploy an app with Redis backed by Flocker volumes and add some data to the app.
- Destroy the app. Argh!
- Start the app back up on a different node to demonstrate data movement. Phew.
Click over to the UCP tab and click I Understand the Risks
--> Add Exception..
and Confirm Security Exception
when presented with Untrusted Connection
warning.
Next log into UCP with admin/orca
and choose the dockercon.lic
license from the Desktop. Click upload license
in the Docker UCP Dashboard.
Take note of the output on the terminal from the previous ReadyDockerconDemo
, there will be a fingerprint
output for your Controller, it looks something like the below example. Copy this string to your clipboard.
Note, the information you would need to copy in below example output is: SHA-256 Fingerprint=FB:37:77:71:D6:F5:DB:8A:D6:00:CC:DC:73....:F4
# Example output from terminal
INFO[0062] UCP Server SSL: SHA-256 Fingerprint=FB:37:77:71:D6:F5:DB:8A:D6:00:CC:DC:73:90:17:DE:2C:99:CB:4D:A2:65:64:F3:76:4D:04:35:81:7D:B4:F4
INFO[0062] Login as "admin"/"orca" to UCP at https://172.16.78.250:443
You will add a node, node2
. Add it to the UCP cluster by copying the command below and paste it into your terminal and replace the <SHA1 fingerprint copied previously>
with the fingerprint from above.
$ vagrant ssh node2 -c "docker run --rm -it --name ucp \
-v /var/run/docker.sock:/var/run/docker.sock \
-e UCP_ADMIN_USER=admin -e UCP_ADMIN_PASSWORD=orca \
docker/ucp join \
--fresh-install \
--san node2 \
--host-address 172.16.78.251 \
--url https://172.16.78.250 \
--fingerprint <SHA1 fingerprint copied previously>"
After this completes, navigate back to the dashboard and verify you have 2 nodes.
https://node1/#/dashboard
Then navigate to https://node1/#/user, scroll down and click Create a Client Bundle
.
Then copy the bundle that was downloaded, and unzip the client bundle.
$ mv ~/Downloads/ucp-bundle-admin.zip .
$ unzip ucp-bundle-admin.zip
Execute the env.sh
script to set the appropriate environment
$ source env.sh
Run docker info
to verify it works.
Go to the app/
folder and run the first example.
$ cd app/
$ docker-compose -f dockercon-node1.yml up -d
Navigate to http://node1 and click the page to add docker images. You can also enter your email if you would like to continue later.
Feel free to navigate to https://node1/#/volumes and search flocker
to see the volumes being used in this demo.
Delete the app and remove the containers.
$ docker-compose -f dockercon-node1.yml stop
$ docker-compose -f dockercon-node1.yml rm -f
Bring the app back up on the second node.
$ docker-compose -f dockercon-node2.yml up -d
See that is on node2
now. Visit http://node2/, you should see the same images as before. Data movement!
When you are done, double click ReadyDockerconDemo
on the Desktop before leaving the workstation so someone else can give it a try.