遇到的问题如下:
root@Saltstack:/etc/salt# salt-key -L
Accepted Keys:
Unaccepted Keys:
Rejected Keys:
root@Saltstack:/etc/salt# salt-master -l debug
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: Saltstack.cs2cloud.internal
[DEBUG ] Configuration file path: /etc/salt/master
[INFO ] Setting up the Salt Master
[WARNING ] Unable to bind socket, error: [Errno 99] Cannot assign requested address
The ports are not available to bind
root@Saltstack:/etc/salt# salt-minion -l debug
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: Saltstack.cs2cloud.internal
[DEBUG ] Configuration file path: /etc/salt/minion
[INFO ] Setting up the Salt Minion "Saltstack.cs2cloud.internal"
[DEBUG ] Created pidfile: /var/run/salt-minion.pid
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Attempting to authenticate with the Salt Master at 192.168.101.26
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[ERROR ] Attempt to authenticate with the salt master failed
解决方法:
1,minion 无法认证 master, 查看minion 和master 配置问题,没有问题.
注:
2,minion , master 之间可以ping 通。本身在一台机器上。
3,从另一个minion进行测试。到60秒没有反馈。
4,根据这个提示
[WARNING ] Unable to bind socket, error: [Errno 99] Cannot assign requested address
The ports are not available to bind
调整端口数量。还是不好使,说明报错有问题,不是端口问题。
# echo 16777216 > /proc/sys/net/core/rmem_max
# echo 16777216 > /proc/sys/net/core/wmem_max
# echo "4096 87380 16777216" > /proc/sys/net/ipv4/tcp_rmem
# echo "4096 87380 16777216" > /proc/sys/net/ipv4/tcp_wmem
5 根据这个提示
[WARNING ] Unable to bind socket, error: [Errno 99] Cannot assign requested address
The ports are not available to bind
删除相关运行内容。
killall -SIGUSR2 salt-master
还是不好使,说明报错有问题,不是进行服务问题。
6 但是多次表明是ip地址的问题。最后进入python使用以下命令
#!/usr/bin/python env
import socket
myname = socket.getfqdn(socket.gethostname())
myaddr = socket.gethostbyname(myname)
print"myname= %s"% myname
print"myaddr= %s"% myaddr
反回值的地址,不是我机器地址。是10.10.10.10
而master 和minion配置的是192.168.10.10
ifconfig 查看机器地址为10.10.10.10 哦~~~~~~~~~~
为什么呢?因为我应用的是cloudstack上的VM,couldstack网络做了nat .
一会儿再写一下couldstack网络的问题分解。
本文转自luojinghappy 51CTO博客,原文链接:http://blog.51cto.com/luojinghappy/1628011,如需转载请自行联系原作者