swarm панель haven

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