S1_ OpenStack to build a distributed cluster _06 nova service configuration (control node)

一、创建数据库(控制节点)
创建数据库以及用户:
# mysql -uroot -p12345678
MariaDB [(none)]> CREATE DATABASE nova_api;
MariaDB [(none)]> CREATE DATABASE nova;
MariaDB [(none)]> CREATE DATABASE nova_cell0;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'nova123';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'nova123';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova123';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova123';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'nova123';
. MariaDB [(none)]> the GRANT ALL PRIVILEGES the ON nova_cell0 * the TO 'Nova' @ '%' the IDENTIFIED BY 'nova123';
MariaDB [(none)]> the flush privileges;
MariaDB [(none)]> Exit;

two, creating nova authentication information (control node)
with admin user credentials user credentials to create nova:
# Source admin-OpenRC
# OpenStack --domain the create the user-default --password password prompt nova # nova123

to add users admin roles nova:
# OpenStack role add --project service --user nova admin

create nova service:
# service OpenStack the create --name nova --description "OpenStack compute" compute

create calculated api port
# openstack endpoint create --region RegionOne compute public http: //10.10. 11.11: 8774 / v2.1
# Endpoint OpenStack Compute the Create --region RegionOne Internal http://10.10.11.11:8774/v2.1
# Openstack endpoint create --region RegionOne compute admin http://10.10.11.11:8774/v2.1

create a placement service user
placement123 # openstack user create --domain default --password -prompt placement # password set

to add users to the placement services
# openstack role add --project service --user placement admin

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

to create a placement api service port
# openstack endpoint create --region RegionOne placement public http://10.10.11.11:8778
# OpenStack Endpoint --region RegionOne the Create Placement Internal http://10.10.11.11:8778
# OpenStack Endpoint --region RegionOne the Create Placement ADMIN http://10.10.11.11:8778

Third, the installation package and configure the components (control node)
3.1 control node installation services
# yum install openstack-nova-api openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy \
openstack-nova-scheduler openstack-nova-placement-api -y

3.2 编辑/etc/nova/nova.conf文件并完成以下配置
[DEFAULT]
enabled_apis = osapi_compute,metadata
my_ip = 10.10.11.11
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
transport_url = rabbit://openstack:[email protected]
[api_database]
connection = mysql+pymysql://nova:nova123@localhost/nova_api
[database]
connection = mysql+pymysql://nova:nova123@localhost/nova
[api]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://10.10.11.11:5000
auth_url = http://10.10.11.11:35357
memcached_servers = 10.10.11.11:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova123
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip
[glance]
api_servers = http://10.10.11.11:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://10.10.11.11:35357/v3
Placement = username
password = placement123

because bug package, last edit file /etc/httpd/conf.d/00-nova-placement-api.conf add the following:    
<Directory / usr / bin>
   <IfVersion> = 2.4>
      All granted the Require
   </ IfVersion>
   <IfVersion <2.4>
      the Order the allow, deny
      the Allow from All
   </ IfVersion>
</ Directory>

restart httpd service
# systemctl restart httpd

synchronous api database
# su -s / bin / sh -c "nova- manage api_db sync "nova

synchronization cell0 database:
# su -s / bin / SH -c" Nova-the Manage cell_v2 map_cell0 "Nova

created Cell1:
# su -s / bin / SH -c" Nova-the Manage cell_v2 create_cell --name = cell1 --verbose "nova

synchronize database :( nova relatively long time,do not move)
# su -s /bin/sh -c "nova-manage db sync" nova

启动服务:
# 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

Guess you like

Origin www.cnblogs.com/luwei0915/p/11333730.html