compute节点上开启服务openstack-nova-compute.service时,无法启动的解决方法

时间:2024-01-25 19:46:14

      本文前一部分为本人解决问题的过程,但最终没有解决;无奈在网上找方法时,看到有网友评论说:修改controller上的guest账号密码,再重启openstack-nova-compute.service就可正常重启,结果一试,问题解决,感谢大神。

 

1. 在compute节点上开启服务openstack-nova-compute.service时,无法启动,命令一直卡着不动,如下:

2.查看日志,在/var/log/nova-compute.log中看到在controller上的5672端口不可达:

3. 在controller节点上放通防火墙5672端口:

[root@controller ~]# firewall-cmd --zone=public --add-port=5672/tcp --permanent              //放通5672端口
Warning: ALREADY_ENABLED: 5672:tcp
success

[root@controller ~]# systemctl restart firewalld                                                                    //重启防火墙
[root@controller ~]# firewall-cmd --zone=public --query-port=5672/tcp                               //查看5672端口是否放通
yes

4. 在compute节点上,重启libvirtd.service,openstack-nova-compute.service。发现libvirtd.service正常启动,openstack-nova-compute.service仍然无法启动。

[root@compute1 ~]# systemctl start libvirtd.service
[root@compute1 ~]# systemctl start openstack-nova-compute.service
Job for openstack-nova-compute.service failed because the control process exited with error code. See "systemctl status openstack-nova-compute.service" and "journalctl -xe" for details.

5. 查看journalctl -xe报错,仅仅只能看到服务启动失败,仍然没有有效信息。

6. 同时,查看compute节点上的nova-compute.log日志文件,发现身份验证机制AMQPLAIN拒绝登录。

7. 返回到controller节点,核查rabbitmq服务是否开启,5672端口是否打开,结果显示都是正常打开。

[root@controller ~]# ps -ef|grep rabbitmq
rabbitmq  1345     1  0 02:14 ?        00:00:25 /usr/lib64/erlang/erts-7.3.1.2/bin/beam -W w -A 64 -P 1048576 -t 5000000 -stbt db -K true -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/ebin -noshell -noinput -s rabbit boot -sname rabbit@controller -boot start_sasl -config /etc/rabbitmq/rabbitmq -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@controller.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@controller-sasl.log"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@controller-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@controller" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672
rabbitmq  2254  1345  0 02:14 ?        00:00:00 inet_gethost 4
rabbitmq  2255  2254  0 02:14 ?        00:00:00 inet_gethost 4
root     25827 15202  0 10:40 pts/3    00:00:00 grep --color=auto mq
You have mail in /var/spool/mail/root
[root@controller ~]# netstat -na|grep 5672
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN
tcp6       0      0 :::5672                 :::*                    LISTEN

8. 于是又看了下rabbitmq日志(/var/log/rabbitmq/rabbit\@controller.log-20190725),结果显示用户openstack拥有无效凭证,如下:

9. 心想重新给用户openstack赋予权限试下:

[root@controller rabbitmq]# rabbitmqctl list_users
Listing users ...
openstack    []
guest    [administrator]
[root@controller rabbitmq]# rabbitmqctl set_permissions -p / openstack '.*' '.*' '.*'
Setting permissions for user "openstack" in vhost "/" ...
[root@controller rabbitmq]# systemctl restart rabbitmq_server.service

10. 结果仍然提示相同的错误,于是在网上查看网友的解决方法,就看到一个网友说自己修改了用户guest的密码后,恢复正常;尝试后故障恢复。

[root@controller rabbitmq]# rabbitmqctl change_password guest shroot123
Changing password for user "guest" ...
[root@controller rabbitmq]# systemctl restart rabbit_server.service                                   //修改完后重启会有以下报错,等会再重启就可以正常
Failed to restart rabbit_server.service: Unit not found.
[root@controller rabbitmq]# systemctl restart rabbitmq-server.service   

[root@controller rabbitmq]# systemctl status rabbitmq-server.service
● rabbitmq-server.service - RabbitMQ broker
   Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabl
   Active: active (running) since Thu 2019-07-25 11:24:37 CST; 5s ago
  Process: 31959 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
 Main PID: 32075 (beam)
   Status: "Initialized"
   CGroup: /system.slice/rabbitmq-server.service
           ├─32075 /usr/lib64/erlang/erts-7.3.1.2/bin/beam -W w -A 64 -P 1048576 -t 5000000 -stbt
           ├─32271 inet_gethost 4
           └─32272 inet_gethost 4

Jul 25 11:24:35 controller systemd[1]: Starting RabbitMQ broker...
Jul 25 11:24:36 controller rabbitmq-server[32075]: RabbitMQ 3.6.5. Copyright (C) 2007-2016 Pivotal
Jul 25 11:24:36 controller rabbitmq-server[32075]: ##  ##      Licensed under the MPL.  See http:/
Jul 25 11:24:36 controller rabbitmq-server[32075]: ##  ##
Jul 25 11:24:36 controller rabbitmq-server[32075]: ##########  Logs: /var/log/rabbitmq/rabbit@cont
Jul 25 11:24:36 controller rabbitmq-server[32075]: ######  ##        /var/log/rabbitmq/rabbit@cont
Jul 25 11:24:36 controller rabbitmq-server[32075]: ##########
Jul 25 11:24:36 controller rabbitmq-server[32075]: Starting broker...
Jul 25 11:24:37 controller systemd[1]: Started RabbitMQ broker.
Jul 25 11:24:37 controller rabbitmq-server[32075]: completed with 0 plugins.
再返回compute节点重启openstack-nova-compute.service,正常。
[root@compute1 ~]# systemctl restart openstack-nova-compute.service
[root@compute1 ~]# systemctl status openstack-nova-compute.service
● openstack-nova-compute.service - OpenStack Nova Compute Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-07-25 12:18:40 CST; 6s ago
 Main PID: 12552 (nova-compute)
    Tasks: 22
   CGroup: /system.slice/openstack-nova-compute.service
           └─12552 /usr/bin/python2 /usr/bin/nova-compute

Jul 25 12:18:34 compute1 systemd[1]: Stopped OpenStack Nova Compute Server.
Jul 25 12:18:34 compute1 systemd[1]: Starting OpenStack Nova Compute Server...
Jul 25 12:18:40 compute1 systemd[1]: Started OpenStack Nova Compute Server.
Jul 25 12:18:40 compute1 nova-compute[12552]: /usr/lib/python2.7/site-packages/oslo_messaging/...
Jul 25 12:18:40 compute1 nova-compute[12552]: access_policy)
Hint: Some lines were ellipsized, use -l to show in full.

 

       虽然问题解决了,但仍然一头雾水,不明原因,不过问题解决也挺开心,因此也将自己解决的这个过程分享出来,希望对大家有帮助,也希望有哪位网友分析出原因,请在评论区回复,谢谢。