very simple web server docker image for testing loadbalance of docker swarm 。 two server images are provided :
aneotop/web1 , which is based on nodejs
docker run --rm -d -p 80:1500 aneotop/web
aneotop/web1:nc which is based on busybox and nc ,locating at nc-web.
docker run --rm -d -p 80:1500 aneotop/web:nc
centOs 7
bash script/i4centos.sh
ubuntu 16
bash script/i4ubuntu.sh
to deploy swarm cluster , 3 machines are needed.
#select one of these 3 machines,run:
docker swarm init --advertise-addr localip
#if your machine has only one ethernet interface card, the option of advertise-addr can be ommited
run command at first machine
docker swarm join-token manager
get following hints:
To add a manager to this swarm, run the following command:
docker swarm join --token SWMTKN-1-1rd7brd57191zer4nw4if44oh524b0akewaw9au30af5ngr0q6-evdgvgwwdd5j42az7gcosfbzm 192.168.137.140:2377
run command at other 2 machines
docker swarm join --token SWMTKN-1-1rd7brd57191zer4nw4if44oh524b0akewaw9au30af5ngr0q6-evdgvgwwdd5j42az7gcosfbzm 192.168.137.140:2377
run command at first machine
docker swarm join-token worker
get following hints:
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-1rd7brd57191zer4nw4if44oh524b0akewaw9au30af5ngr0q6-a5x1syrylfl15g35mejj8femu 192.168.137.140:2377
run command at other 2 machines
docker swarm join --token SWMTKN-1-1rd7brd57191zer4nw4if44oh524b0akewaw9au30af5ngr0q6-a5x1syrylfl15g35mejj8femu 192.168.137.140:2377
docker stack deploy -c docker-compose.yml web
#or
docker stack deploy -c nc-web/docker-compose.yml web
Content type
Image
Digest
Size
256.9 MB
Last updated
almost 9 years ago
docker pull aneotop/web1