OpenStack排错常用步骤和命令

1.查看日志
OpenStack的日志系统设计的非常棒。大多数的问题都能从日志中找到原因。日志路径在/var/log/下。

OpenStack排错常用步骤和命令

哪里有问题就去哪里找:去相应的日志文件夹查看日志。

比如上传镜像报错,就去/var/log/glance/

如果实例启动失败,就去/var/log/nova下查看。注意nova的日志分布于controller节点和compute节点

2.端口被占用
比如keystone集成到apache里了,使用80端口。如果80端口被其他服务占用,那就完蛋了。

正常情况是:

[root@linuxidc ~]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 11267 root 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 108466 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 108467 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 108468 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 108469 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 108470 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 108597 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 108598 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)
httpd 109362 apache 8u IPv6 41441 0t0 TCP *:http (LISTEN)

3.查看租户/工程
租户tenant和工程project在openstack中本质是一样的。新版本已经不再区分这2个概念
openstack project list

4.检查服务状态
  ps -aux | grep keystone 或者ps -ef | grep keystone

5.查看openstack发行版本
nova是从openstack第一版就出现的"祖师爷"组件,借他的版本号可以知晓openstack的版本
nova-manage --version
14.0.2
对应着N版本

6.在Mikata中:
查看所有的组件状态:openstack-status

[root@infra2 ~]# openstack-status
== Nova services ==
openstack-nova-api: active
openstack-nova-compute: active
openstack-nova-network: inactive (disabled on boot)
openstack-nova-scheduler: active
openstack-nova-cert: active
openstack-nova-conductor: active
openstack-nova-console: inactive (disabled on boot)
openstack-nova-consoleauth: active
openstack-nova-xvpvncproxy: inactive (disabled on boot)
== Glance services ==
openstack-glance-api: active
openstack-glance-registry: active
== Keystone service ==
openstack-keystone: inactive (disabled on boot)
== Horizon service ==
openstack-dashboard: active
== neutron services ==
neutron-server: active
neutron-dhcp-agent: active
neutron-l3-agent: active
neutron-metadata-agent: active
neutron-openvswitch-agent: active
neutron-metering-agent: active
== Swift services ==
openstack-swift-proxy: active
openstack-swift-account: active
openstack-swift-container: active
openstack-swift-object: active
== Cinder services ==
openstack-cinder-api: active
openstack-cinder-scheduler: active
openstack-cinder-volume: active
openstack-cinder-backup: active
== Ceilometer services ==
openstack-ceilometer-api: inactive (disabled on boot)
openstack-ceilometer-central: active
openstack-ceilometer-compute: active
openstack-ceilometer-collector: active
openstack-ceilometer-notification: active
== Support services ==
mariadb: active
libvirtd: active
openvswitch: active
dbus: active
target: active
rabbitmq-server: active
memcached: active
== Keystone users ==
Warning keystonerc not sourced

查看所有服务的状态:

[root@infra2 ~]# openstack-service status
MainPID=3628 Id=neutron-dhcp-agent.service ActiveState=active
MainPID=3627 Id=neutron-l3-agent.service ActiveState=active
MainPID=1324 Id=neutron-metadata-agent.service ActiveState=active
MainPID=1296 Id=neutron-metering-agent.service ActiveState=active
MainPID=3638 Id=neutron-openvswitch-agent.service ActiveState=active
MainPID=1348 Id=neutron-server.service ActiveState=active
MainPID=1301 Id=openstack-aodh-evaluator.service ActiveState=active
MainPID=1316 Id=openstack-aodh-listener.service ActiveState=active
MainPID=1318 Id=openstack-aodh-notifier.service ActiveState=active
MainPID=1282 Id=openstack-ceilometer-central.service ActiveState=active
MainPID=1291 Id=openstack-ceilometer-collector.service ActiveState=active
MainPID=1287 Id=openstack-ceilometer-compute.service ActiveState=active
MainPID=1350 Id=openstack-ceilometer-notification.service ActiveState=active
MainPID=1339 Id=openstack-cinder-api.service ActiveState=active
MainPID=1292 Id=openstack-cinder-backup.service ActiveState=active
MainPID=1341 Id=openstack-cinder-scheduler.service ActiveState=active
MainPID=1293 Id=openstack-cinder-volume.service ActiveState=active
MainPID=1285 Id=openstack-glance-api.service ActiveState=active
MainPID=1336 Id=openstack-glance-registry.service ActiveState=active
MainPID=1288 Id=openstack-gnocchi-metricd.service ActiveState=active
MainPID=1352 Id=openstack-gnocchi-statsd.service ActiveState=active
MainPID=0 Id=openstack-losetup.service ActiveState=active
MainPID=1351 Id=openstack-nova-api.service ActiveState=active
MainPID=1346 Id=openstack-nova-cert.service ActiveState=active
MainPID=3631 Id=openstack-nova-compute.service ActiveState=active
MainPID=1353 Id=openstack-nova-conductor.service ActiveState=active
MainPID=1306 Id=openstack-nova-consoleauth.service ActiveState=active
MainPID=1286 Id=openstack-nova-novncproxy.service ActiveState=active
MainPID=1345 Id=openstack-nova-scheduler.service ActiveState=active
MainPID=1297 Id=openstack-swift-account-auditor.service ActiveState=active
MainPID=1305 Id=openstack-swift-account-reaper.service ActiveState=active
MainPID=1317 Id=openstack-swift-account-replicator.service ActiveState=active
MainPID=1280 Id=openstack-swift-account.service ActiveState=active
MainPID=1283 Id=openstack-swift-container-auditor.service ActiveState=active
MainPID=1340 Id=openstack-swift-container-replicator.service ActiveState=active
MainPID=1321 Id=openstack-swift-container-updater.service ActiveState=active
MainPID=1279 Id=openstack-swift-container.service ActiveState=active
MainPID=1325 Id=openstack-swift-object-auditor.service ActiveState=active
MainPID=1289 Id=openstack-swift-object-expirer.service ActiveState=active
MainPID=1349 Id=openstack-swift-object-replicator.service ActiveState=active
MainPID=1338 Id=openstack-swift-object-updater.service ActiveState=active
MainPID=1278 Id=openstack-swift-object.service ActiveState=active
MainPID=1277 Id=openstack-swift-proxy.service ActiveState=active

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/bbb50aa68a5f4cae2248410f8a9085c3.html