Docker Community Forums

Share and learn in the Docker community.

Add nodes in different region to UCP


(Bill Wang) #1

I have two nodes in different aws Regions

Node1, public IP is 52.62.29.18, its private IP is 172.31.4.2, I install UCP server on it with port 8443

Node2, public IP is 54.26.14.37, its private IP is 172.31.40.10

Node1 has been added itself as UCP node.

I add Node2 to UCP server (node1) with below command:

docker run --rm -ti --name ucp -v /var/run/docker.sock:/var/run/docker.sock docker/ucp join --url https://52.62.29.18:8443 --san 54.26.14.37 --host-address 54.26.14.37 --interactive

But failed, I can’t see the second node in UCP Dashboard. So I check docker container’s logs on node2, and get this:

time=“2016-03-05T09:53:26Z” level=info msg=“Registering on the discovery service every 1m0s…” addr=“54.26.14.37:12376” discovery="etcd://172.31.4.2:12379"
time=“2016-03-05T09:53:29Z” level=error msg=“client: etcd cluster is unavailable or misconfigured”

root@ip-172-31-40-10:/etc/apt/sources.list.d# telnet 54.26.14.37 12376
Trying 54.26.14.37...
Connected to 54.26.14.37.
Escape character is '^]'.
^CConnection closed by foreign host.
root@ip-172-31-40-10:/etc/apt/sources.list.d#

root@ip-172-31-40-10:/etc/apt/sources.list.d# telnet 52.62.29.18 12376
Trying 52.62.29.18...
Connected to 52.62.29.18.
Escape character is '^]'.
^CConnection closed by foreign host.
root@ip-172-31-40-10:/etc/apt/sources.list.d#

So discovery IP is 172.31.4.2, and it is private IP of ucp server, of course node2 is not possible to connect to this private IP.

Why ucp server exposed its private IP as discovery IP to other nodes? How can I fix it with public IP?

My understand, I should be fine to add any nodes which has internet access, but with the test result, I have to put nodes in same network which can connect with private directly?


Add a public cloud node to an on-prem UCP controller
(Vivek Saraswat) #2

Technically, you should be able to use public IPs in AWS as long as this is configured with the --host-address option (as it appears you did correctly). However, our Swarm discovery key-value store (currently etcd) may not work correctly if you exceed latency requirements in your deployment. Since you are running EC2 instances in different regions you might be exceeding the latency expectations for etcd. We are currently testing to see if we can alter these expectations in future releases.

One thing that might be helpful: Can you check the logs on the “ucp-kv” container? If you see several timeouts that would confirm the above issue.


(mia avery) #4

Hello,
Very Nice Question and had an Interesting Discussion in your Post. Here i would like to Share with you some Points Related AWS. Hope it will be Useful for you.With Docker UCP, you can add labels to your nodes. Labels are metadata that describe the node, like its role (development, QA, production), its region (US, EU, APAC), or the kind of disk (hdd, ssd). Once you have labeled your nodes, you can add deployment constraints to your services, to ensure they are scheduled on a node with a specific label.