openstack私有云布署实践【10.1 计算nova - kxcontroller节点配置(科兴环境)】
一、首先登录kxcontroller1创建kx_nova数据库,并赋于远程和本地访问的权限。
mysql -u root -p
CREATE DATABASE kx_nova;
GRANT ALL PRIVILEGES ON kx_nova.* TO 'nova'@'localhost' IDENTIFIED BY 'venic8888';
GRANT ALL PRIVILEGES ON kx_nova.* TO 'nova'@'%' IDENTIFIED BY 'venic8888';
flush PRIVILEGES;
二、身份认证调用
使用1台kxcontroller1创建身份认证调用
source admin-openrc.sh
openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 8c46e4760902464b889293a74a0c90a8 |
| name | nova |
+-----------+----------------------------------+
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 060d59eac51b4594815603d75a00aba2 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
openstack endpoint create --region RegionTwo compute public http://kxcontroller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | 3c1caa473bfe4390a11e7177894bcc7b |
| interface | public |
| region | RegionTwo |
| region_id | RegionTwo |
| service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
| service_name | nova |
| service_type | compute |
| url | http://kxcontroller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
openstack endpoint create --region RegionTwo compute internal http://kxcontroller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | e3c918de680746a586eac1f2d9bc10ab |
| interface | internal |
| region | RegionTwo |
| region_id | RegionTwo |
| service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
| service_name | nova |
| service_type | compute |
| url | http://kxcontroller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
openstack endpoint create --region RegionTwo compute admin http://kxcontroller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| enabled | True |
| id | 38f7af91666a47cfb97b4dc790b94424 |
| interface | admin |
| region | RegionTwo |
| region_id | RegionTwo |
| service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
| service_name | nova |
| service_type | compute |
| url | http://kxcontroller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
三、下载安装nova组件
2台kxcontroller
yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient -y
2台kxcontroller配置nova配置文件
在kxcontroller1上
vi /etc/nova/nova.conf
[DEFAULT]
resume_guests_state_on_host_boot=True
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 10.120.42.1
enabled_apis=osapi_compute,metadata
verbose = True
ram_allocation_ratio = 1.0
allow_resize_to_same_host=true
allow_migrate_to_same_host=true
resize_confirm_window=1
dhcp_domain =
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
osapi_compute_listen = 10.120.42.1
osapi_compute_listen_port = 8774
metadata_listen = 10.120.42.1
metadata_listen_port = 8775
novncproxy_host = 10.120.42.1
novncproxy_port = 6080
[database]
connection = mysql://nova:venic8888@kxcontroller/kx_nova
[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]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[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
service_metadata_proxy = True
metadata_proxy_shared_secret = venicchina
以上的紫色配置原本是要等配neutron时再加的,只是这里我提前贴出来了以便做全局维护 ,如果你们是新搭环境的话,这个紫色配置要等安装了neutron包再加
在kxcontroller2上
vi /etc/nova/nova.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 10.120.42.2
enabled_apis=osapi_compute,metadata
verbose = True
ram_allocation_ratio = 1.0
allow_resize_to_same_host=true
allow_migrate_to_same_host=true
resize_confirm_window=1
dhcp_domain =
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
osapi_compute_listen = 10.120.42.2
osapi_compute_listen_port = 8774
metadata_listen = 10.120.42.2
metadata_listen_port = 8775
novncproxy_host = 10.120.42.2
novncproxy_port = 6080
[database]
connection = mysql://nova:venic8888@kxcontroller/kx_nova
[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]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[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
service_metadata_proxy = True
metadata_proxy_shared_secret = venicchina
以上的紫色配置原本是要等配neutron时再加的,只是这里我提前贴出来了以便做全局维护 ,如果你们是新搭环境的话,这个紫色配置要等安装了neutron包再加
其中一台controller 同步数据库
# su -s /bin/sh -c "nova-manage db sync" nova
两台controller 开启服务,以及加入开机自启
# systemctl enable openstack-nova-api.service \
openstack-nova-cert.service openstack-nova-consoleauth.service \
openstack-nova-scheduler.service openstack-nova-conductor.service \
openstack-nova-novncproxy.service
# systemctl restart openstack-nova-api.service \
openstack-nova-cert.service openstack-nova-consoleauth.service \
openstack-nova-scheduler.service openstack-nova-conductor.service \
openstack-nova-novncproxy.service
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,负责保留追究法律责任的权利。