欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

openstack排错之cinder排错

程序员文章站 2022-05-11 16:12:34
...

这里应对的是较为简单的openstack错误问题。

cinder

错误点:cinder.conf中的default中的my_ip 此处使用ip而非主机名
cinder.conf中的最后的lvm处,将卷组名搞错了

排查过程:
1、我们试一下,可以看见cinder列表,看不见明显错误。所以我们查看日志

[[email protected] ~]# cinder list
+----+--------+------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+----+--------+------+------+-------------+----------+-------------+
+----+--------+------+------+-------------+----------+-------------+

其他日志没有明显报错,只有volume有错 卷组有问题

tailf /var/log/cinder/volume.log 
日志信息如下,心跳节点关闭
2020-01-09 01:55:35.305 2029 ERROR cinder.service [-] Manager for service cinder-volume [email protected] is reporting problems, not sending heartbeat. Service will appear "down".
2020-01-09 01:55:45.311 2029 ERROR cinder.service [-] Manager for service cinder-volume [email protected] is reporting problems, not sending heartbeat. Service will appear "down".

2、遇到情况,我们首先查看ntp服务是否正常,未开则打开

[[email protected] ~]# systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: inactive (dead)


[[email protected] ~]# systemctl restart ntpd
[[email protected] ~]# systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-01-09 02:05:35 UTC; 2s ago
  Process: 5612 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 5613 (ntpd)
   CGroup: /system.slice/ntpd.service
           └─5613 /usr/sbin/ntpd -u ntp:ntp -g

Jan 09 02:05:35 xiandian ntpd[5613]: Listen and drop on 1 v6wildcard :: UDP 123
Jan 09 02:05:35 xiandian ntpd[5613]: Listen normally on 2 lo 127.0.0.1 UDP 123
Jan 09 02:05:35 xiandian ntpd[5613]: Listen normally on 3 eth0 10.0.0.104 UDP 123
Jan 09 02:05:35 xiandian ntpd[5613]: Listen normally on 4 lo ::1 UDP 123
Jan 09 02:05:35 xiandian ntpd[5613]: Listen normally on 5 eth0 fe80::f816:3eff:fe51:baea UDP 123
Jan 09 02:05:35 xiandian ntpd[5613]: Listen normally on 6 eth1 fe80::f816:3eff:fed6:7f4c UDP 123
Jan 09 02:05:35 xiandian ntpd[5613]: Listening on routing socket on fd #23 for interface updates
Jan 09 02:05:35 xiandian ntpd[5613]: 0.0.0.0 c016 06 restart
Jan 09 02:05:35 xiandian ntpd[5613]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Jan 09 02:05:35 xiandian ntpd[5613]: 0.0.0.0 c011 01 freq_not_set
[[email protected] ~]# 

3、同步本地时间,发现时间已经同步。

[[email protected] ~]# ntpdate 127.0.0.1
 9 Jan 02:06:20 ntpdate[5722]: the NTP socket is in use, exiting
[[email protected] ~]# lsof -i:ntp
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ntpd    5613  ntp   16u  IPv4  90941      0t0  UDP *:ntp 
ntpd    5613  ntp   17u  IPv6  90942      0t0  UDP *:ntp 
ntpd    5613  ntp   18u  IPv4  90947      0t0  UDP localhost:ntp 
ntpd    5613  ntp   19u  IPv4  90948      0t0  UDP host-10-0-0-104.openstacklocal:ntp 
ntpd    5613  ntp   20u  IPv6  90949      0t0  UDP localhost:ntp 
ntpd    5613  ntp   21u  IPv6  90950      0t0  UDP xiandian:ntp 
ntpd    5613  ntp   22u  IPv6  90951      0t0  UDP xiandian:ntp 

4、我们再来检查配置文件。

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
crudini --set /etc/cinder/cinder.conf DEFAULT my_ip $HOST_IP_NODE
crudini --set /etc/cinder/cinder.conf lvm volume_driver cinder.volume.drivers.lvm.LVMVolumeDriver
crudini --set /etc/cinder/cinder.conf lvm volume_group cinder-volumes
crudini --set /etc/cinder/cinder.conf lvm iscsi_protocol iscsi
crudini --set /etc/cinder/cinder.conf lvm iscsi_helper lioadm
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = localhost       ***********************此处的my_ip,不可以填主机          # my_ip =127.0.0.1
enabled_backends = lvm
glance_api_servers = http://xiandian:9292

[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volume        ********************此处的卷组名错了,少了s         #volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm

5、重启服务。

[[email protected] ~]# systemctl restart openstack-cinder-volume.service target.service
[[email protected] ~]# 

6、我们再次查看日志,确认一下。

2020-01-09 02:37:34.338 10322 INFO cinder.volume.manager [req-20457e21-a2ff-42ef-80cd-9ed18d433d2e - - - - -] Starting volume driver LVMVolumeDriver (3.0.0)
2020-01-09 02:37:35.369 10322 INFO cinder.volume.manager [req-20457e21-a2ff-42ef-80cd-9ed18d433d2e - - - - -] Driver initialization completed successfully.
2020-01-09 02:37:35.411 10322 INFO cinder.volume.manager [req-20457e21-a2ff-42ef-80cd-9ed18d433d2e - - - - -] Initializing RPC dependent components of volume driver LVMVolumeDriver (3.0.0)
2020-01-09 02:37:35.673 10322 INFO cinder.volume.manager [req-20457e21-a2ff-42ef-80cd-9ed18d433d2e - - - - -] Driver post RPC initialization completed successfully.

确认刚才问题已经修复。

7,我们尝试创建云硬盘,云硬盘可用!解决问题。

[[email protected] ~]# cinder create 1
+--------------------------------+--------------------------------------+
|            Property            |                Value                 |
+--------------------------------+--------------------------------------+
|          attachments           |                  []                  |
|       availability_zone        |                 nova                 |
|            bootable            |                false                 |
|      consistencygroup_id       |                 None                 |
|           created_at           |      2020-01-09T02:41:05.000000      |
|          description           |                 None                 |
|           encrypted            |                False                 |
|               id               | 25229785-8c42-49a7-9020-db8b9257dd8a |
|            metadata            |                  {}                  |
|        migration_status        |                 None                 |
|          multiattach           |                False                 |
|              name              |                 None                 |
|     os-vol-host-attr:host      |                 None                 |
| os-vol-mig-status-attr:migstat |                 None                 |
| os-vol-mig-status-attr:name_id |                 None                 |
|  os-vol-tenant-attr:tenant_id  |   0ab2dbde4f754b699e22461426cd0774   |
|       replication_status       |               disabled               |
|              size              |                  1                   |
|          snapshot_id           |                 None                 |
|          source_volid          |                 None                 |
|             status             |               creating               |
|           updated_at           |                 None                 |
|            user_id             |   53a1cf0ad2924532aa4b7b0750dec282   |
|          volume_type           |                 None                 |
+--------------------------------+--------------------------------------+
[[email protected] ~]# cinder list
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| 25229785-8c42-49a7-9020-db8b9257dd8a | available |  -   |  1   |      -      |  false   |             |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
相关标签: openstack cinder