【问题标题】:Salt command takes about 5 Seconds to finishSalt 命令大约需要 5 秒才能完成
【发布时间】:2016-05-24 14:30:49
【问题描述】:

我的一个 Saltstack 安装对于我在其上运行的每个 salt 命令总是有 5 秒的延迟,即此命令需要 5.236 秒才能运行,而不同的系统没有延迟。

看起来minion(与master在同一台机器上运行)并没有告诉master它已经完成了它的命令,但是命令最终运行良好。

慢速环境的“Trace”输出

root@salt01-master:~# time salt -l trace 'salt01-master' test.ping
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: salt01-master
[DEBUG   ] Missing configuration file: /home/admin-user/.saltrc
[TRACE   ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found the in the configuration. Not loading the Logstash logging handlers module.
[DEBUG   ] Configuration file path: /etc/salt/master
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: salt01-master
[DEBUG   ] Missing configuration file: /home/admin-user/.saltrc
[DEBUG   ] MasterEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Sending event - data = {'_stamp': '2016-05-24T14:13:25.267566'}
[TRACE   ] get_event() received = {'tag': 'salt/event/new_client', 'data': {'_stamp': '2016-05-24T14:13:25.267566'}}
[TRACE   ] func get_cli_event_returns()
[DEBUG   ] LazyLoaded local_cache.get_load
[DEBUG   ] get_iter_returns for jid 20160524161325275691 sent to set(['salt01-master']) will timeout at 16:13:30.282984
[DEBUG   ] jid 20160524161325275691 return from salt01-master
[DEBUG   ] LazyLoaded nested.output
[TRACE   ] data = {'salt01-master': True}
salt01-master:
    True

real    0m5.236s
user    0m0.236s
sys 0m0.034s

运行良好的环境的“跟踪”输出。

root@salt01-master:~# time salt -l trace 'salt01-master' test.ping
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: salt01-master
[DEBUG   ] Missing configuration file: /home/admin-user/.saltrc
[TRACE   ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found the in the configuration. Not loading the Logstash logging handlers module.
[DEBUG   ] Configuration file path: /etc/salt/master
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: salt01-master
[DEBUG   ] Missing configuration file: /home/admin-user/.saltrc
[DEBUG   ] MasterEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Sending event - data = {'_stamp': '2016-05-24T14:13:53.621800'}
[TRACE   ] get_event() received = {'tag': 'salt/event/new_client', 'data': {'_stamp': '2016-05-24T14:13:53.621800'}}
[TRACE   ] func get_cli_event_returns()
[DEBUG   ] LazyLoaded local_cache.get_load
[DEBUG   ] get_iter_returns for jid 20160524161353631575 sent to set(['salt01-master']) will timeout at 16:13:58.637479
[DEBUG   ] jid 20160524161353631575 return from salt01-master
[DEBUG   ] LazyLoaded nested.output
[TRACE   ] data = {'salt01-master': True}
salt01-master:
    True
[DEBUG   ] jid 20160524161353631575 found all minions set(['salt01-master'])

real    0m0.283s
user    0m0.179s
sys 0m0.029s

正常工作的环境在“test.ping”命令的常规输出之后有一个额外的 [DEBUG] 行

谁能帮我指出正确的方向?

非常感谢。

【问题讨论】:

  • 您可以使用 DEBUG 日志级别重新启动 salt-master 守护进程,然后查看实际发生的情况。它会给你一个提示,让你延迟 5 秒。然后根据结果,您可以使用 DEBUG 重新启动应答 salt-minion 守护程序,并查看它实际上在做什么。

标签: salt-stack


【解决方案1】:

对于离线或消失的奴才,您是否有任何可接受的奴才密钥?这听起来像是盐大师正在等待一些失踪的仆从做出回应。

【讨论】:

  • 我所有的 Salt Minion 都已连接并即时回答。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-27
  • 1970-01-01
  • 2017-02-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多