docker hub地址:https://hub.docker.com/r/portainer/portainer/docker
# 每臺服務器都要安裝
docker pull portainer/portainer
cp /usr/lib/systemd/system/docker.service /usr/lib/systemd/system/docker.service.bak
vim /usr/lib/systemd/system/docker.service
[Service] Type=notify # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart= ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
刷新配置文件,重啓dockervim
systemctl daemon-reload
systemctl restart docker
netstat -ano | grep 2375 tcp6 0 0 :::2375 :::* LISTEN off (0.00/0/0)
查看系統網絡端口2375是否被docker所監聽服務器
netstat -tulp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN 3124/sshd tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN 3379/master tcp6 0 0 [::]:2375 [::]:* LISTEN 13964/dockerd
# -- 192.168.103.210 docker volume create --name portainer_v1 docker run -d -p 9000:9000 --restart=always -v portainer_v1:/data portainer/portainer -H tcp://192.168.103.210:2375 # -- 192.168.103.240 docker volume create --name portainer_v1 docker run -d -p 9000:9000 --restart=always -v portainer_v1:/data portainer/portainer -H tcp://192.168.103.240:2375 # -- 192.168.103.212 docker volume create --name portainer_v1 docker run -d -p 9000:9000 --restart=always -v portainer_v1:/data portainer/portainer -H tcp://192.168.103.212:2375 # -- 192.168.103.213 docker volume create --name portainer_v1 docker run -d -p 9000:9000 --restart=always -v portainer_v1:/data portainer/portainer -H tcp://192.168.103.213:2375