CentOS 7部署OpenStack(4)—部署Nova控制节点

一、建立数据库python

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

Enter password: linux

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

Enter password: 数据库

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

Enter password:api

二、安装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

三、配置nova

3.一、同步数据库

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

2212 connection=mysql://nova:nova@192.168.1.11/nova

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

3.二、配置使用rabbimq

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

61 rpc_backend=rabbit

3949 rabbit_host=192.168.1.11

3953 rabbit_port=5672

3965 rabbit_userid=openstack

3969 rabbit_password=openstack

3.三、配置链接keystone

3.3.一、建立用户

[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.二、链接keystone

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

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

配置启动网络支持

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

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

1171linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver

3.3.三、设置安全组

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

1331 security_group_api=neutron

1759 firewall_driver=nova.virt.firewall.NoopFirewallDriver

3.3.四、配置链接vnc

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

124 my_ip=192.168.1.11

1827 vncserver_listen=$my_ip

1831 vncserver_proxyclient_address=$my_ip

3.3.五、配置链接glance

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

2333 host=$my_ip

3.3.六、其它配置

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

268 enabled_apis=osapi_compute,metadata  //去掉ec2

3794 lock_path=/var/lib/nova/tmp  //锁路径

四、启动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-cert.service \

openstack-nova-consoleauth.service \

openstack-nova-scheduler.service \

openstack-nova-conductor.service \

openstack-nova-novncproxy.servic

五、注册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

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

| Field        | Value                                     |

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

| enabled      | True                                      |

| id           | 9e63e12071f44ded8ec0f34c1f8d69ab          |

| interface    | internal                                  |

| 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 ~]#

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

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

| Field        | Value                                     |

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

| enabled      | True                                      |

| id           |ff0f0a2109a04e698d7dddac85700a1f         |

| interface    | admin                                     |

| 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 host list

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

| Host Name  | Service     | Zone    |

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

| controller | consoleauth | internal |

| controller | scheduler   |internal |

| controller | cert        |internal |

| controller | conductor   |internal |

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

Linux运维开发群:298324302

北京linux运维求职招聘 153677549