1. 程式人生 > >5、nova服務安裝配置

5、nova服務安裝配置

一、控制節點安裝配置

  1、啟用api支援

[DEFAULT]

enabled_apis = osapi_compute,metadata

 

  2、配置資料庫連線

[api_database]

connection = mysql+pymysql://nova:[email protected]/nova_api

[database]

connection = mysql+pymysql://nova:[email protected]/nova

  3、配置rabbitmq

[DEFAULT]

transport_url 
= rabbit://openstack:[email protected]

  4、配置keystone

 

[api]

auth_strategy = keystone

[keystone_authtoken]

auth_uri = http://192.168.90.254:5000
auth_url = http://192.168.90.254:35357
memcached_servers = 192.168.90.254:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service username = nova password = nova

  5、配置網路支援

[DEFAULT]

use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

  6、VNC配置

[vnc]
enabled = true

vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 192.168.90.254

  7、配置glance

[glance]

api_servers 
= http://192.168.90.254:9292

  8、配置鎖路徑

[oslo_concurrency]

lock_path = /var/lib/nova/tmp

  9、配置placement

[placement]

os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.90.254:35357/v3
username = placement
password = placement

  10、配置http placement支援

<Directory /usr/bin>
   <IfVersion >= 2.4>
      Require all granted
   </IfVersion>
   <IfVersion < 2.4>
      Order allow,deny
      Allow from all
   </IfVersion>
</Directory>

  11、重啟httpd

systemctl restart httpd

  12、寫入資料庫

su -s /bin/sh -c "nova-manage api_db sync" nova

su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova

su -s /bin/sh -c "nova-manage db sync" nova

  13、服務註冊

  nova服務註冊

openstack service create --name nova \
  --description "OpenStack Compute" compute

  openstack endpoint create --region RegionOne \
    compute public http://192.168.90.254:8774/v2.1

  openstack endpoint create --region RegionOne \
    compute internal http://192.168.90.254:8774/v2.1

  openstack endpoint create --region RegionOne \
    compute admin http://192.168.90.254:8774/v2.1

  placement服務註冊

openstack service create --name placement --description "Placement API" placement

  openstack endpoint create --region RegionOne placement public http://192.168.90.254:8778
  
  openstack endpoint create --region RegionOne placement internal http://192.168.90.254:8778

  openstack endpoint create --region RegionOne placement admin http://192.168.90.254:8778

  14、啟動服務

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

  15、如果出問題,可使用下面命令刪除cell

 

nova-manage cell_v2 delete_cell --cell_uuid ad0267f0-e01d-4093-8613-5e601cce3c32

 

二、計算節點安裝配置