使用自定义网桥br0使容器和主机在同一局域网内,部署shipyard无法监控host主机


ip a(自定义网桥br0,可以实现容器与host机器在同一局域网)

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP qlen 1000
link/ether ec:a8:6b:a8:06:23 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether ec:a8:6b:a8:06:23 brd ff:ff:ff:ff:ff:ff
inet 10.37.1.68/16 brd 10.37.255.255 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::eea8:6bff:fea8:623/64 scope link
valid_lft forever preferred_lft forever

然后部署shipyard

curl -s https://shipyard-project.com/deploy | bash -s

Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
Deploying Shipyard
-> Starting Database
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
-> Starting Discovery
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
-> Starting Cert Volume
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
-> Starting Proxy
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
-> Starting Swarm Manager
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
-> Starting Swarm Agent
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
-> Starting Controller
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
Waiting for Shipyard on 10.37.1.68:8080
.....
Shipyard available at http://10.37.1.68:8080
Username: admin Password: shipyard

能部署成功但是,无法监控主机,如下图:

问题.png


经测试,其他机器上Docker安装后,一切采用默认配置,再这样启动shipyard,可以实现监控主机。
已邀请:

3_D_2_Y

赞同来自:


问题解决了:
对比两台机器上Docker Daemon的区别
①shipyard可以 监控主机
root@ubuntu:~# ps aux |grep docker(Ubuntu 14.04上docker daemon启动进程)
root 1147 0.0 3.0 1341932 61820 ? Ssl Mar13 2:43 /usr/bin/docker daemon
②shipyard无法监控主机

curl -sps aux | grep docker(Centos7上docker daemon启动进程)

root 26309 0.5 1.8 1285636 33880 ? Ssl 14:58 0:04 /usr/bin/docker -d --selinux-enabled -b=br0

解决方法:

vim /etc/sysconfig/docker

/etc/sysconfig/docker

Modify these options if you want to change the way the docker daemon runs

OPTIONS='--selinux-enabled=false -b=br0'

。。。
将--selinux-enabled改成--selinux-enabled=false

要回复问题请先登录注册