类似问题的问题可能已在stackoverflow中多次询问。但经过搜索,我发现没有答案可以解决我的问题。所以我在这里张贴以寻求你的帮助。
我的系统是Ubuntu 14.04。在设置master和minion(名为“minion1”)之后,我使用命令
在master上测试saltsalt 'minion1' test.ping
我收到以下错误:
minion1:
Minion did not return. [Not connected]
根据其他人的建议,我测试了以下命令:
在minion上,我首先删除以前的主密钥:
rm /etc/salt/pki/minion/minion_master.pub
并重新启动minion,但仍然失败。因此我们消除了无与伦比的主密钥的情况。
在小兵身上,我执行
salt-call test.ping
得到:
local:
True
所以主人和奴才之间的沟通很好。
在小兵身上,我首先使用命令停止盐奴:
service salt-minion stop
使用命令:
在调试模式下运行它salt-minion -l debug
获得以下回报:
[DEBUG ] Reading configuration from /etc/salt/minion
[INFO ] Using cached minion ID from /etc/salt/minion_id: minion1
[DEBUG ] loading log_handlers in ['/var/cache/salt/minion/extmods/log_handlers', '/usr/lib/python2.7/dist-packages/salt/log/handlers']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/log_handlers, it is not a directory
[DEBUG ] Configuration file path: /etc/salt/minion
[INFO ] Setting up the Salt Minion "minion1"
[DEBUG ] Created pidfile: /var/run/salt-minion.pid
[DEBUG ] Chowned pidfile: /var/run/salt-minion.pid to user: root
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] loading grain in ['/var/cache/salt/minion/extmods/grains', '/usr/lib/python2.7/dist-packages/salt/grains']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/grains, it is not a directory
[DEBUG ] Attempting to authenticate with the Salt Master at 192.168.0.101
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Decrypting the current master AES key
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[INFO ] Authentication with master successful!
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Decrypting the current master AES key
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] loading grain in ['/var/cache/salt/minion/extmods/grains', '/usr/lib/python2.7/dist-packages/salt/grains']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/grains, it is not a directory
[DEBUG ] loading module in ['/var/cache/salt/minion/extmods/modules', '/usr/lib/python2.7/dist-packages/salt/modules']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/modules, it is not a directory
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded linux_acl as virtual acl
[DEBUG ] Loaded apt as virtual pkg
[DEBUG ] Loaded sysmod as virtual sys
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded upstart as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Loaded cmdmod as virtual cmd
[DEBUG ] loading returner in ['/var/cache/salt/minion/extmods/returners', '/usr/lib/python2.7/dist-packages/salt/returners']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/returners, it is not a directory
[DEBUG ] Loaded syslog_return as virtual syslog
[DEBUG ] Loaded couchdb_return as virtual couchdb
[DEBUG ] Loaded carbon_return as virtual carbon
[DEBUG ] Loaded sqlite3_return as virtual sqlite3
[ERROR ] An un-handled exception was caught by salt's global exception handler:
UnpackValueError:
Traceback (most recent call last):
File "/usr/bin/salt-minion", line 14, in <module>
salt_minion()
File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 30, in salt_minion
minion.start()
File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 219, in start
self.prepare()
File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 207, in prepare
self.minion = salt.minion.Minion(self.config)
File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 518, in __init__
self.returners)
File "/usr/lib/python2.7/dist-packages/salt/utils/schedule.py", line 71, in __init__
clean_proc_dir(opts)
File "/usr/lib/python2.7/dist-packages/salt/utils/schedule.py", line 267, in clean_proc_dir
job = salt.payload.Serial(opts).load(fp_)
File "/usr/lib/python2.7/dist-packages/salt/payload.py", line 108, in load
return self.loads(data)
File "/usr/lib/python2.7/dist-packages/salt/payload.py", line 95, in loads
return msgpack.loads(msg, use_list=True)
File "_unpacker.pyx", line 119, in msgpack._unpacker.unpackb (msgpack/_unpacker.cpp:119)
UnpackValueError
Traceback (most recent call last):
File "/usr/bin/salt-minion", line 14, in <module>
salt_minion()
File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 30, in salt_minion
minion.start()
File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 219, in start
self.prepare()
File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 207, in prepare
self.minion = salt.minion.Minion(self.config)
File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 518, in __init__
self.returners)
File "/usr/lib/python2.7/dist-packages/salt/utils/schedule.py", line 71, in __init__
clean_proc_dir(opts)
File "/usr/lib/python2.7/dist-packages/salt/utils/schedule.py", line 267, in clean_proc_dir
job = salt.payload.Serial(opts).load(fp_)
File "/usr/lib/python2.7/dist-packages/salt/payload.py", line 108, in load
return self.loads(data)
File "/usr/lib/python2.7/dist-packages/salt/payload.py", line 95, in loads
return msgpack.loads(msg, use_list=True)
File "_unpacker.pyx", line 119, in msgpack._unpacker.unpackb (msgpack/_unpacker.cpp:119)
msgpack.exceptions.UnpackValueError
这个问题在那里停留了一段时间,有人可以帮助我吗?提前谢谢!
修改
我在帖子之后发现了一件奇怪的事情。当我运行命令
时service salt-minion status
奇怪的是它回来了:
salt-minion stop/waiting
如果我使用:ps aux| grep salt-minion
进一步检查,我发现没有正在运行的salt-minion进程。我想知道这就是salt minion1 test.ping
无法返回正确值的原因。但是,无论我做了什么(service salt-minion start
),我都永远无法让service salt-minion status
表示盐 - 小兵开始/跑步。我现在该怎么办?