日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

openstack 安装并验证 Nova( 计算节点 + 控制节点)

發(fā)布時間:2023/12/20 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 openstack 安装并验证 Nova( 计算节点 + 控制节点) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

安裝數(shù)據(jù)庫,登錄數(shù)據(jù)庫創(chuàng)建 nova,nova_api,nova_cell0 數(shù)據(jù)庫

[root@controller etcd]# mysql -uroot -pmaster Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 68 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)]> CREATE DATABASE nova_api default character set utf8; Query OK, 1 row affected (0.000 sec)MariaDB [(none)]> CREATE DATABASE nova default character set utf8; Query OK, 1 row affected (0.000 sec)MariaDB [(none)]> CREATE DATABASE nova_cell0 default character set utf8; Query OK, 1 row affected (0.000 sec)MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack'; Query OK, 0 rows affected (0.006 sec)MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'openstack'; Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack'; Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'openstack'; Query OK, 0 rows affected (0.001 sec)MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack'; Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'openstack'; Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]>

創(chuàng)建用戶和 API 服務端點
將 nova 加入到 service 項目以及 admin 角色

# source /etc/keystone/admin-openrc.sh # openstack user create --domain default --password-prompt nova 密碼 : openstack2022 [root@controller neutron]# clear [root@controller neutron]# openstack user create --domain default --password-prompt nova User Password: Repeat User Password: The passwords entered were not the same User Password:openstack2022 Repeat User Password:openstack2022 +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | domain_id | default | | enabled | True | | id | 3e91f4742a0347db908629f5ca05728f | | name | nova | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+ #將 nova 加入到 service 項目以及 admin 角色 [root@controller neutron]# openstack role add --project service --user nova admin #創(chuàng)建 nova 服務實體 # openstack service create --name nova --description "OpenStack Compute" compute [root@controller neutron]# openstack service create --name nova --description "OpenStack Compute" compute +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Compute | | enabled | True | | id | 624c9ae0addb4251ac52caa167978d1e | | name | nova | | type | compute | +-------------+----------------------------------+

創(chuàng)建 nova API 服務端點。

# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1 # openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1[root@controller neutron]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | 87992f70fc1949dbba2e9d1dda285163 | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 624c9ae0addb4251ac52caa167978d1e | | service_name | nova | | service_type | compute | | url | http://controller:8774/v2.1 | +--------------+----------------------------------+ [root@controller neutron]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | f3bc3cda06aa425b949eeee9542b09ad | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 624c9ae0addb4251ac52caa167978d1e | | service_name | nova | | service_type | compute | | url | http://controller:8774/v2.1 | +--------------+----------------------------------+ [root@controller neutron]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | 52dcfd3faba2440390ff718f995a955f | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 624c9ae0addb4251ac52caa167978d1e | | service_name | nova | | service_type | compute | | url | http://controller:8774/v2.1 | +--------------+----------------------------------+ [root@controller neutron]# openstack endpoint list +----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+ | ID | Region | Service Name | Service Type | Enabled | Interface | URL | +----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+ | 13c973c72cf948ababcc42ddb1cf119e | RegionOne | neutron | network | True | public | http://controller:9696 | | 1e6cc1d447794d23acb27b31ee623e03 | RegionOne | keystone | identity | True | public | http://controller:5000/v3/ | | 352a0664398a43ab925a0258323ea028 | RegionOne | keystone | identity | True | internal | http://controller:5000/v3/ | | 45060eb98d464fafa583b9059a790b7b | RegionOne | glance | image | True | public | http://controller:9292 | | 4ed1c70cc14b4bcfb9afe3037fd20345 | RegionOne | neutron | network | True | internal | http://controller:9696 | | 52dcfd3faba2440390ff718f995a955f | RegionOne | nova | compute | True | admin | http://controller:8774/v2.1 | | 7ad9669702454249bbc8451214d7088d | RegionOne | placement | placement | True | public | http://controller:8778 | | 87992f70fc1949dbba2e9d1dda285163 | RegionOne | nova | compute | True | public | http://controller:8774/v2.1 | | 894ebf45d0f34d209b42cb6aedb59e16 | RegionOne | placement | placement | True | admin | http://controller:8778 | | bc1c904203da41a0a4065d323c4efcdd | RegionOne | glance | image | True | admin | http://controller:9292 | | bf94b27ee6a949b08427d78f6f341ad6 | RegionOne | neutron | network | True | admin | http://controller:9696 | | c1c689d076f04a268a8a70a34e055497 | RegionOne | placement | placement | True | internal | http://controller:8778 | | cf8962f9a9b64086af9f31b6d730ed86 | RegionOne | keystone | identity | True | admin | http://controller:5000/v3/ | | d00353e12a3d49f89448e6c39b8bc442 | RegionOne | glance | image | True | internal | http://controller:9292 | | f3bc3cda06aa425b949eeee9542b09ad | RegionOne | nova | compute | True | internal | http://controller:8774/v2.1 | +----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+ [root@controller neutron]# #使用命令查看# openstack endpoint list

安裝配置 Nova
安裝組件

# yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler centos-openstack-train | 2.9 kB 00:00:00 centos-qemu-ev | 2.9 kB 00:00:00 ceph | 2.9 kB 00:00:00 ceph-noarch | 2.9 kB 00:00:00 docker-ce-stable | 2.9 kB 00:00:00 epel | 2.9 kB 00:00:00 extras | 2.9 kB 00:00:00 Not using downloaded extras/repomd.xml because it is older than what we have:Current : Wed Nov 23 15:27:27 2022Downloaded: Wed Oct 5 01:24:54 2022 openresty | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 Not using downloaded updates/repomd.xml because it is older than what we have:Current : Wed Nov 23 15:26:42 2022Downloaded: Sat Nov 12 01:10:48 2022 Package 1:openstack-nova-api-20.6.0-1.el7.noarch already installed and latest version Package 1:openstack-nova-conductor-20.6.0-1.el7.noarch already installed and latest version Package 1:openstack-nova-novncproxy-20.6.0-1.el7.noarch already installed and latest version Package 1:openstack-nova-scheduler-20.6.0-1.el7.noarch already installed and latest version Nothing to do /*修改配置文件 /etc/nova/nova.conf。說明:在配置 neutron 時已經(jīng)配置過 nova.conf ,所以此處直接修改 nova.conf在 [DEFAULT] 部分,開啟計算和元數(shù)據(jù) API ,配置 RabbitMQ 消息隊列訪問以及啟用網(wǎng)絡服務的支持*/ [root@controller neutron]# vi /etc/nova/nova.conf [root@controller neutron]# vi /etc/neutron/metadata_agent.ini [root@controller neutron]# cat /etc/nova/nova.conf [DEFAULT] enabled_apis = osapi_compute,metadata transport_url = rabbit://openstack:openstack@controller my_ip = 192.168.182.30 use_neutron = true firewall_driver = nova.virt.firewall.NoopFirewallDriver allow_resize_to_same_host = true[api] auth_strategy = keystone token_cache_time=3600[api_database] connection = mysql+pymysql://nova:openstack@controller/nova_api[barbican] [cache] [cinder] [compute] [conductor] [console] [consoleauth] [cors][database] connection = mysql+pymysql://nova:openstack@controller/nova[devices] [ephemeral_storage_encryption] [filter_scheduler][glance] api_servers = http://controller:9292[guestfs] [healthcheck] [hyperv] [ironic] [key_manager] [keystone][keystone_authtoken] auth_url = http://controller:5000/v3 memcached_servers = controller:11211 auth_type = password project_domain_name = Default user_domain_name = Default project_name = service username = nova password = openstack2022 token_cache_time=3600[libvirt] [metrics] [mks] [neutron] url = http://controller:9696 auth_url = http://controller:5000 auth_type = password project_domain_name = default user_domain_name = default region_name = RegionOne project_name = service username = neutron password = openstack2022 service_metadata_proxy = true metadata_proxy_shared_secret = openstack2022[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 = openstack2022[powervm] [privsep] [profiler] [quota] [rdp] [remote_debug][scheduler] discover_hosts_in_cells_interval = 180[serial_console] [service_user] [spice] [upgrade_levels] [vault] [vendordata_dynamic_auth] [vmware][vnc] enabled = true server_listen = $my_ip server_proxyclient_address = $my_ip novncproxy_host=0.0.0.0 novncproxy_port=6080 novncproxy_base_url=http://controller:6080/vnc_auto.html[workarounds] [wsgi] [xenserver] [xvp] [zvm] [root@controller neutron]# cat /etc/neutron/metadata_agent.ini [DEFAULT] nova_metadata_host = controller metadata_proxy_shared_secret = openstack2022[cache] 同步 nova 數(shù)據(jù)庫并驗證 [root@controller neutron]# su -s /bin/sh -c "nova-manage api_db sync" nova [root@controller neutron]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova [root@controller neutron]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova 536f18c4-ae1e-4801-8105-a82bf6b59877 #驗證 cell0 和 cell1 是否正確注冊 [root@controller neutron]# su -s /bin/sh -c "nova-manage db sync" nova /usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u'Duplicate 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, u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release')result = self._query(query)-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:/ | mysql+pymysql://nova:****@controller/nova_cell0 | False | | cell1 | 536f18c4-ae1e-4801-8105-a82bf6b59877 | rabbit://openstack:****@controller | mysql+pymysql://nova:****@controller/nova | False | +-------+--------------------------------------+------------------------------------+-------------------------------------------------+----------+#啟動 nova 服務并設置為開機自啟動 [root@controller neutron]# 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. [root@controller neutron]# systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service [root@controller neutron]# systemctl status openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service ● openstack-nova-api.service - OpenStack Nova API ServerLoaded: loaded (/usr/lib/systemd/system/openstack-nova-api.service; enabled; vendor preset: disabled)Active: active (running) since Thu 2022-11-24 18:57:33 CST; 39s agoMain PID: 76117 (nova-api)Tasks: 9CGroup: /system.slice/openstack-nova-api.service├─76117 /usr/bin/python2 /usr/bin/nova-api├─76182 /usr/bin/python2 /usr/bin/nova-api├─76183 /usr/bin/python2 /usr/bin/nova-api├─76187 /usr/bin/python2 /usr/bin/nova-api├─76189 /usr/bin/python2 /usr/bin/nova-api├─76199 /usr/bin/python2 /usr/bin/nova-api├─76202 /usr/bin/python2 /usr/bin/nova-api├─76203 /usr/bin/python2 /usr/bin/nova-api└─76204 /usr/bin/python2 /usr/bin/nova-apiNov 24 18:57:24 controller systemd[1]: Starting OpenStack Nova API Server... Nov 24 18:57:29 controller nova-api[76117]: /usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py:22: PkgResourcesDeprecationW...rately. Nov 24 18:57:29 controller nova-api[76117]: return pkg_resources.EntryPoint.parse("x=" + s).load(False) Nov 24 18:57:33 controller systemd[1]: Started OpenStack Nova API Server.● openstack-nova-scheduler.service - OpenStack Nova Scheduler ServerLoaded: loaded (/usr/lib/systemd/system/openstack-nova-scheduler.service; enabled; vendor preset: disabled)Active: active (running) since Thu 2022-11-24 18:57:41 CST; 31s agoMain PID: 76121 (nova-scheduler)Tasks: 5CGroup: /system.slice/openstack-nova-scheduler.service├─76121 /usr/bin/python2 /usr/bin/nova-scheduler├─76256 /usr/bin/python2 /usr/bin/nova-scheduler├─76257 /usr/bin/python2 /usr/bin/nova-scheduler├─76258 /usr/bin/python2 /usr/bin/nova-scheduler└─76259 /usr/bin/python2 /usr/bin/nova-schedulerNov 24 18:57:24 controller systemd[1]: Starting OpenStack Nova Scheduler Server... Nov 24 18:57:41 controller systemd[1]: Started OpenStack Nova Scheduler Server.● openstack-nova-conductor.service - OpenStack Nova Conductor ServerLoaded: loaded (/usr/lib/systemd/system/openstack-nova-conductor.service; enabled; vendor preset: disabled)Active: active (running) since Thu 2022-11-24 18:57:31 CST; 42s agoMain PID: 76122 (nova-conductor)Tasks: 5CGroup: /system.slice/openstack-nova-conductor.service├─76122 /usr/bin/python2 /usr/bin/nova-conductor├─76162 /usr/bin/python2 /usr/bin/nova-conductor├─76163 /usr/bin/python2 /usr/bin/nova-conductor├─76164 /usr/bin/python2 /usr/bin/nova-conductor└─76165 /usr/bin/python2 /usr/bin/nova-conductorNov 24 18:57:24 controller systemd[1]: Starting OpenStack Nova Conductor Server... Nov 24 18:57:31 controller systemd[1]: Started OpenStack Nova Conductor Server.● openstack-nova-novncproxy.service - OpenStack Nova NoVNC Proxy ServerLoaded: loaded (/usr/lib/systemd/system/openstack-nova-novncproxy.service; enabled; vendor preset: disabled)Active: active (running) since Thu 2022-11-24 18:57:24 CST; 49s agoMain PID: 76123 (nova-novncproxy)Tasks: 1CGroup: /system.slice/openstack-nova-novncproxy.service└─76123 /usr/bin/python2 /usr/bin/nova-novncproxy --web /usr/share/novnc/Nov 24 18:57:24 controller systemd[1]: Started OpenStack Nova NoVNC Proxy Server. Hint: Some lines were ellipsized, use -l to show in full. [root@controller neutron]#

總結

以上是生活随笔為你收集整理的openstack 安装并验证 Nova( 计算节点 + 控制节点)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。