最近由于salt-minion和salt-minion的版本过低,master一执行salt命令就抛异常,后来上网查发现是低版本bug,要想恢复正常只能重启master或升级master和minion。
下面是其异常:
SaltReqTimeoutError: Waited 60 seconds 2014-02-20 11:56:51,436 [salt.log.setup ][ERROR ] An un-handled exception was caught by salt's global exception handler: SaltReqTimeoutError: Waited 60 seconds Traceback (most recent call last): File "/usr/bin/salt", line 10, in <module> salt_main() File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 117, in salt_main client.run() File "/usr/lib/python2.6/site-packages/salt/cli/__init__.py", line 133, in run for full_ret in cmd_func(**kwargs): File "/usr/lib/python2.6/site-packages/salt/client/__init__.py", line 471, in cmd_cli **kwargs) File "/usr/lib/python2.6/site-packages/salt/client/__init__.py", line 228, in run_job **kwargs) File "/usr/lib/python2.6/site-packages/salt/client/__init__.py", line 1216, in pub payload = sreq.send('clear', payload_kwargs) File "/usr/lib/python2.6/site-packages/salt/payload.py", line 193, in send timeout * tried SaltReqTimeoutError: Waited 60 seconds 2014-02-20 11:58:46,176 [salt.log.setup ][ERROR ] An un-handled exception was caught by salt's global exception handler: SaltReqTimeoutError: Waited 60 seconds Traceback (most recent call last):
后面salt-ssh一键升级完毕能够正常使用了,但是执行salt-run manage.status的时候发现好多台minion没有起来,坑啊!赶快贴一下报错:
minion报错: NameError: global name 'zmq' is not defined 2014-02-28 22:25:25,606 [salt.log.setup ][ERROR ] An un-handled exception was caught by salt's global exception handler: NameError: global name 'zmq' is not defined Traceback (most recent call last): File "/usr/bin/salt-minion", line 14, in <module> salt_minion() File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 30, in salt_minion minion.start() File "/usr/lib/python2.6/site-packages/salt/__init__.py", line 219, in start self.prepare() File "/usr/lib/python2.6/site-packages/salt/__init__.py", line 207, in prepare self.minion = salt.minion.Minion(self.config) File "/usr/lib/python2.6/site-packages/salt/minion.py", line 503, in __init__ self.authenticate(timeout, safe) File "/usr/lib/python2.6/site-packages/salt/minion.py", line 954, in authenticate creds = auth.sign_in(timeout, safe) File "/usr/lib/python2.6/site-packages/salt/crypt.py", line 351, in sign_in self.opts['master_uri'], File "/usr/lib/python2.6/site-packages/salt/payload.py", line 159, in __init__ self.context = zmq.Context() NameError: global name 'zmq' is not defined 2014-02-28 23:26:47,806 [salt.log.setup ][ERROR ] An un-handled exception was caught by salt's global exception handler: NameError: global name 'zmq' is not defined
这个报错很明显找不到python的zmq,"rpm -qa|grep python-zmq"查看软件已经安装,
执行“import zmq”的时候出现没有zmq模块,这样的话很可能是系统找不到动态链接库。
解决方法:
把python-zmq的库路径"/usr/lib/"写到"/etc/ld.so.conf“并执行“ldconfig”。
或者”export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/“
这样再重启我们的salt-minion就可以起来了。
salt-ssh使用很简对于saltstack升级来说很好用,salt-ssh的批量部署推荐大家一篇绿肥的文章:http://pengyao.org/howto_setup_salt_ssh_from_minion.html