hi sir ,
hi sir , i just try running your script on my testing machine -> docker stack deploy -c docker-compose.yml consul the script running succesfully , after that how to i join to my another machine sir , i have 4 testing machine , is there any command that i should adding to another machine
hxt531wno84u consul_seed replicated 0/1 consul:0.8.0
jc07dc58ilmp consul_cluster global 0/0 consul:0.8.0 :8500->8500/tcp,:8600->8600/tcp
You hit on a good point. In order to add machines the seed would have to remain running. I have not yet tested this but I think it's just a matter of removing the following:
- timeout #this seed fires up the cluster after which it is no longer needed
- -sTERM #this is the same signal as docker would send on a scale down / stop
- -t300 #terminate after 5 mins
you mean i need to run this script (docker-compose.yml) to another machine cluster / node ?
Could it works on multi-host ? What should i do?
Yes this is multihost, I just made a few changes to allow for node growth as pointed out by buluxan. The docker-compose.yml is used by the docker engine on a swarm manager node. When you add nodes to your docker swarm Consul should automatically fire up on that node because of the global setting. This basically tells the docker engine to schedule 1 replica on each node. You can still control this however with docker labels to make sure the seed is never on the same node as a worker / cluster instance as that would cause problems.
it works, thx