Ubuntu 16.04下安装OpenStack(juno)之add the compute service报错分析

根据官方文档,执行

$ source admin-openrc.sh

$ nova service-list

报错如下:

ada-ubuntu@ada-ubuntu:~$ nova service-list
+----+------------------+------------+----------+---------+-------+------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at | Disabled Reason |
+----+------------------+------------+----------+---------+-------+------------+-----------------+
| 3  | nova-cert        | ada-ubuntu | internal | enabled | down  | -          | -               |
| 4  | nova-consoleauth | ada-ubuntu | internal | enabled | down  | -          | -               |
| 5  | nova-scheduler   | ada-ubuntu | internal | enabled | down  | -          | -               |
| 6  | nova-conductor   | ada-ubuntu | internal | enabled | down  | -          | -               |
+----+------------------+------------+----------+---------+-------+------------+-----------------+

可看出Host少了一个compute, State全为down


首先查看/nova-compute日志:

sudo vim /var/log/nova/nova-compute.log

显示:

2017-09-26 16:48:16.257 14024 ERROR nova     (class_id, method_id), ConnectionError)
2017-09-26 16:48:16.257 14024 ERROR nova AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
2017-09-26 16:48:16.257 14024 ERROR nova

然后查看rabbitmq日志:

sudo vim /var/log/rabbitmq/rabbit@ada-ubuntu.log

显示:

=INFO REPORT==== 26-Sep-2017::18:43:56 ===
accepting AMQP connection <0.7526.1> (10.0.0.31:34092 -> 10.0.0.11:5672)

=ERROR REPORT==== 26-Sep-2017::18:43:56 ===
closing AMQP connection <0.7523.1> (10.0.0.31:34090 -> 10.0.0.11:5672):
{handshake_error,starting,0,
                 {amqp_error,access_refused,
                             "AMQPLAIN login refused: user 'guest' can only connect via localhost",
                             'connection.start_ok'}}


解决方法:

修改配置文件/etc/rabbitmq/rabbitmq.config。如不存在,自己创建一个,在里面添加如下1行内容:[rabbit,[{loopback_users,[]}]}].

重启rabbitmq:

root@ada-ubuntu:/home/ada-ubuntu# service rabbitmq-server restart

发现问题仍未解决!

然后查看rabbitmq日志:

sudo vim /var/log/rabbitmq/rabbit@ada-ubuntu.log

显示:

=INFO REPORT==== 26-Sep-2017::18:52:08 ===
accepting AMQP connection <0.217.0> (10.0.0.31:34132 -> 10.0.0.11:5672)

连接已建立,再往上看日志:

=ERROR REPORT==== 26-Sep-2017::18:52:05 ===
Error on AMQP connection <0.236.0> (10.0.0.31:34128 -> 10.0.0.11:5672, vhost: '/', user: 'guest', state: running), channel 0:
{amqp_error,connection_forced,
            "broker forced connection closure with reason 'shutdown'",none}

接着重启所有compute services,问题解决!

root@ada-ubuntu:/home/ada-ubuntu# service nova-api restart
root@ada-ubuntu:/home/ada-ubuntu# service nova-cert restart
root@ada-ubuntu:/home/ada-ubuntu# service nova-consoleauth restart
root@ada-ubuntu:/home/ada-ubuntu# service nova-scheduler restart
root@ada-ubuntu:/home/ada-ubuntu# service nova-conductor restart
root@ada-ubuntu:/home/ada-ubuntu# service nova-novncproxy restart

重新执行指令如下:

ada-ubuntu@ada-ubuntu:~$ source admin-openrc.sh
ada-ubuntu@ada-ubuntu:~$ nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 3  | nova-cert        | ada-ubuntu | internal | enabled | up    | 2017-09-26T13:03:46.000000 | -               |
| 4  | nova-consoleauth | ada-ubuntu | internal | enabled | up    | 2017-09-26T13:03:48.000000 | -               |
| 5  | nova-scheduler   | ada-ubuntu | internal | enabled | up    | 2017-09-26T13:03:46.000000 | -               |
| 6  | nova-conductor   | ada-ubuntu | internal | enabled | up    | 2017-09-26T13:03:46.000000 | -               |
| 7  | nova-compute     | ada-ubuntu | nova     | enabled | up    | 2017-09-26T13:03:46.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+


原文地址:https://www.cnblogs.com/a3192048/p/12241348.html