首页 技术 正文
技术 2022年11月15日
0 收藏 305 点赞 4,590 浏览 4629 个字

总结:

对于python2.7环境下的salt来说,要安装pip install mysql-python

对于python3环境下的salt来说,pip install mysqlclient的时候要和salt在同一个目录下

1、生产环境3.6的,这个怎么整呢

1、2019.2 的salt

[root@IP ~]# salt-call --versions-report
Salt Version:
Salt: 2019.2.0Dependency Versions:
cffi: Not Installed
cherrypy: 5.6.0
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8.1
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: 1.4.6
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.8 (default, Aug 7 2019, 17:28:10)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.4.2
ZMQ: 4.1.4System Versions:
dist: centos 7.3.1611 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-514.el7.x86_64
system: Linux
version: CentOS Linux 7.3.1611 Core[root@IP ~]#

2、python3.6

03_已解决 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

2、 报错

03_已解决 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

2019-11-29 14:59:46,062 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.
2019-11-29 14:59:46,063 [salt.transport.zeromq:754 ][ERROR ][6219] Some exception handling a payload from minion
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/salt/transport/zeromq.py", line 750, in handle_message
ret, req_opts = yield self.payload_handler(payload)
File "/usr/lib64/python3.6/site-packages/tornado/gen.py", line 1015, in run
value = future.result()
File "/usr/lib64/python3.6/site-packages/tornado/concurrent.py", line 236, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
File "/usr/lib64/python3.6/site-packages/tornado/gen.py", line 270, in wrapper
result = func(*args, **kwargs)
File "/usr/lib64/python3.6/types.py", line 248, in wrapped
coro = func(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/master.py", line 1064, in _handle_payload
'clear': self._handle_clear}[key](load)
File "/usr/lib/python3.6/site-packages/salt/master.py", line 1095, in _handle_clear
ret = getattr(self.clear_funcs, cmd)(load), {'fun': 'send_clear'}
File "/usr/lib/python3.6/site-packages/salt/master.py", line 2137, in publish
payload = self._prep_pub(minions, jid, clear_load, extra, missing)
File "/usr/lib/python3.6/site-packages/salt/master.py", line 2233, in _prep_pub
self.event.fire_event({'minions': minions}, clear_load['jid'])
File "/usr/lib/python3.6/site-packages/salt/utils/event.py", line 744, in fire_event
salt.utils.stringutils.to_bytes(tag),
File "/usr/lib/python3.6/site-packages/salt/utils/stringutils.py", line 61, in to_bytes
raise TypeError('expected bytes, bytearray, or str')
TypeError: expected bytes, bytearray, or str
2019-11-29 14:59:46,065 [tornado.general :452 ][ERROR ][6219] Uncaught exception, closing connection.
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/zmq/sugar/socket.py", line 356, in send_multipart
_buffer_type(msg)
TypeError: memoryview: a bytes-like object is required, not 'str'During handling of the above exception, another exception occurred:Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 444, in _handle_events
self._handle_send()
File "/usr/lib64/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 487, in _handle_send
status = self.socket.send_multipart(msg, **kwargs)
File "/usr/lib64/python3.6/site-packages/zmq/sugar/socket.py", line 363, in send_multipart
i, rmsg,
TypeError: Frame 0 ('Some exception handling minion ...) does not support the buffer interface.
2019-11-29 14:59:46,065 [tornado.application:632 ][ERROR ][6219] Exception in callback None
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/zmq/sugar/socket.py", line 356, in send_multipart
_buffer_type(msg)
TypeError: memoryview: a bytes-like object is required, not 'str'During handling of the above exception, another exception occurred:Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/tornado/ioloop.py", line 886, in start
handler_func(fd_obj, events)
File "/usr/lib64/python3.6/site-packages/tornado/stack_context.py", line 274, in null_wrapper
return fn(*args, **kwargs)
File "/usr/lib64/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 444, in _handle_events
self._handle_send()
File "/usr/lib64/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 487, in _handle_send
status = self.socket.send_multipart(msg, **kwargs)
File "/usr/lib64/python3.6/site-packages/zmq/sugar/socket.py", line 363, in send_multipart
i, rmsg,
TypeError: Frame 0 ('Some exception handling minion ...) does not support the buffer interface

3、原因:

又是提示我,未加载mysqlpy,这次我是真的装了

03_已解决 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

mysql环境也是3.6的。

salt也是3.6的

03_已解决 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

难道是 位置不在一起???

4、解决1:

卸载重装

[root@IP ~]# pip3 uninstall mysqlclient
[root@IP salt]# pip3 install mysql-client

03_已解决 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

依旧问题存在

5、解决2:完成

也许真的是没在一个目录

pip安装指定目录  https://blog.csdn.net/guotong1988/article/details/61196363

[root@IP salt]# pip3 install --target=/usr/lib/python3.6/site-packages/ mysql-client

03_已解决 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

6、结果:成了

03_已解决 [salt.master      :2195][ERROR   ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,960
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,484
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,330
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,113
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,745
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,779