问题景观警报 - 有问题的脚本:update_security_db.sh可能看起来相似,但问题不同,这里的错误消息表明连接被拒绝,问题表明连接丢失。
Landscape 的 update_security_db.sh 似乎运行不正确。尝试手动运行脚本时的输出如下;
<11>Oct 4 19:18:16 update-security-db: Traceback (most recent call last):
<11>Oct 4 19:18:16 update-security-db: File "./process-usns", line 7, in <module>
<11>Oct 4 19:18:16 update-security-db: canonical.landscape.scripts.usn.run()
<11>Oct 4 19:18:16 update-security-db: File "/opt/canonical/landscape/canonical/landscape/scripts/batch.py", line 64, in __call__
<11>Oct 4 19:18:16 update-security-db: self.setup()
<11>Oct 4 19:18:16 update-security-db: File "/opt/canonical/landscape/canonical/landscape/scripts/batch.py", line 105, in setup
<11>Oct 4 19:18:16 update-security-db: self._stop_amqp_client = run_amqp_client_in_thread(config)
<11>Oct 4 19:18:16 update-security-db: File "/opt/canonical/landscape/canonical/landscape/setup.py", line 336, in run_amqp_client_in_thread
<11>Oct 4 19:18:16 update-security-db: blockingCallFromThread(reactor, lambda: started)
<11>Oct 4 19:18:16 update-security-db: File "/usr/lib/python2.7/dist-packages/twisted/internet/threads.py", line 122, in blockingCallFromThread
<11>Oct 4 19:18:16 update-security-db: result.raiseException()
<11>Oct 4 19:18:16 update-security-db: File "<string>", line 2, in raiseException
<11>Oct 4 19:18:16 update-security-db: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.
Landscape 的服务器日志中也显示了相同的错误。我真的不知道是什么原因造成的。
答案1
我遇到过同样的情况。我在主机名包含大写字母的服务器上使用了 Landscape-Server,并将主机名中的大写字母更改为小写字母。然后,我清除landscape-server-quickstart
并重新安装了它。这解决了问题。
sudo apt purge landscape-server-quickstart
sudo apt purge rabbitmq-server # remove rabbitmq settings too.
sudo apt autoremove
sudo apt install landscape-server-quickstart
答案2
检查 rabbitmq 是否正常,因为当它关闭时,当它尝试处理下载的文件时也会收到 111 错误。
当 rabbitmq 运行不正常时我也遇到过同样的情况,并且rabbitmqctl status
显示
Status of node rabbit@landscape
Error: unable to connect to node rabbit@landscape: nodedown
DIAGNOSTICS
===========
attempted to contact: [rabbit@landscape]
rabbit@landscape:
* connected to epmd (port 4369) on landscape
* epmd reports: node 'rabbit' not running at all
other nodes on landscape: ['rabbitmq-cli-55']
* suggestion: start the node
但是该命令rabbitmqctl start_app
没有启动它并给出错误:
Starting node rabbit@landscape
Error: unable to connect to node rabbit@landscape: nodedown
我在一个论坛上找到了一份报告,报告显示清除 RabbitMQ 日志是有效的。我尝试了以下方法:
sudo service rabbitmq-server stop
sudo rm -rf /var/log/rabbitmq/*
sudo service rabbitmq-server start
之后,我可以rabbitmqctl start_app
启动节点了。sudo -u landscape bash -x /opt/canonical/landscape/scripts/update_security_db.sh
现在手动调用 update_security_db 脚本就可以了