中小企业openstack私有云布署实践11.1 计算nova - compute节点配置(科兴环境)
Posted 肖冲
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了中小企业openstack私有云布署实践11.1 计算nova - compute节点配置(科兴环境)相关的知识,希望对你有一定的参考价值。
这里我只使用kxcompute1节点配置为示例,其它节点的配置基本是一样的,只是声明的管理IP不同而已
计算节点
# yum install openstack-nova-compute sysfsutils
修改配置文件
vi /etc/nova/nova.conf
[DEFAULT]
vcpu_pin_set = 4-31
resume_guests_state_on_host_boot=True
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 10.120.42.11
state_path=/home/local/nova
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
verbose = True
[keystone_authtoken]
auth_uri = http://kxcontroller:5000
auth_url = http://kxcontroller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = nova
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://kxcontroller:6080/vnc_auto.html
[glance]
host = kxcontroller
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[oslo_messaging_rabbit]
rabbit_host=kxcontroller
rabbit_userid = openstack
rabbit_password = openstack
[neutron]
url = http://kxcontroller:9696
auth_url = http://kxcontroller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionTwo
project_name = service
username = neutron
password = neutron
以上的紫色配置原本是要等配neutron时再加的,只是这里我提前贴出来了以便做全局维护,如果你们是新搭环境的话,这个紫色配置要等安装了neutron包再加
创建实例存放目录,以及赋权
mkdir -p /home/local/nova
cp -r /var/lib/nova/* /home/local/nova/
chown -R nova:nova /home/local/nova
启动服务已及加入开机自启
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service
登录其中一台kxcontroller上验证:
source admin-openrc.sh
# nova endpoints
有9个endpoints服务
# nova image-list
创建Zone州示例,在kxcontroller其中1台节点上,需要注意的是,当企业的服务器资源少的,不建议将计算节点分类,因为一旦分类并运行了虚拟机,该虚拟机的迁移,调整大小,只能在原zone区域内进行,无法跨区。
source admin-openrc.sh
查看状态
nova service-list
neutron agent-list
nova aggregate-list
nova availability-zone-list
定义Zone名,这里定义了2个
nova aggregate-create aggregate_prd_dm prd_dm_zone
nova aggregate-create aggregate_prd_um prd_um_zone
nova host-list
nova aggregate-add-host aggregate_prd_um kxcompute1
nova aggregate-add-host aggregate_prd_um kxcompute2
nova aggregate-add-host aggregate_prd_um kxcompute3
nova aggregate-add-host aggregate_prd_um kxcompute4
nova aggregate-add-host aggregate_prd_dm kxcompute5
nova aggregate-add-host aggregate_prd_dm kxcompute6
nova aggregate-add-host aggregate_prd_dm kxcompute7
nova aggregate-add-host aggregate_prd_dm kxcompute8
nova aggregate-add-host aggregate_prd_dm kxcompute9
验证
nova service-list
+----+------------------+---------------+-------------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+---------------+-------------+---------+-------+----------------------------+-----------------+
| 2 | nova-cert | kxcontroller2 | internal | enabled | up | 2016-11-08T11:30:37.000000 | - |
| 5 | nova-conductor | kxcontroller2 | internal | enabled | up | 2016-11-08T11:30:34.000000 | - |
| 32 | nova-consoleauth | kxcontroller2 | internal | enabled | up | 2016-11-08T11:30:33.000000 | - |
| 35 | nova-scheduler | kxcontroller2 | internal | enabled | up | 2016-11-08T11:30:33.000000 | - |
| 38 | nova-scheduler | kxcontroller1 | internal | enabled | up | 2016-11-08T11:30:35.000000 | - |
| 41 | nova-cert | kxcontroller1 | internal | enabled | up | 2016-11-08T11:30:38.000000 | - |
| 44 | nova-consoleauth | kxcontroller1 | internal | enabled | up | 2016-11-08T11:30:35.000000 | - |
| 47 | nova-conductor | kxcontroller1 | internal | enabled | up | 2016-11-08T11:30:39.000000 | - |
| 50 | nova-compute | kxcompute4 | prd_um_zone | enabled | up | 2016-11-08T11:30:37.000000 | - |
| 53 | nova-compute | kxcompute3 | prd_um_zone | enabled | up | 2016-11-08T11:30:36.000000 | - |
| 56 | nova-compute | kxcompute1 | prd_um_zone | enabled | up | 2016-11-08T11:30:37.000000 | - |
| 59 | nova-compute | kxcompute2 | prd_um_zone | enabled | up | 2016-11-08T11:30:36.000000 | - |
| 60 | nova-compute | kxcompute6 | prd_dm_zone | enabled | up | 2016-11-08T11:30:37.000000 | - |
| 62 | nova-compute | kxcompute5 | prd_dm_zone | enabled | up | 2016-11-08T11:30:36.000000 | - |
| 64 | nova-compute | kxcompute7 | prd_dm_zone | enabled | up | 2016-11-08T11:30:35.000000 | - |
| 67 | nova-compute | kxcompute8 | prd_dm_zone | enabled | up | 2016-11-08T11:30:35.000000 | - |
| 70 | nova-compute | kxcompute9 | prd_dm_zone | enabled | up | 2016-11-08T11:30:36.000000 | - |
+----+------------------+---------------+-------------+---------+-------+----------------------------+-----------------+
以上是关于中小企业openstack私有云布署实践11.1 计算nova - compute节点配置(科兴环境)的主要内容,如果未能解决你的问题,请参考以下文章
中小企业openstack私有云布署实践5 数据库MariaDB 集群
中小企业openstack私有云布署实践7.2 keystone + memcache (办公网环境)
中小企业openstack私有云布署实践9.1 Glance镜像管理(科兴环境)