etcd+flannel分配到各个节点的IP相同?
1、etcd配置
grep -v '^#' /etc/etcd/etcd.conf
ETCD_NAME=defaultETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
ETCD_ADVERTISE_CLIENT_URLS="http://0.0.0.0:2379"
ETCD_LOG_PACKAGE_LEVELS="ecurity=DEBUG"
2、etcd创建子网键值记录
etcdctl mk /coreos.com/network/config '{"Network": "172.17.0.0/16"}'
3、各个节点的flannel配置
grep -v '^#' /etc/sysconfig/flanneld
FLANNEL_ETCD="http://192.168.2.30:2379"FLANNEL_ETCD_KEY="/coreos.com/network"
FLANNEL_OPTIONS=""
4、查看节点
docker-02节点获取的地址
ifconfig docker0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1472inet 172.17.60.1 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::42:98ff:fedc:7ff6 prefixlen 64 scopeid 0x20<link>
ether 02:42:98:dc:7f:f6 txqueuelen 0 (Ethernet)
RX packets 8 bytes 536 (536.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 648 (648.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ifconfig flannel
flannel0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1472inet 172.17.60.0 netmask 255.255.0.0 destination 172.17.60.0
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker-03节点获取的地址
ifconfig docker0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1472inet 172.17.60.1 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::42:d4ff:fec2:388b prefixlen 64 scopeid 0x20<link>
ether 02:42:d4:c2:38:8b txqueuelen 0 (Ethernet)
RX packets 11 bytes 752 (752.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 648 (648.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ifconfig flannel
flannel0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1472inet 172.17.60.0 netmask 255.255.0.0 destination 172.17.60.0
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
问题: 为什么这两个节点获取的地址相同,docker0的地址按理说不同的?还是我哪里配置的不对,请大神帮看看啊,感谢!
1 个回复
ɡōōd洋
赞同来自:
docker 的配置文件写--bip了吗