Detailed article (graphic details) OpenStack-nova component deployment

OpenStack-nova component deployment

1. nova component deployment location

When deploying, you must first deploy the OpenStack-Placement component
OpenStack-Placement component deployment

【Control Node ct】

​Nova-api (nova main service)
​nova-scheduler (nova scheduling service)
​nova-conductor (nova database service, providing database access)
​nova-novncproxy (nova vnc service, providing instance console)

[Compute nodes c1, c2]

nova-compute (nova computing service)

2. Compute node Nova service configuration

1. Create a nova database and perform authorization operations

[root@ct ~]# mysql -uroot -p
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 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit

2. Manage Nova users and services

Create nova user

[root@ct ~]# openstack user create --domain default --password NOVA_PASS nova
#把nova用户添加到service项目,拥有admin权限
[root@ct ~]# openstack role add --project service --user nova admin

Insert picture description here
Insert picture description here

Create nova service

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

Insert picture description here

Associate the endpoint (endpoint) to the Nova service

[root@ct ~]# openstack endpoint create --region RegionOne compute public http://ct:8774/v2.1
[root@ct ~]# openstack endpoint create --region RegionOne compute internal http://ct:8774/v2.1
[root@ct ~]# openstack endpoint create --region RegionOne compute admin http://ct:8774/v2.1

Insert picture description here
Insert picture description here

Install nova components (nova-api, nova-conductor, nova-novncproxy, nova-scheduler)

[root@ct ~]# yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler

Insert picture description here

3. Modify the nova configuration file (nova.conf)

[root@ct ~]# cp -a /etc/nova/nova.conf{,.bak}
[root@ct ~]# grep -Ev '^$|#' /etc/nova/nova.conf.bak > /etc/nova/nova.conf
#修改nova.conf
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.100.11 			####修改为 ct的IP(内部IP)
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron true
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct
[root@ct ~]# openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:NOVA_DBPASS@ct/nova_api
[root@ct ~]# openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:NOVA_DBPASS@ct/nova
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement_database connection mysql+pymysql://placement:PLACEMENT_DBPASS@ct/placement
[root@ct ~]# openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://ct:5000/v3
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ct:11211
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken password NOVA_PASS
[root@ct ~]# openstack-config --set /etc/nova/nova.conf vnc enabled true
[root@ct ~]# openstack-config --set /etc/nova/nova.conf vnc server_listen ' $my_ip'
[root@ct ~]# openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address ' $my_ip'
[root@ct ~]# openstack-config --set /etc/nova/nova.conf glance api_servers http://ct:9292
[root@ct ~]# openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement region_name RegionOne
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement project_name service
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement auth_type password
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement auth_url http://ct:5000/v3
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement username placement
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement password PLACEMENT_PASS

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

4. Initialize the database

Initialize the nova_api database

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

Insert picture description here

5. Register the cell0 database; the nova service internally divides resources into different cells and divides computing nodes into different cells; Openstack logically groups computing nodes based on cells

[root@ct ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

Insert picture description here

Create cell1 cell

[root@ct ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova

Insert picture description here

Initialize the nova database; you can judge whether the initialization is successful through the /var/log/nova/nova-manage.log log

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

Insert picture description here

You can use the following command to verify whether cell0 and cell1 are registered successfully

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

Insert picture description here

6. Start Nova service

[root@ct ~]# systemctl enable openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@ct ~]# systemctl start openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

Insert picture description here
Insert picture description here

7. Check the nova service port

[root@ct ~]# netstat -tnlup|egrep '8774|8775'
[root@ct ~]# curl http://ct:8774

Insert picture description here

8. Install the nova-compute component, configure the Nova service-c1 and c2 nodes on the compute node

yum -y install openstack-nova-compute


cp -a /etc/nova/nova.conf{,.bak}
grep -Ev '^$|#' /etc/nova/nova.conf.bak > /etc/nova/nova.conf
openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.100.110 				#修改为对应节点的内部IP
openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron true
openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://ct:5000/v3
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ct:11211
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken password NOVA_PASS
openstack-config --set /etc/nova/nova.conf vnc enabled true
 openstack-config --set /etc/nova/nova.conf vnc server_listen 0.0.0.0
openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address ' $my_ip'
openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://192.168.100.11:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf glance api_servers http://ct:9292
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
openstack-config --set /etc/nova/nova.conf placement region_name RegionOne
openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
openstack-config --set /etc/nova/nova.conf placement project_name service
openstack-config --set /etc/nova/nova.conf placement auth_type password
openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
openstack-config --set /etc/nova/nova.conf placement auth_url http://ct:5000/v3
openstack-config --set /etc/nova/nova.conf placement username placement
openstack-config --set /etc/nova/nova.conf placement password PLACEMENT_PASS
openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu

Insert picture description here
Insert picture description here
== Turn on service ==

 systemctl enable libvirtd.service openstack-nova-compute.service
 systemctl start libvirtd.service openstack-nova-compute.service

Insert picture description here

[Compute Node-c2] Same as c1 (except for the IP address)

9. Controller node operation

Check whether the compute node is registered to the controller, through the message queue; it needs to be executed on the controller node

[root@ct ~]# openstack compute service list --service nova-compute

Insert picture description here

10. Scan which computing nodes are currently available in openstack. After discovery, the computing nodes will be created in the cell, and then virtual machines can be created in the cell; it is equivalent to grouping the computing nodes inside openstack and assigning the computing nodes to different cell

[root@ct ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

Insert picture description here

12. By default, every time you add a computing node, you need to perform a scan on the control end, which will be very troublesome, so you can modify the main configuration file of the control end nova

[root@ct ~]# vim /etc/nova/nova.conf
[scheduler]
discover_hosts_in_cells_interval = 300			#每300秒扫描一次

[root@ct ~]# systemctl restart openstack-nova-api.service

Insert picture description here
Insert picture description here

13. Verify the computing node service

Check whether each service of nova is normal, and whether the compute service is registered successfully

[root@ct ~]# openstack compute service list

Insert picture description here

Check whether the api of each component is normal

[root@ct ~]# openstack catalog list

Insert picture description here
Check if you can get the mirror

[root@ct ~]# openstack image list

Insert picture description here
Check whether the cell api and placement api are normal, as long as one of them is wrong, the virtual machine cannot be created later

[root@ct ~]# nova-status upgrade check

Insert picture description here

summary

Nova is divided into control nodes and computing nodes. The
core function of Nova components is scheduling resources. The part that needs to be reflected in the configuration file: pointing to the location of the authentication node (URL, ENDPOINT), calling services, registering, providing support, etc., all configurations in the configuration file The parameters are basically set around this range

Guess you like

Origin blog.csdn.net/weixin_51622156/article/details/114962223