网站建设制度,软文营销的案例,上海市建设工程协会网站,wordpress腾讯云插件目录
1、登录数据库配置
2、安装nova
3、计算节点上安装nova
4、在controller节点上 nova组件是用来建虚拟机的#xff08;功能#xff1a;负责响应虚拟机创建请求、调度、销毁云主机#xff09;
nova主要组成#xff1a;
(1).nova api service------安装在controlle…目录
1、登录数据库配置
2、安装nova
3、计算节点上安装nova
4、在controller节点上 nova组件是用来建虚拟机的功能负责响应虚拟机创建请求、调度、销毁云主机
nova主要组成
(1).nova api service------安装在controller节点接受和相应客户端发送的请求nova-api负责接收和响应终端用户由管虚拟机和云硬盘的请求。就是说我想在openstack中创建个虚拟机(创建虚拟机最终在nova中完成)我发出的请求就被nova-api接收并发送到nova中去然后在进行下一步具体操作nova-api是整个nova的入口。它接收用户请求将指令发送到消息队列由相应的服务执行相关的指令消息他提供了openstack API亚马逊EC2 API以及管理员控制API。(2)nova-api-metadata service接受从实例元数据发来的请求该服务通常于nova-network服务在对主机模式下运行也就说由多个nova节点才会用得到(3)nova compute------安装在compute节点:是nova组件中最核心的服务它实现了管理虚拟机的功能实现了在计算节点上创建启动暂停关闭和删除虚拟机。(4)nova Scheduler主要起到调度作用假如现在又多台nova计算节点当用户发起创建虚拟机的请求时nova Scheduler会决定把虚拟机创建放在那个计算节点上。(5)nova conductor主要提供数据查询功能提供nova compute和Database之间的交互数据那为啥nova compute不直接去访问数据库呢只是为防止nova compute被攻击后数据库就会不安全所以需要有nova conductor去调度
1、登录数据库配置
1.Use the database access client to connect to the database server as the root user登录数据库
[rootcontroller ~]# mysql -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 18
Server version: 10.3.20-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type help; or \h for help. Type \c to clear the current input statement.MariaDB [(none)] 2.Create the nova_api, nova, and nova_cell0 databases(数据库里创建nova-api
MariaDB [(none)] CREATE DATABASE nova_api;
Query OK, 1 row affected (0.001 sec)MariaDB [(none)] CREATE DATABASE nova;
Query OK, 1 row affected (0.002 sec)MariaDB [(none)] CREATE DATABASE nova_cell0;
Query OK, 1 row affected (0.001 sec) 3.Grant proper access to the databases授权
MariaDB [(none)] GRANT ALL PRIVILEGES ON nova_api.* TO nova% \IDENTIFIED BY 123;
Query OK, 0 rows affected (0.002 sec)MariaDB [(none)] GRANT ALL PRIVILEGES ON nova.* TO nova% \IDENTIFIED BY 123;
Query OK, 0 rows affected (0.001 sec)MariaDB [(none)] GRANT ALL PRIVILEGES ON nova_cell0.* TO nova% \IDENTIFIED BY 123;
Query OK, 0 rows affected (0.002 sec)退出数据库 MariaDB [(none)] quit
Bye
[rootcontroller ~]# 4.Create the Compute service credentials:Create the nova user:(创建用户)
[rootcontroller ~]# openstack user create --domain default --password nova nova
-------------------------------------------------------
| Field | Value |
-------------------------------------------------------
| domain_id | default |
| enabled | True |
| id | 7327ef20d28648ec9c90d640eb1be7aa |
| name | nova |
| options | {} |
| password_expires_at | None |
-------------------------------------------------------5.Add the admin role to the nova user增加用户
[rootcontroller ~]# openstack role add --project service --user nova admin6.Create the nova service entity创建服务
[rootcontroller ~]# openstack service create --name nova \--description OpenStack Compute compute
-----------------------------------------------
| Field | Value |
-----------------------------------------------
| description | OpenStack Compute |
| enabled | True |
| id | acdb20889c2f40059e9d3476cde870eb |
| name | nova |
| type | compute |
-----------------------------------------------7.Create the Compute API service endpoints:
[rootcontroller ~]# openstack endpoint create --region RegionOne \compute public http://controller:8774/v2.1
------------------------------------------------
| Field | Value |
------------------------------------------------
| enabled | True |
| id | 6de5e77e358a43b3bb5a60f50051abab |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | acdb20889c2f40059e9d3476cde870eb |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
------------------------------------------------
[rootcontroller ~]# openstack endpoint create --region RegionOne \compute internal http://controller:8774/v2.1
------------------------------------------------
| Field | Value |
------------------------------------------------
| enabled | True |
| id | ac25b43c9dd5492b825731be6c05ba28 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | acdb20889c2f40059e9d3476cde870eb |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
------------------------------------------------
[rootcontroller ~]# openstack endpoint create --region RegionOne \compute admin http://controller:8774/v2.1
------------------------------------------------
| Field | Value |
------------------------------------------------
| enabled | True |
| id | edc99daa899a4ee299034360b3ed7796 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | acdb20889c2f40059e9d3476cde870eb |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
------------------------------------------------2、安装nova
1.Install the packages:
[rootcontroller ~]# yum install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler -y
2.修改/etc/nova/nova.conf
[rootcontroller ~]# cp /etc/nova/nova.conf{,.bak}
[rootcontroller ~]# grep -Ev ^$|# /etc/nova/nova.conf.bak /etc/nova/nova.conf
[rootcontroller ~]# vi /etc/nova/nova.conf[DEFAULT]
transport_url rabbit://openstack:123controller:5672/
my_ip 10.0.0.10
use_neutron true
firewall_driver nova.virt.firewall.NoopFirewallDriver
log_file /var/log/nova/nova.log
[api]
auth_strategy keystone
[api_database]
connection mysqlpymysql://nova:123controller/nova_api
[barbican]
[cache]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
connection mysqlpymysql://nova:123controller/nova
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
www_authenticate_uri http://controller:5000/
auth_url http://controller:5000/
memcached_servers controller:11211
auth_type password
project_domain_name Default
user_domain_name Default
project_name service
username nova
password nova
[libvirt]
[metrics]
[mks]
[neutron]
[notifications]
[database]
connection mysqlpymysql://nova:123controller/nova
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[conductor]
[console]
[consoleauth]
[cors]
[database]
connection mysqlpymysql://nova:123controller/nova
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
www_authenticate_uri http://controller:5000/
auth_url http://controller:5000/
memcached_servers controller:11211
auth_type password
project_domain_name Default
user_domain_name Default
project_name service
username nova
password nova
[libvirt]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path /var/lib/nova/tmp
[oslo_messaging_amqp]
[DEFAULT]
transport_url rabbit://openstack:123controller:5672/
my_ip 10.0.0.10
use_neutron true
firewall_driver nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy keystone
[api_database]
connection mysqlpymysql://nova:123controller/nova_api
[barbican]
[cache]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
connection mysqlpymysql://nova:123controller/nova
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
www_authenticate_uri http://controller:5000/
auth_url http://controller:5000/
memcached_servers controller:11211
auth_type password
project_domain_name Default
user_domain_name Default
project_name service
username nova
password nova
[libvirt]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path /var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
region_name RegionOne
project_domain_name Default
project_name service
auth_type password
user_domain_name Default
auth_url http://controller:5000/v3
username placement
password placement
[powervm]
[privsep]
[profiler]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled true
server_listen $my_ip
server_proxyclient_address $my_ip
[workarounds]
[wsgi]
[xenserver]
[xvp]
[zvm]3.同步数据库
[rootcontroller ~]# su -s /bin/sh -c nova-manage api_db sync nova
[rootcontroller ~]# su -s /bin/sh -c nova-manage cell_v2 map_cell0 nova
[rootcontroller ~]# su -s /bin/sh -c nova-manage cell_v2 create_cell --namecell1 --verbose nova
2e46e668-cfaf-4034-b6a8-154dc925c12d
[rootcontroller ~]# su -s /bin/sh -c nova-manage db sync nova
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, uDuplicate index block_device_mapping_instance_uuid_virtual_name_device_name_idx. This is deprecated and will be disallowed in a future release)result self._query(query)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, uDuplicate index uniq_instances0uuid. This is deprecated and will be disallowed in a future release)result self._query(query)[rootcontroller ~]# su -s /bin/sh -c nova-manage cell_v2 list_cells nova
--------------------------------------------------------------------------------------------------------------------------------------------------
| Name | UUID | Transport URL | Database Connection | Disabled |
--------------------------------------------------------------------------------------------------------------------------------------------------
| cell0 | 00000000-0000-0000-0000-000000000000 | none:/ | mysqlpymysql://nova:****controller/nova_cell0 | False |
| cell1 | 2e46e668-cfaf-4034-b6a8-154dc925c12d | rabbit://openstack:****controller:5672/ | mysqlpymysql://nova:****controller/nova | False |
--------------------------------------------------------------------------------------------------------------------------------------------------4.Start the Compute services and configure them to start when the system boots:
[rootcontroller ~]# systemctl enable \openstack-nova-api.service \openstack-nova-scheduler.service \openstack-nova-conductor.service \openstack-nova-novncproxy.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-api.service to /usr/lib/systemd/system/openstack-nova-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service to /usr/lib/systemd/system/openstack-nova-scheduler.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service to /usr/lib/systemd/system/openstack-nova-conductor.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service to /usr/lib/systemd/system/openstack-nova-novncproxy.service.
5.做一个重启脚本
[rootcontroller ~]# vi nova-restart.sh#!/bin/bash
systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[rootcontroller ~]# bash nova-restart.sh 然后再计算节点上配置
3、计算节点上安装nova
1.Install the packages安装nova包
[rootcomputer ~]# yum install openstack-nova-compute -y
2.修改/etc/nova/nova.conf配置
[rootcomputer ~]# yum install openstack-nova-compute -y^C
[rootcomputer ~]# cp /etc/nova/nova.conf{,.bak}
[rootcomputer ~]# grep -Ev ^$|# /etc/nova/nova.conf.bak /etc/nova/nova.conf
[rootcomputer ~]# vi /etc/nova/nova.conf[DEFAULT]
enabled_apis osapi_compute,metadata
transport_url rabbit://openstack:123controller
compute_driverlibvirt.LibvirtDriver
my_ip 192.168.124.89
use_neutron true
firewall_driver nova.virt.firewall.NoopFirewallDriver
log_file /var/log/nova/nova-compute.log
[api]
auth_strategy keystone
[api_database]
[barbican]
[cache]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
www_authenticate_uri http://controller:5000/
auth_url http://controller:5000/
memcached_servers controller:11211
auth_type password
project_domain_name Default
user_domain_name Default
project_name service
username nova
password nova
[libvirt]
[metrics]
[DEFAULT]
enabled_apis osapi_compute,metadata
transport_url rabbit://openstack:123controller
compute_driverlibvirt.LibvirtDriver
my_ip 192.168.124.89
use_neutron true
firewall_driver nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy keystone
[api_database]
[barbican]
[cache]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
www_authenticate_uri http://controller:5000/
auth_url http://controller:5000/
memcached_servers controller:11211
auth_type password
project_domain_name Default
user_domain_name Default
project_name service
username nova
password nova
[libvirt]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path /var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
region_name RegionOne
project_domain_name Default
project_name service
auth_type password
user_domain_name Default
auth_url http://controller:5000/v3
username placement
password placement
[powervm]
[privsep]
[profiler]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled true
server_listen 0.0.0.0
server_proxyclient_address $my_ip
novncproxy_base_url http://192.168.124.88:6080/vnc_auto.html
[workarounds]
[wsgi]
[xenserver]
[xvp]
[zvm]3.启动服务
[rootcomputer ~]# systemctl enable libvirtd.service openstack-nova-compute.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
[rootcomputer ~]# systemctl start libvirtd
[rootcomputer ~]# systemctl start libvirtd.service openstack-nova-compute.service4、在controller节点上
1.在controller节点上查看有没有计算节点
[rootcontroller ~]# openstack compute service list --service nova-compute
------------------------------------------------------------------------------
| ID | Binary | Host | Zone | Status | State | Updated At |
------------------------------------------------------------------------------
| 9 | nova-compute | computer | nova | enabled | up | 2023-02-10T15:15:29.000000 |
------------------------------------------------------------------------------2.发现计算节点
[rootcontroller ~]# su -s /bin/sh -c nova-manage cell_v2 discover_hosts --verbose nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell cell1: 87c82cc2-68f4-41d2-8427-5c959215ef1d
Checking host mapping for compute host computer: 833f408b-d646-483e-80eb-6f67c390fd43
Creating host mapping for compute host computer: 833f408b-d646-483e-80eb-6f67c390fd43
Found 1 unmapped computes in cell: 87c82cc2-68f4-41d2-8427-5c959215ef1d
3.配置自动发现节点
[rootcontroller ~]# vi /etc/nova/nova.conf[scheduler]
discover_hosts_in_cells_interval 300nova部署完成