OpenStack常用命令
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenStack常用命令相关的知识,希望对你有一定的参考价值。
OpenStack常用命令使用身份文件登陆:
[root@ct ~]# source keystonerc_admin
1、 数据库:
# systemctl start mysqld
# systemctl enable mysqld
# systemctl status mysqld
#mysql> show status like ‘wsrep_%‘; # 查看集群状态
2、Haproxy:
# systemctl start haproxy.service
# systemctl stop haproxy.service
# systemctl restart haproxy.service
# systemctl enable haproxy.service
3、Pacemker:
# systemctl start pcsd.service
# systemctl enable pcsd.service
# systemctl status pcsd.service
# pcs status
# pcs cluster standby node
# pcs cluster unstandby node
# pcs resource restart haproxy #重启haproxy 资源
# pcs resource cleanup #清除错误日志后重启所有资源
4、时间服务 chrony:
# systemctl restart chronyd.service
# chronyc sources #同步时间
5、ceph:
# ceph -s
# ceph health detail
# ceph osd pool create pool_name gp_num pgp_num #创建池
6、http、
# systemctl start httpd
# systemctl enable httpd
# systemctl status httpd
7、rabbitmq:
# systemctl enable rabbitmq-server.service
# systemctl start rabbitmq-server.service
# systemctl status rabbitmq-server.service -l
# rabbitmqctl cluster_status
# http://rabbitmq-server-IP:15672 #web访问
8、Memcache:
# systemctl enable memcached.service
# systemctl start memcached.service
9、openstack 查看命令:
# openstack catalog list
# openstack endpoint list
# openstack service list
# openstack domain list
# openstack image list
# openstack host list
10、Glance:
# systemctl enable openstack-glance-api.service openstack-glance-registry.service
# systemctl start openstack-glance-api.service openstack-glance-registry.service
# openstack image delete image-ID #删除镜像
11、nova-controller:
# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl status openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
12、nova-computer:
# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service
13、neutron-controller:
# systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
# systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
# systemctl status neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
14、neutron-computer:
# systemctl enable neutron-linuxbridge-agent.service
# systemctl start neutron-linuxbridge-agent.service
15、dashboard:
# systemctl restart httpd.service memcached.service
#######openstack 常用服务查看命令###############
1、查看nova状态
[root@ct ~(keystone_admin)]# nova service-list
+--------------------------------------+------------------+------+----------+---------+-------+----------------------------+-----------------+-------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | Forced down |
+--------------------------------------+------------------+------+----------+---------+-------+----------------------------+-----------------+-------------+
| 9bbd99d5-1fea-4ac1-936e-58fb0621cb4e | nova-conductor | ct | internal | enabled | up | 2020-02-27T23:43:00.000000 | - | False |
| 3f2362fa-1438-4c87-8337-5168f4e7c733 | nova-scheduler | ct | internal | enabled | up | 2020-02-27T23:43:08.000000 | - | False |
| a43e228d-091b-49e2-b6e6-aa006343ca4b | nova-consoleauth | ct | internal | enabled | up | 2020-02-27T23:43:07.000000 | - | False |
| d9951228-58f3-4a8a-82b5-3ed1eb1e49d8 | nova-compute | c1 | nova | enabled | up | 2020-02-27T23:43:07.000000 | - | False |
| ea0f8700-8231-4705-8863-20a7f33204b4 | nova-compute | c2 | nova | enabled | up | 2020-02-27T23:43:07.000000 | - | False |
+--------------------------------------+------------------+------+----------+---------+-------+----------------------------+-----------------+-------------+
2、查看neutron客户端状态
[root@ct ~(keystone_admin)]# neutron agent-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+--------------------------------------+--------------------+------+-------------------+-------+----------------+---------------------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+--------------------------------------+--------------------+------+-------------------+-------+----------------+---------------------------+
| 4c272ebe-c35c-46e3-bbaf-33a2ba828fca | Open vSwitch agent | c1 | | :-) | True | neutron-openvswitch-agent |
| 4cc69544-9d24-49f3-9169-9fc5498171d8 | Open vSwitch agent | ct | | :-) | True | neutron-openvswitch-agent |
| 6a524598-497e-4e52-96d8-5ab670859a7b | DHCP agent | ct | nova | :-) | True | neutron-dhcp-agent |
| 9bee489b-1bf2-493e-a34d-d434295d585e | Open vSwitch agent | c2 | | :-) | True | neutron-openvswitch-agent |
| ac864707-10d4-42c3-990d-6dabb8200f0c | L3 agent | ct | nova | :-) | True | neutron-l3-agent |
| b28bb380-cb9e-4720-ab24-8f0f99cc41ce | Metering agent | ct | | :-) | True | neutron-metering-agent |
| f3f63cef-e739-4b6a-b4e3-2d38bde0c153 | Metadata agent | ct | | :-) | True | neutron-metadata-agent |
+--------------------------------------+--------------------+------+-------------------+-------+----------------+---------------------------+
[root@ct ~(keystone_admin)]#
3、查看glance状态
[root@ct ~(keystone_admin)]# glance image-list
+--------------------------------------+---------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+---------------------+-------------+------------------+------------+--------+
| 44c2285f-9d43-4a07-a146-d7d0eec8f787 | CentOS6.6 | qcow2 | bare | 2022309888 | active |
| bb49787d-923f-4066-aa05-2c4cefed7837 | cirros-0.3.4-x86_64 | qcow2 | bare | 13287936 | active |
| e2818cd3-15b3-47e6-97c0-bb9fec0a889b | coreos | qcow2 | bare | 375193600 | active |
| 5a7d77ce-b96d-4eba-a614-a37036916ded | my cirros | qcow2 | bare | 22020096 | active |
4、查看heat
[root@ ~(keystone)]#heat stack-list
+--------------------------------------+--------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+--------------+-----------------+----------------------+
| 733e76b0-3316-46ef-974d-eb76911afb1d | Sample-Stack | CREATE_COMPLETE | 2015-07-18T17:46:28Z |
+--------------------------------------+--------------+-----------------+———————————+
5、查看cinder状态
[root@ct ~(keystone_admin)]# cinder service-list
+------------------+--------+------+---------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+--------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler | ct | nova | enabled | up | 2020-02-27T23:57:38.000000 | - |
| cinder-volume | ct@lvm | nova | enabled | up | 2020-02-27T23:57:41.000000 | - |
+------------------+--------+------+---------+-------+----------------------------+-----------------+
[root@ct ~(keystone_admin)]# cinder-manage service list
Deprecated: Option "logdir" from group "DEFAULT" is deprecated. Use option "log-dir" from group "DEFAULT".
Binary Host Zone Status State Updated At RPC Version Object Version Cluster
cinder-scheduler ct nova enabled :-) 2020-02-27 23:57:58 3.11 1.37
cinder-volume ct@lvm nova enabled :-) 2020-02-27 23:58:01 3.16 1.37
6、查看ceilometer
[root@ ~(keystone)]#ceilometer meter-list
+---------------------------------+------------+-----------+-----------------------------------------------------------------------+----------------------------------+----------------------------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+---------------------------------+------------+-----------+-----------------------------------------------------------------------+----------------------------------+----------------------------------+
| cpu | cumulative | ns | 7ecb1f95-b60c-4809-a427-c777b553c2b7 | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| cpu | cumulative | ns | e8557939-f222-4706-8c11-52a58c413ad8 | a315272d086740a4a5999e8a7ea053ac | 6dce15d24fcf4759a219cf039a5ba396 |
| cpu_util | gauge | % | 7ecb1f95-b60c-4809-a427-c777b553c2b7 | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| cpu_util | gauge | % | e8557939-f222-4706-8c11-52a58c413ad8 | a315272d086740a4a5999e8a7ea053ac | 6dce15d24fcf4759a219cf039a5ba396 |
| disk.allocation | gauge | B | 7ecb1f95-b60c-4809-a427-c777b553c2b7 | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| disk.allocation | gauge | B | e8557939-f222-4706-8c11-52a58c413ad8 | a315272d086740a4a5999e8a7ea053ac | 6dce15d24fcf4759a219cf039a5ba396 |
| disk.capacity | gauge | B | 7ecb1f95-b60c-4809-a427-c777b553c2b7 | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| disk.capacity | gauge | B | e8557939-f222-4706-8c11-52a58c413ad8 | a315272d086740a4a5999e8a7ea053ac | 6dce15d24fcf4759a219cf039a5ba396 |
| disk.device.allocation | gauge | B | 7ecb1f95-b60c-4809-a427-c777b553c2b7-vda | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| disk.device.allocation | gauge | B | 7ecb1f95-b60c-4809-a427-c777b553c2b7-vdb | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| disk.device.allocation | gauge | B | e8557939-f222-4706-8c11-52a58c413ad8-vda | a315272d086740a4a5999e8a7ea053ac | 6dce15d24fcf4759a219cf039a5ba396 |
| disk.device.capacity | gauge | B | 7ecb1f95-b60c-4809-a427-c777b553c2b7-vda | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| disk.device.capacity | gauge | B | 7ecb1f95-b60c-4809-a427-c777b553c2b7-vdb | 1032633d21574df6851d6e254f2e7f57 | d534a9e085b14945b617fa912f858167 |
| disk.device.capacity | gauge | B | e8557939-f222-4706-8c11-52a58c413ad8-vda | a315272d086740a4a5999e8a7ea053ac | 6dce15d24fcf4759a219cf039a5ba396 |
| disk.device.read.bytes | cumulative | B | 7ecb1f95-b60c-4809-a427-c777b553c2b7-vda
以上是关于OpenStack常用命令的主要内容,如果未能解决你的问题,请参考以下文章