天天看點

CentOS 7部署OpenStack(4)—部署Nova控制節點

1、建立資料庫

[root@controller ~]# mysql -u root -p -e "CREATE DATABASE nova;"

Enter password:

[root@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';"

[root@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova';"

Enter password:

2、安裝nova

[root@controller ~]# yum install -y openstack-nova-api openstack-nova-cert \

openstack-nova-conductor openstack-nova-console \

openstack-nova-novncproxy openstack-nova-scheduler \

python-novaclient

3、配置nova

3.1、同步資料庫

[root@controller ~]# vim /etc/nova/nova.conf

2212 connection=mysql://nova:[email protected]/nova

[root@controller ~]# su -s /bin/sh -c "nova-manage db sync"nova

3.2、配置使用rabbimq

61 rpc_backend=rabbit

3949 rabbit_host=192.168.1.11

3953 rabbit_port=5672

3965 rabbit_userid=openstack

3969 rabbit_password=openstack

3.3、配置連接配接keystone

3.3.1、建立使用者

[root@controller ~]# openstack user create --domain default--password=nova nova

+-----------+----------------------------------+

| Field     | Value                            |

| domain_id | default                          |

| enabled   | True                             |

| id        |f53595ae167e40f99d13c7014e89d129 |

| name      | nova                             |

[root@controller ~]# openstack role add --project service --user novaadmin

3.3.2、連接配接keystone

425 auth_strategy=keystone

2540 [keystone_authtoken]

2541 auth_uri = http://192.168.1.11:5000

2542 auth_url = http://192.168.1.11:35357

2543 auth_plugin = password

2544 project_domain_id = default

2545 user_domain_id = default

2546 project_name = service

2547 username = nova

2548 password = nova

配置啟動網絡支援

1053 network_api_class=nova.network.neutronv2.api.API

1171linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver

3.3.3、設定安全組

1331 security_group_api=neutron

1759 firewall_driver=nova.virt.firewall.NoopFirewallDriver

3.3.4、配置連接配接vnc

124 my_ip=192.168.1.11

1827 vncserver_listen=$my_ip

1831 vncserver_proxyclient_address=$my_ip

3.3.5、配置連接配接glance

2333 host=$my_ip

3.3.6、其它配置

268 enabled_apis=osapi_compute,metadata  //去掉ec2

3794 lock_path=/var/lib/nova/tmp  //鎖路徑

4、啟動nova

[root@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

[root@controller ~]# systemctl start openstack-nova-api.service \

openstack-nova-novncproxy.servic

5、注冊nova服務

[root@controller ~]# openstack service create --name nova --description"OpenStack Compute" compute

+-------------+----------------------------------+

| Field       | Value                            |

| description | OpenStack Compute                |

| enabled     | True                             |

| id          |04090a0c01b04e4f99dc4d6bac0ff2ab |

| name        | nova                             |

| type        | compute                          |

[root@controller ~]# openstack endpoint create --region RegionOne computepublic http://192.168.1.11:8774/v2/%\(tenant_id\)s

+--------------+-------------------------------------------+

| Field        | Value                                     |

| enabled      | True                                      |

| id           |5a26b6043c804a71bcd58da2eca649c7         |

| interface    | public                                    |

| region       | RegionOne                                 |

| region_id    | RegionOne                                 |

| service_id   |04090a0c01b04e4f99dc4d6bac0ff2ab         |

| service_name | nova                                      |

| service_type | compute                                   |

| url          |http://192.168.1.11:8774/v2/%(tenant_id)s |

root@controller ~]# openstack endpoint create --region RegionOne computeinternal http://192.168.1.11:8774/v2/%\(tenant_id\)s

| id           | 9e63e12071f44ded8ec0f34c1f8d69ab          |

| interface    | internal                                  |

| region       | RegionOne                                 |

| service_id   | 04090a0c01b04e4f99dc4d6bac0ff2ab          |

[root@controller ~]#

[root@controller ~]# openstack endpoint create --region RegionOne computeadmin http://192.168.1.11:8774/v2/%\(tenant_id\)s

| id           |ff0f0a2109a04e698d7dddac85700a1f         |

| interface    | admin                                     |

6、檢視驗證

[root@controller ~]# openstack host list

+------------+-------------+----------+

| Host Name  | Service     | Zone    |

| controller | consoleauth | internal |

| controller | scheduler   |internal |

| controller | cert        |internal |

| controller | conductor   |internal |

繼續閱讀