安装
docker hub地址:https://hub.docker.com/r/portainer/portainer/
# 每台服务器都要安装 docker pull portainer/portainer
开放Docker网络管理端口
- 修改 docker.service 修改 [Service]的ExecStart,ExecStart= 一定要加
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
-
刷新配置文件,重启docker
systemctl daemon-reload systemctl restart docker
- 查看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
创建Portainer容器
# -- 192.168.103.210 docker run -d -p 9000:9000 portainer/portainer -H tcp://192.168.103.210:2375 # -- 192.168.103.240 docker run -d -p 9000:9000 portainer/portainer -H tcp://192.168.103.240:2375 # -- 192.168.103.212 docker run -d -p 9000:9000 portainer/portainer -H tcp://192.168.103.212:2375 # -- 192.168.103.213 docker run -d -p 9000:9000 portainer/portainer -H tcp://192.168.103.213:2375
四台主机之上PXC部署方案