localhost:5672上的AMQP服务器无法访问:[Errno 111] ECONNREFUSED

时间:2016-09-22 06:00:02

标签: openstack devstack

我正在尝试将不同虚拟机上的其他计算节点添加到预安装的openstack中。我禁用了防火墙服务,启用了ping其他虚拟机..但仍然计算节点无法注册在控制器节点上运行的Rabbitmq服务。 这是我的nova.conf文件...

[DEFAULT]
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
state_path=/var/lib/nova
lock_path=/var/lock/nova
force_dhcp_release=True
iscsi_helper=tgtadm
libvirt_use_virtio_for_bridges=True
connection_type=libvirt
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
verbose=True
ec2_private_dns_show_ip=True
api_paste_config=/etc/nova/api-paste.ini
volumes_path=/var/lib/nova/volumes
enabled_apis=ec2,osapi_compute,metadata
rpc_backend = rabbit
auth_strategy = keystone
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
my_ip = #compute node ip
rabbit_host= #controller_node_ip
rabbit_port = 5672
rabbit_userid = stackrabbit
rabbit_password = devstack
rabbit_use_ssl = False
rabbit_virtual_host=/

[keystone_authtoken]
auth_uri = http://controller_node_ip:5000
auth_url = http://controller_node_ip:35357
memcached_servers = controller_node_ip:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = devstack
auth_host = controller_node_ip
auth_port = 35357
auth_protocol = http

[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller_node_ip:6080/vnc_auto.html

[glance]
api_servers = http://controller_node_ip:9292

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

这是我的nova-compute.log:

2016-09-20 19:08:57.701 7201 INFO oslo.messaging._drivers.impl_rabbit [-] Reconnecting to AMQP server on localhost:5672
2016-09-20 19:08:57.701 7201 INFO oslo.messaging._drivers.impl_rabbit [-] Delaying reconnect for 1.0 seconds...
2016-09-20 19:08:58.708 7201 ERROR oslo.messaging._drivers.impl_rabbit [-] AMQP server on localhost:5672 is unreachable: [Errno 111] ECONNREFUSED. Trying again in 30 seconds...

请建议我,以便我可以解决这个问题... 提前谢谢你......

1 个答案:

答案 0 :(得分:0)

我在扩展我的nova-compute资产时遇到了这个问题(虽然我没有使用Devstack)。

在我新创建的计算服务器中,在/var/log/nova/nova-compute.log中可以看到以下内容: -

2017-11-14 11:40:53.287 52408错误oslo.messaging._drivers.impl_rabbit [req-adfd6dc7-fe8c-4de5-8401-58d325c3b4a8 - - - - - ] [be6e0302-dfc8-4512-8b48-0d824fc6ea14 ] 127.0.0.1:5672上的AMQP服务器无法访问:[Errno 111] ECONNREFUSED。在1秒钟内再次尝试。客户端端口:无

解决方案非常简单。我检查了/ var / log / sysinfo(我在Redhat系统上运行ubuntu; / var / log / messages),可以看到以下几行: -

Nov 14 12:01:48 compute2 systemd[1]: Started OpenStack Compute.
Nov 14 12:01:49 compute2 nova-compute[3222]: Traceback (most recent call last):
Nov 14 12:01:49 compute2 nova-compute[3222]:   File "/usr/bin/nova-compute", line 10, in <module>
Nov 14 12:01:49 compute2 nova-compute[3222]:     sys.exit(main())
Nov 14 12:01:49 compute2 nova-compute[3222]:   File "/usr/lib/python2.7/dist-packages/nova/cmd/compute.py", line 42, in main
Nov 14 12:01:49 compute2 nova-compute[3222]:     config.parse_args(sys.argv)
Nov 14 12:01:49 compute2 nova-compute[3222]:   File "/usr/lib/python2.7/dist-packages/nova/config.py", line 52, in parse_args
Nov 14 12:01:49 compute2 nova-compute[3222]:     default_config_files=default_config_files)
Nov 14 12:01:49 compute2 nova-compute[3222]:   File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2355, in __call__
Nov 14 12:01:49 compute2 nova-compute[3222]:     self._namespace._files_permission_denied)
Nov 14 12:01:49 compute2 nova-compute[3222]: oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files: /etc/nova/nova.conf
Nov 14 12:01:49 compute2 systemd[1]: nova-compute.service: Main process exited, code=exited, status=1/FAILURE

这表明我的/etc/nova/nova.conf文件不可读。事实证明这是因为我使用scp将nova.conf从我的第一个计算机复制到我的新机器,并且该文件对root用户是只读的。解决方案是(在我的新计算上)

cd /etc/nova/
chown nova:nova nova.conf
service nova-compute restart