说实话,看别人做的教程weave装上就能用,我尼玛就菊花疼了,各种各样的问题,总体来说,还是自己第一 弄,不咋会,有iptables的配置和网桥配置问题,以及TLS和镜像找不到的问题
existing iptables rule
iptables配置有问题, -A FORWARD -j REJECT --reject-with icmp-host-prohibited
我们简单的翻译一下,REJECT 是用来返回一个错误的包来回应匹配包,其他的等价于DROP,所以它是一个拒绝TARGET,在规则的结束。这个TARGET仅仅用在INPUT,FORWARD和OUTPUT链和用户自定义的链,下列选项是用来定义返回错误的结果的
#启动weave就淡腾了
[root@localhost lib]# weave launch
WARNING: existing iptables rule
'-A FORWARD -j REJECT --reject-with icmp-host-prohibited'
will block name resolution via weaveDNS - please reconfigure your firewall.
解决办法
删除链表中,这条转发规则
#查看FORWARD链
iptables -L FORWARD --line-numbers
#删除规则icmp-host-prohibited
iptables -D FORWARD 12
#保存链表规则
service iptables save
#重启iptables服务
service iptables restart
#停止weave服务,weave
weave stop
#启动weave 服务
weave launch
The ‘weave restart’ command has been removed as of Weave Net version 2.0,weave restart命令不能用,尴尬癌又犯了
Failed to get netdev for “docker0” bridge: Link not found
由于使用的是自定义的网桥,所以压根没有docker0的网桥,需要将/usr/local/bin/weave
文件的默认网桥配置修改成我们自定义的网桥
在weave中,默认写的docker网桥是docker0
解决办法
删除自己定义的网桥,修改配置文件
#编辑自己设置的docker 文件
vim /etc/default/docker
#删除网桥配置
DOCKER_OPTS=""
#重启service
service docker restart
#启动weave
weave launch
两台机器中有防火墙
在weave的两台 宿主机上,如果存在防火墙,会导致两个的连接建立失败,需要开放6783端口的tcp和upd协议
if there is a firewall between $HOST1 and $HOST2, you must open port 6783 for TCP and UDP)
#连接到别的服务器宿主机
weave connect 10.33.0.9
#查看weave的连接状态
weave status
解决办法
在两台机器上,开启端口udp和tcp协议
#两次执行,udp和tcp两个端口开放
[root@localhost ~]# iptables -I INPUT -m state --state NEW,ESTABLISHED -p tcp --dport 6783 -j ACCEPT
[root@localhost ~]# iptables -I INPUT -m state --state NEW,ESTABLISHED -p udp --dport 6783 -j ACCEPT
#保存规则
service iptables save
#重启防火墙
service iptables restart
#重启weave,淡腾,restart的命令这个版本移除了
weave stop
weave start
weave status #查看状态
Unable to find weaveworks/weave:latest image.
不能发现镜像weaveworks/weave:latest
,导致问题的原因是刚下载的镜像没有启动起来,镜像没有完全下载,有时候,还会找weaveworks/weaved:latest
镜像,不能通过该镜像的名称来解决问题
[root@localhost lib]# weave version
weave script unreleased
Unable to find weaveworks/weave:latest image.
下载完全后的weave的镜像,有docker.io/weaveworks/weaveexec
和docker.io/weaveworks/weave
两个
Cannot connect to the Docker daemon
镜像没有启动,导致查看不到版本信息
[root@localhost lib]# weave version
weave script unreleased
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
See 'docker run --help'.
unable to detect proxy TLS configuration
都装好了,都可以玩了, 又发现了这个错误,菊花真的很疼啊,没有检测到代理的配置
[root@localhost bin]# weave launch
cannot locate running docker daemon
Warning: unable to detect proxy TLS configuration. To enable TLS, launch the proxy with 'weave launch' and supply TLS options. To suppress this warning, supply the '--no-detect-tls' option.
解决方法一
同提示的那样,关闭tls的检测就可以了
#眼不见,心不烦,所以采取不检测tls的操作
weave launch --no-detect-tls