Thank you for reading this post, don't forget to subscribe!
Ставим git:
yum install git -y
git clone https://github.com/codeabovelab/haven-platform.git
[root@swarm-master1-180 haven-platform]# mkdir -p /swarm-vol/haven/etcd /swarm-vol/haven/haven
[root@swarm-master1-180 haven-platform]# chmod -R 777 /swarm-vol/haven
[root@swarm-master1-180 haven-platform]# export MASTER_IP=192.168.1.180
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs \
-p 4001:4001 -p 2380:2380 -p 2379:2379 --restart=always \
--name etcd0 quay.io/coreos/etcd:v2.3.7 -name etcd0 \
-data-dir=data -advertise-client-urls http://$MASTER_IP:2379,http://$MASTER_IP:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -initial-advertise-peer-urls http://$MASTER_IP:2380 \
-listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster-1 \
-v /swarm-vol/haven/etcd:/data/ \
-initial-cluster etcd0=http://$MASTER_IP:2380 -initial-cluster-state new
docker run -d --name=cluman -p 8761:8761 --restart=unless-stopped \
-v /swarm-vol/haven/haven:/data/ \
-e "dm_kv_etcd_urls=http://$MASTER_IP:2379" codeabovelab/cluster-manager
на ВСЕХ нодах запускаем:
docker run --name havenAgent -d -e "dm_agent_notifier_server=http://192.168.1.180:8761" --hostname=$(hostname) --restart=unless-stopped -p 8771:8771 -v /run/docker.sock:/run/docker.sock codeabovelab/agent:latest
далее переходим по:
http://<MASTER_IP>:8761/
и вводим admin password
переходим:
'Admin' -> 'Add node' -> 'Get Agent Command'
добавляем наш второй мастер(тут он будет выступать как нода)
добавим таким же макаром остальные ноды:
swarm-master3-182
swarm-node1-183
swarm-node2-184
swarm-node3-185
проверим перейдя в раздел NODES
так же в разделе Cluster можно создать новый кластер добавив все ноды или объеденить их по своему усмотрению. С помощью данной панели можно отслеживать какие контейнеры запущены, какие там сервисы и т.д.
более подробная установка тут:
https://github.com/codeabovelab/haven-platform/blob/master/doc/installation.md