Skip to content

Preparing your servers

Sam Kumar edited this page Nov 7, 2016 · 5 revisions

This stage will prepare your servers to create a single Fleet cluster ready to schedule Docker containers using Etcd.

Preconditions

You must have the environment variables set up by executing

$ source cluster-info.sh

Initial prepare

In the tools' root directory, run

$ bin/qs-prepare-servers.sh

This will first check the servers are alive, and that you have accepted the SSH identity for each server. For our run, the output looked as follows:

$ bin/qs-prepare-servers.sh
checking server liveness
The authenticity of host '52.88.118.170 (52.88.118.170)' can't be established.
ECDSA key fingerprint is SHA256:nHkS9RSn/sal6e5G1v5B0wM24M8BvZBnx7QKvmEs1o8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '52.88.118.170' (ECDSA) to the list of known hosts.
- node0 is alive
The authenticity of host '52.88.26.224 (52.88.26.224)' can't be established.
ECDSA key fingerprint is SHA256:OhvoPxX7CxJZgbvusOMhbYC1PIyX4eHUyerrIpYyU4g.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '52.88.26.224' (ECDSA) to the list of known hosts.
- node1 is alive
The authenticity of host '52.43.123.152 (52.43.123.152)' can't be established.
ECDSA key fingerprint is SHA256:QNpgC+Eis+dI1LJ1t3ipTcnRRuUwB7ocyIoYDAT0VGQ.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '52.43.123.152' (ECDSA) to the list of known hosts.
- node2 is alive
checking servers for updates
 - updating package lists on node0
  > node0 has outstanding updates. Installing and rebooting

[ many pages of updates ]

In general, the tools will try color-code the output, so that text generated by qs-* scripts is blue, and text generated by processes on the remote servers is in white. This helps you distinguish relevant output, which will usually be blue.

This first update does not require your interation after the inital accepting of SSH fingerpints. You can leave and come back later, where you should see:

some nodes were rebooted after updates. Wait a bit then rerun this script

Installing cluster tools

Following those instructions, we can now rerun the script. If it has only just completed, you may want to wait a bit for the servers to finish rebooting, although the script will check for you:

$ bin/qs-prepare-servers.sh
checking server liveness
- node0 is alive
- node1 is alive
- node2 is alive
checking servers for updates
 - updating package lists on node0
  > node0 is up to date
 - updating package lists on node1
  > node1 is up to date
 - updating package lists on node2
  > node2 is up to date
installing docker, etcd and fleet
 - installing on node0

[ many pages of installation ]

This process also does not require your interaction, so feel free to check reddit, hackernews and a few webcomics. When it is complete, it will print

server preparation complete

Note: Messages of the form "sudo: unable to resolve host" are to be expected and are not a cause for concern.

Verifying

If you want to check that everything is working correctly, you can check fleet:

$ bin/qs-fleetctl.sh list-machines

Which for this setup prints

$ bin/qs-fleetctl.sh list-machines
MACHINE		IP		METADATA
2cd92697...	172.30.2.118	n=node2
6123c2e2...	172.30.2.117	n=node1
7acf664b...	172.30.2.116	n=node0

If you do not see all your machines listed, double check your security group settings and consider contacting the mailing list. You will not be able to proceed.

What's next

Now that your cluster is ready to run services, you need to create and execute an installation plan