目 录CONTENT

文章目录

OpenStack常用命令

所念皆星河
2020-01-18 / 0 评论 / 0 点赞 / 11 阅读 / 4973 字

nova-controller:

openstack endpoint list --long
nova service-list
nova list --all-tenants
cinder service-list
neutron net-list --all-tenants
glance image-list
openstack service list
openstack catalog list
openstack domain list
openstack image list
openstack host list

systemctl enable openstack-nova-api.service
systemctl enable openstack-nova-consoleauth.service
systemctl enable openstack-nova-scheduler.service
systemctl enable openstack-nova-conductor.service
systemctl enable openstack-nova-novncproxy.service

systemctl start openstack-nova-api.service
systemctl start openstack-nova-consoleauth.service
systemctl start openstack-nova-scheduler.service
systemctl start openstack-nova-conductor.service
systemctl start openstack-nova-novncproxy.service

systemctl status openstack-nova-api.service
systemctl status openstack-nova-consoleauth.service
systemctl status openstack-nova-scheduler.service
systemctl status openstack-nova-conductor.service
systemctl status openstack-nova-novncproxy.service

nova-computer:

systemctl enable libvirtd.service
systemctl enable openstack-nova-compute.service
systemctl start libvirtd.service
systemctl start openstack-nova-compute.service
openstack compute service list

数据库:

systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
mysql> show status like 'wsrep_%'; # 查看集群状态
检查mysql集群,看看三台节点的mysql是否都运行着
mysql -uroot -p`cat /etc/contrail/mysql.token` -e 'show status like "wsrep%"' 
该步骤仅在三个mysql中,至少有一个mysql已经正常运行的情况下执行
登入故障节点,cd /var/lib/mysql,执行rm -rf /var/lib/mysql/* (注意备份,注意备份后别把磁盘写满了),然后执行service mysql start 
该步骤仅在三个mysql都挂掉的场景下需要
登入每个mysql节点,cd /var/lib/mysql,通过ls -la检查ibdata1的修改时间,找到三台mysql节点上ibdata1修改时间最晚的那个(说明其mysql是最后停掉的),执行service mysql start --wsrep-new-cluster命令,启动mysql集群的第一个节点
mysql报错:ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
解决:删除  rm -f /var/lock/subsys/mysql 
mysql报错:ERROR! The server quit without updating PID file (/var/lib/mysql/mysql.pid)
解决:
1. cd /var/lib/mysql   
2.  touch mysql.pid   
3. chown  mysql mysql mysql.pid   
4. ps aux | grep mysql   
5. kill -9 进程号   
6. /etc/init.d/mysql start
上述解决不了尝试:rm -rf /var/lib/mysql/*  执行前删除 rm -f /var/lock/subsys/mysql 并且结束之前进程  ps aux | grep mysql   kill -9 进程号,/etc/init.d/mysql start

Haproxy:

systemctl start haproxy.service
systemctl stop haproxy.service
systemctl restart haproxy.service
systemctl enable haproxy.service

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 #清除错误日志后重启所有资源

crph:

ceph -s
ceph health detail
ceph osd pool create pool_name gp_num pgp_num #创建池

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访问
rabbitmq集群已经不正常的情况下执行
登入每台节点执行pkill -9 beam; pkill -9 epmd; 杀掉rabbitmq服务(三台同时执行) 
登入每台节点执行rm -rf /var/lib/rabbitmq/mnesia/     (三台同时执行) 
登入每台controller节点执行systemctl restart rabbitmq-server   (三台同时执行)

Memcache:

systemctl enable memcached.service
systemctl start memcached.service

Glance:

systemctl enable openstack-glance-api.service
systemctl enable openstack-glance-registry.service
systemctl start openstack-glance-api.service
systemctl start openstack-glance-registry.service
openstack image delete image-ID #删除镜像

neutron-controller:

systemctl enable neutron-server.service
systemctl enableneutron-linuxbridge-agent.service
systemctl enableneutron-dhcp-agent.service
systemctl enableneutron-metadata-agent.service
systemctl start neutron-server.service
systemctl start neutron-linuxbridge-agent.service
systemctl start neutron-dhcp-agent.service
systemctl start neutron-metadata-agent.service
systemctl status neutron-server.service
systemctl status neutron-linuxbridge-agent.service
systemctl status neutron-dhcp-agent.service
systemctl status neutron-metadata-agent.service
neutron-computer:
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service

dashboard:

systemctl restart httpd.service memcached.service
0

评论区