【saltstack】配置salt-master端REDIS_RETURN

实现配置相对简单,在/etc/salt/master中增加:

master_job_cache: redis
redis.db: '0'
redis.host: 'redis-host-addr'
redis.port: 6379

需要注意的是,需要在salt的Python包中安装redis模块,不然会报错。

pip install redis

报错信息:

  1. minion端return_redis报错
    如果在minion端增加redis配置,没有安装redis会报错:
 salt "*" test.ping --return redis
2021-04-08 12:59:41,356 [salt.utils.lazy  :102 ][DEBUG   ][10568] LazyLoaded nagios.list_plugins
2021-04-08 12:59:41,369 [salt.utils.lazy  :106 ][DEBUG   ][10568] Could not LazyLoad redis.returner: 'redis.returner' is not available.
2021-04-08 12:59:41,369 [salt.minion      :2052][ERROR   ][10568] Returner redis.returner could not be loaded: 'redis.returner' is not available.
2021-04-08 12:59:42,217 [salt.utils.process:1055][DEBUG   ][10303] Subprocess ProcessPayload-Job-20210408045940409389 cleaned up
2021-04-08 13:59:29,218 [salt.utils.schedule:1722][DEBUG   ][10303] schedule: Job __mine_interval was scheduled with jid_include, adding to cache (jid_include defaults to True)
  1. master端return redis报错:
2021-04-07 16:48:18,996 [salt.master      :2335][ERROR   ][29820] Failed to allocate a jid. The requested returner 'redis' could not be loaded.
2021-04-07 16:48:18,997 [salt.transport.zeromq:879 ][ERROR   ][29820] Some exception handling a payload from minion
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/salt/transport/zeromq.py", line 875, in handle_message
    ret, req_opts = yield self.payload_handler(payload)
  File "/usr/lib/python3.6/site-packages/salt/ext/tornado/gen.py", line 1056, in run
    value = future.result()
  File "/usr/lib/python3.6/site-packages/salt/ext/tornado/concurrent.py", line 249, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "/usr/lib/python3.6/site-packages/salt/ext/tornado/gen.py", line 294, 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 1060, in _handle_payload
    ret = {"aes": self._handle_aes, "clear": self._handle_clear}[key](load)
  File "/usr/lib/python3.6/site-packages/salt/master.py", line 1101, in _handle_clear
    ret = method(load), {"fun": "send_clear"}
  File "/usr/lib/python3.6/site-packages/salt/master.py", line 2286, in publish
    payload = self._prep_pub(minions, jid, clear_load, extra, missing)
  File "/usr/lib/python3.6/site-packages/salt/master.py", line 2373, in _prep_pub
    self.event.fire_event({"minions": minions}, clear_load["jid"])
  File "/usr/lib/python3.6/site-packages/salt/utils/event.py", line 808, in fire_event
    salt.utils.stringutils.to_bytes(tag),
  File "/usr/lib/python3.6/site-packages/salt/utils/stringutils.py", line 54, in to_bytes
    raise TypeError("expected str, bytes, or bytearray not {}".format(type(s)))
TypeError: expected str, bytes, or bytearray not <class 'dict'>
2021-04-07 16:48:18,998 [tornado.general  :462 ][ERROR   ][29820] Uncaught exception in zmqstream callback
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/zmq/sugar/socket.py", line 426, in send_multipart
    memoryview(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 454, in _handle_events
    self._handle_send()
  File "/usr/lib64/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 493, in _handle_send
    status = self.socket.send_multipart(msg, **kwargs)
  File "/usr/lib64/python3.6/site-packages/zmq/sugar/socket.py", line 433, in send_multipart
    i, rmsg,
TypeError: Frame 0 ('Some exception handling minion ...) does not support the buffer interface.
2021-04-07 16:48:18,999 [tornado.application:640 ][ERROR   ][29820] Exception in callback functools.partial(<function wrap.<locals>.null_wrapper at 0x7f857a9be950>)
Traceback (most recent call last):
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

^白开水^

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值