好看的国产动漫,沙尘暴十袭京城,漳浦旅游景点大全
主机名 | 角色 | ip地址 |
---|---|---|
hdss7-21.host.com | flannel | 10.4.7.21 |
hdss7-22.host.com | flannel | 10.4.7.22 |
部署方法以hdss7-21.host.com为例
[root@hdss7-21 ~]# cd /opt/src/ [root@hdss7-21 src]# wget https://github.com/coreos/flannel/releases/download/v0.11.0/flannel-v0.11.0-linux-amd64.tar.gz [root@hdss7-21 src]# mkdir /opt/flannel-v0.11.0 [root@hdss7-21 src]# tar xf flannel-v0.11.0-linux-amd64.tar.gz -c /opt/flannel-v0.11.0/ [root@hdss7-21 src]# ln -s /opt/flannel-v0.11.0/ /opt/flannel
[root@hdss7-21 src]# /opt/flannel [root@hdss7-21 flannel]# mkdir /opt/flannel/cert
[root@hdss7-21 flannel]# cd cert [root@hdss7-21 cert]# scp hdss7-200:/opt/certs/ca.pem . [root@hdss7-21 cert]# scp hdss7-200:/opt/certs/client.pem . [root@hdss7-21 cert]# scp hdss7-200:/opt/certs/client-key.pem .
[root@hdss7-21 cert]# cd .. [root@hdss7-21 flannel]# vi subnet.env flannel_network=172.7.0.0/16 flannel_subnet=172.7.21.1/24 flannel_mtu=1500 flannel_ipmasq=false
[root@hdss7-21 flannel]# vi flanneld.sh #!/bin/sh ./flanneld \ --public-ip=10.4.7.21 \ --etcd-endpoints=https://10.4.7.12:2379,https://10.4.7.21:2379,https://10.4.7.22:2379 \ --etcd-keyfile=./cert/client-key.pem \ --etcd-certfile=./cert/client.pem \ --etcd-cafile=./cert/ca.pem \ --iface=eth0 \ --subnet-file=./subnet.env \ --healthz-port=2401
[root@hdss7-21 flannel]# chmod +x flanneld.sh [root@hdss7-21 flannel]# mkdir -p /data/logs/flanneld
[root@hdss7-21 flannel]# vi /etc/supervisord.d/flannel.ini [program:flanneld-7-21] command=/opt/flannel/flanneld.sh ; the program (relative uses path, can take args) numprocs=1 ; number of processes copies to start (def 1) directory=/opt/flannel ; directory to cwd to before exec (def no cwd) autostart=true ; start at supervisord start (default: true) autorestart=true ; retstart at unexpected quit (default: true) startsecs=30 ; number of secs prog must stay running (def. 1) startretries=3 ; max # of serial start failures (default 3) exitcodes=0,2 ; 'expected' exit codes for process (default 0,2) stopsignal=quit ; signal used to kill process (default term) stopwaitsecs=10 ; max num secs to wait b4 sigkill (default 10) user=root ; setuid to this unix account to run the program redirect_stderr=true ; redirect proc stderr to stdout (default false) stdout_logfile=/data/logs/flanneld/flanneld.stdout.log ; stderr log path, none for none; default auto stdout_logfile_maxbytes=64mb ; max # logfile bytes b4 rotation (default 50mb) stdout_logfile_backups=4 ; # of stdout logfile backups (default 10) stdout_capture_maxbytes=1mb ; number of bytes in 'capturemode' (default 0) stdout_events_enabled=false ; emit events on stdout writes (default false)
[root@hdss7-21 etcd]# ./etcdctl set /coreos.com/network/config '{"network": "172.7.0.0/16", "backend": {"type": "host-gw"}}' {"network": "172.7.0.0/16", "backend": {"type": "host-gw"}} 验证: [root@hdss7-21 etcd]# ./etcdctl get /coreos.com/network/config {"network": "172.7.0.0/16", "backend": {"type": "host-gw"}}
[root@hdss7-21 flannel]# supervisorctl update [root@hdss7-21 flannel]# supervisorctl status
1.supervisor stop flanneld-7-[21.22] 2.删除host-gw模型创建的路由 route del -net 172.7.21.0/24 gw 10.4.7.21 hdss7-22.host.com上 route del -net 172.7.22.0/24 gw 10.4.7.22 hdss7-21.host.com上 3.在etcd修改 ./etcdctl get /coreos.com/network/config ./etcdctl rm /coreos.com/network/config ./etcdctl set /coreos.com/network/config '{"network": "172.7.0.0/16", "backend": {"type": "vxlan"}}' 4.supervisor start flanneld-7-[21.22]
'{"network": "172.7.0.0/16", "backend": {"type": "vxlan","directrouting": true}}'
(运维技术交流群:926402931,欢迎大家一起来交流。)
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
网友评论