本文最后更新于218 天前,其中的信息可能已经过时,如有错误请发送邮件到2639131093@qq.com
注意
1.本教程为openstack 搭建平台victoria 版,虚拟机为centos stream 8
2.本教程设计内容非常多,很复杂,但也很有技巧,请注意每一步,我说可以更改的地方可以更改,其余建议和我一样
3.内容板块大体包括:基础环境设置, keystone组建安装,glance组建安装,placement组建安装,nova组建安装,neutron组建安装,dashboard组建安装
4.密码约定:本文所有和数据库及消息队列相关的密码统一设定 rootroot,openstack 组件用户密码统一设定 redhat
5.学习此章节,你需要了解的知识:数据库sql中dcl用户管理的知识,linux基础命令,openstack基础命令
6.官方网址:
OpenStack Docs: Install and configure controller node for Red Hat Enterprise Linux and CentOS
7.环境配置:
环境用到 2台 虚拟机,单网卡,并为其配置 静态 IP 及 DNS
主机名 | ip | 网关 | DNS | cpu/内存 | 磁盘 | 角色 | 备注 |
controller | 192.168.100.128 | 192.168.100.2 | 114.114.114.114 | 4c/6g | 100g | 控制节点 | 开启虚拟化引擎 |
compute | 192.168.100.129 | 192.168.100.2 | 114.114.114.114 | 4c/6g | 100g | 计算节点 | 开启虚拟化引擎 |
控制节点
建库及授权
[root@controller ~(admin)]$ mysql -uroot -prootroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 43
Server version: 10.3.28-MariaDB MariaDB Server
Copyright (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;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> create database nova;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> create database nova_cell0;
Query OK, 1 row affected (0.001 sec)
##懒得解释了 反正就是sql的dcl知识
MariaDB [(none)]> grant all privileges on nova_api.* to 'nova'@'localhost'identified by 'rootroot';
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> grant all privileges on nova_api.* to 'nova'@'%'identified by 'rootroot';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all privileges on nova.* to 'nova'@'%'identified by 'rootroot';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all privileges on nova.* to 'nova'@'localhost'identified by 'rootroot';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all privileges on nova_cell0.* to 'nova'@'localhost'identified by 'rootroot';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all privileges on nova_cell0.* to 'nova'@'%'identified by 'rootroot';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| glance |
| information_schema |
| keystone |
| mysql |
| nova |
| nova_api |
| nova_cell0 |
| performance_schema |
| placement |
+--------------------+
9 rows in set (0.002 sec)
创建用户及关联角色
[root@controller ~(admin)]$ openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 0c39c2efcb144276b82ac8fb249655b2 |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
[root@controller ~(admin)]$ openstack role add --project service --user nova admin
[root@controller ~(admin)]$ openstack role assignment list --user nova
+----------------------------------+----------------------------------+-------+----------------------------------+--------+--------+-----------+
| Role | User | Group | Project | Domain | System | Inherited |
+----------------------------------+----------------------------------+-------+----------------------------------+--------+--------+-----------+
| 35eb6220a4b14503b1672de9f0ffcae9 | 0c39c2efcb144276b82ac8fb249655b2 | | 578eca45e7e549858c97314e3f2ec1e3 | | | False |
+----------------------------------+----------------------------------+-------+----------------------------------+--------+--------+-----------+
[root@controller ~(admin)]$ openstack user list
+----------------------------------+-----------+
| ID | Name |
+----------------------------------+-----------+
| cda7fc3c6ff74289b8f40e149d397710 | admin |
| 9688822b0dcd41929430ab48335fceb2 | myuser |
| 2c401bee20a245ac88cf4629ed4ee440 | glance |
| 3e66c60b57354be89ac3d5e85fb2f485 | placement |
| 0c39c2efcb144276b82ac8fb249655b2 | nova |
+----------------------------------+-----------+
创建服务及注册API
[root@controller ~(admin)]$ openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | b72941ac12b044e281e3e8adbc74476d |
| name | nova |
| type | compute |
+-------------+----------------------------------+
[root@controller ~(admin)]$ openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | af379dafc84344b190a0b9bd0a08aa67 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | b72941ac12b044e281e3e8adbc74476d |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+----------------------------------+
[root@controller ~(admin)]$ openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | a57a74e92f0143e4b13f6211f03a6c3d |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | b72941ac12b044e281e3e8adbc74476d |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+----------------------------------+
[root@controller ~(admin)]$ openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | a0056090bca448f48158baec90bba5f3 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | b72941ac12b044e281e3e8adbc74476d |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+----------------------------------+
[root@controller ~(admin)]$ openstack endpoint list ##此处正常情况为12个
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
| 0347ebc573814319b61f2b061d12a76d | RegionOne | glance | image | True | internal | http://controller:9292 |
| 5b07ad93e892406da4bac5dd0338e3cf | RegionOne | placement | placement | True | internal | http://controller:8778 |
| 6395f0c625274f4b90e9137f38e93882 | RegionOne | keystone | identity | True | admin | http://controller:5000/v3/ |
| 810eab1198cc44dc8a2f4de04d227da4 | RegionOne | glance | image | True | admin | http://controller:9292 |
| 861dc3b20d324e4892e506058c2c7b1f | RegionOne | glance | image | True | public | http://controller:9292 |
| a0056090bca448f48158baec90bba5f3 | RegionOne | nova | compute | True | admin | http://controller:8774/v2.1 |
| a57a74e92f0143e4b13f6211f03a6c3d | RegionOne | nova | compute | True | internal | http://controller:8774/v2.1 |
| af379dafc84344b190a0b9bd0a08aa67 | RegionOne | nova | compute | True | public | http://controller:8774/v2.1 |
| ca45bbfeef81436688974a8d04e75d88 | RegionOne | keystone | identity | True | internal | http://controller:5000/v3/ |
| dc77bcd015344f4c9406495cba143841 | RegionOne | placement | placement | True | admin | http://controller:8778 |
| deb57dd079d1434b8ba2560d13aa8757 | RegionOne | placement | placement | True | public | http://controller:8778 |
| ff9d2f5be3c54026a27d8661b68460b9 | RegionOne | keystone | identity | True | public | http://controller:5000/v3/ |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-----------------------------+
安装nova
[root@controller ~(admin)]$ yum install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler -y
上次元数据过期检查:4:18:42 前,执行于 2024年08月28日 星期三 02时44分32秒。
##太多不一一展示了
已升级:
python3-requests-2.22.0-7.el8.noarch
已安装:
ipcalc-0.2.4-4.el8.x86_64 libsodium-1.0.18-2.el8.x86_64
network-scripts-10.00.18-1.el8.x86_64 network-scripts-openvswitch2.13-2.13.0-214.el8s.x86_64
network-scripts-team-1.31-4.el8.x86_64 nodejs-1:10.23.1-1.module_el8.4.0+645+9ce14ba2.x86_64
nodejs-full-i18n-1:10.23.1-1.module_el8.4.0+645+9ce14ba2.x86_64 novnc-1.1.0-6.el8.noarch
npm-1:6.14.10-1.10.23.1.1.module_el8.4.0+645+9ce14ba2.x86_64 openstack-nova-api-1:22.4.0-1.el8.noarch
openstack-nova-common-1:22.4.0-1.el8.noarch openstack-nova-conductor-1:22.4.0-1.el8.noarch
openstack-nova-novncproxy-1:22.4.0-1.el8.noarch openstack-nova-scheduler-1:22.4.0-1.el8.noarch
openvswitch-selinux-extra-policy-1.0-29.el8s.noarch openvswitch2.13-2.13.0-214.el8s.x86_64
python-oslo-versionedobjects-lang-2.3.0-2.el8.noarch python3-dataclasses-0.7-1.el8.noarch
python3-fluidity-sm-0.2.0-16.el8.noarch python3-invoke-1.4.0-1.el8.noarch
python3-kazoo-2.8.0-1.el8.noarch python3-lexicon-1.0.0-9.el8.noarch
python3-nova-1:22.4.0-1.el8.noarch python3-openvswitch2.13-2.13.0-214.el8s.x86_64
python3-os-vif-2.2.1-1.el8.noarch python3-oslo-versionedobjects-2.3.0-2.el8.noarch
python3-ovsdbapp-1.6.1-1.el8.noarch python3-paramiko-2.7.2-1.el8.noarch
python3-pynacl-1.4.0-1.el8.x86_64 python3-pyroute2-0.5.13-1.1.el8.noarch
python3-rdo-openvswitch-1:2.13-3.el8.noarch python3-redis-3.3.8-1.el8.noarch
python3-tooz-2.7.2-1.el8.noarch python3-voluptuous-0.11.7-2.el8.noarch
python3-websockify-0.9.0-1.el8.noarch python3-zake-0.2.2-18.el8.noarch
编辑配置文件
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:rootroot@controller:5672/
my_ip = 192.168.100.128 ##第一行
[api_database]
connection = mysql+pymysql://nova:rootroot@controller/nova_api ##1100左右
[database]
connection = mysql+pymysql://nova:rootroot@controller/nova ##1720左右
[api]
auth_strategy = keystone ##890左右
[keystone_authtoken]
www_authenticate_uri = http://controller:5000/
auth_url = http://controller:5000/ ##2680左右
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = redhat
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip ##5350左右
[glance]
api_servers = http://controller:9292 ##2040左右
[oslo_concurrency]
lock_path = /var/lib/nova/tmp ##3750左右
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default ##4290左右
auth_url = http://controller:5000/v3
username = placement
password = redhat
初始化数据库
[root@controller ~(admin)]$ su -s /bin/sh -c "nova-manage api_db sync" nova
##初始化api数据库
[root@controller ~(admin)]$ su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
##初始化cell0数据库
[root@controller ~(admin)]$ su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
##初始化cell数据库
--transport-url not provided in the command line, using the value [DEFAULT]/transport_url from the configuration file
--database_connection not provided in the command line, using the value [database]/connection from the configuration file
df605cf2-4246-4212-a02a-a237ac56cec0
[root@controller ~(admin)]$ su -s /bin/sh -c "nova-manage db sync" nova
##填充nova数据库
[root@controller ~(admin)]$ su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
##验证 nova cell0 和 cell1 是否已正确注册
+-------+--------------------------------------+------------------------------------------+-------------------------------------------------+----------+
| 名称 | UUID | Transport URL | 数据库连接 | Disabled |
+-------+--------------------------------------+------------------------------------------+-------------------------------------------------+----------+
| cell0 | 00000000-0000-0000-0000-000000000000 | none:/ | mysql+pymysql://nova:****@controller/nova_cell0 | False |
| cell1 | df605cf2-4246-4212-a02a-a237ac56cec0 | rabbit://openstack:****@controller:5672/ | mysql+pymysql://nova:****@controller/nova | False |
+-------+--------------------------------------+------------------------------------------+-------------------------------------------------+----------+
重启服务并测试
[root@controller ~(admin)]$ systemctl enable \
> openstack-nova-api.service \
> openstack-nova-scheduler.service \
> openstack-nova-conductor.service \
> openstack-nova-novncproxy.service
Created symlink /etc/systemd/system/multi-user.target.wants/openstack-nova-api.service → /usr/lib/systemd/system/openstack-nova-api.service.
Created symlink /etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service → /usr/lib/systemd/system/openstack-nova-scheduler.service.
Created symlink /etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service → /usr/lib/systemd/system/openstack-nova-conductor.service.
Created symlink /etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service → /usr/lib/systemd/system/openstack-nova-novncproxy.service.
[root@controller ~(admin)]$ systemctl start \
> openstack-nova-api.service \
> openstack-nova-scheduler.service \
> openstack-nova-conductor.service \
> openstack-nova-novncproxy.service
[root@controller ~(admin)]$ nova service-list
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+-----------------+-------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | Forced down |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+-----------------+-------------+
| b4390dd1-b2ff-45e2-a52a-2833bbb12455 | nova-conductor | controller | internal | enabled | up | 2024-08-28T11:30:05.000000 | - | False |
| f9b2396b-c97a-446c-9c19-1ba321eaf8f0 | nova-scheduler | controller | internal | enabled | up | 2024-08-28T11:30:08.000000 | - | False |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+-----------------+-------------+
[root@controller ~(admin)]$ systemctl status openstack-nova-novncproxy.service
● openstack-nova-novncproxy.service - OpenStack Nova NoVNC Proxy Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-novncproxy.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2024-08-28 07:29:53 EDT; 43s ago
Main PID: 59868 (nova-novncproxy)
Tasks: 1 (limit: 36628)
Memory: 92.4M
CGroup: /system.slice/openstack-nova-novncproxy.service
└─59868 /usr/bin/python3 /usr/bin/nova-novncproxy --web /usr/share/novnc/
8月 28 07:29:53 controller systemd[1]: Started OpenStack Nova NoVNC Proxy Server.
[root@controller ~(admin)]$ netstat -tulnp |grep 60
##查看nova的web端口
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 36059/beam.smp
tcp 0 0 0.0.0.0:6080 0.0.0.0:* LISTEN 59868/python3
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 36059/beam.smp
tcp6 0 0 :::5672 :::* LISTEN 36059/beam.smp
登录vnc
输入:
http://192.168.100.128:6080/
计算节点
安装nova
[root@compute yum.repos.d]# yum install openstack-nova-compute -y
老样子 太多了
已安装:
bind-export-libs-32:9.11.36-13.el8.x86_64
blosc-1.17.0-1.el8.x86_64
dhcp-client-12:4.3.6-50.el8.x86_64
dhcp-common-12:4.3.6-50.el8.noarch
dhcp-libs-12:4.3.6-50.el8.x86_64
graphviz-2.40.1-45.el8.x86_64
hdf5-1.10.5-5.el8.x86_64
hivex-1.3.18-23.module_el8+310+72016cce.x86_64
ipcalc-0.2.4-4.el8.x86_64
ipmitool-1.8.18-19.el8.x86_64
iptables-services-1.8.4-23.el8.x86_64
libXaw-1.0.13-10.el8.x86_64
libaec-1.0.2-3.el8.x86_64
libgfortran-8.5.0-22.el8.x86_64
libguestfs-1:1.44.0-9.module_el8+310+72016cce.x86_64
libguestfs-appliance-1:1.44.0-9.module_el8+310+72016cce.x86_64
libqhull-1:7.2.1-2.el8.x86_64
libquadmath-8.5.0-22.el8.x86_64
libsodium-1.0.18-2.el8.x86_64
libvirt-client-8.0.0-10.module_el8.7.0+1218+f626c2ff.x86_64
network-scripts-10.00.18-1.el8.x86_64
network-scripts-openvswitch2.13-2.13.0-214.el8s.x86_64
network-scripts-team-1.31-4.el8.x86_64
openblas-0.3.15-4.el8.x86_64
openblas-threads-0.3.15-4.el8.x86_64
openstack-nova-common-1:22.4.0-1.el8.noarch
openstack-nova-compute-1:22.4.0-1.el8.noarch
openvswitch-selinux-extra-policy-1.0-29.el8s.noarch
openvswitch2.13-2.13.0-214.el8s.x86_64
perl-Filter-2:1.58-2.el8.x86_64
perl-Text-Unidecode-1.30-5.el8.noarch
perl-XML-Parser-2.44-11.el8.x86_64
perl-XML-XPath-1.42-3.el8.noarch
perl-encoding-4:2.22-3.el8.x86_64
perl-open-1.11-422.el8.noarch
platform-python-devel-3.6.8-62.el8.x86_64
python-oslo-cache-lang-2.6.3-1.el8.noarch
python-oslo-concurrency-lang-4.3.1-1.el8.noarch
python-oslo-db-lang-8.4.1-1.el8.noarch
python-oslo-middleware-lang-4.1.1-2.el8.noarch
python-oslo-policy-lang-3.5.0-2.el8.noarch
python-oslo-privsep-lang-2.4.0-2.el8.noarch
python-oslo-versionedobjects-lang-2.3.0-2.el8.noarch
python-oslo-vmware-lang-3.7.0-2.el8.noarch
python-pycadf-common-3.1.1-2.el8.noarch
python-rpm-macros-3-45.el8.noarch
python-srpm-macros-3-45.el8.noarch
python3-Bottleneck-1.2.1-13.el8.x86_64
python3-PyMySQL-0.10.1-2.module_el8+762+77bd8591.noarch
python3-alembic-1.4.2-5.el8.noarch
python3-amqp-2.6.1-1.el8.noarch
python3-automaton-2.2.0-1.el8.noarch
python3-babel-2.5.1-7.el8.noarch
python3-barbicanclient-5.0.1-2.el8.noarch
python3-bcrypt-3.1.7-3.el8s.x86_64
python3-boto-2.49.0-4.el8.noarch
python3-cachetools-4.2.0-1.el8s.noarch
python3-castellan-3.6.1-1.el8.noarch
python3-cursive-0.2.2-1.el8.noarch
python3-cycler-0.10.0-13.el8.noarch
python3-dataclasses-0.7-1.el8.noarch
python3-dns-1.15.0-12.el8.noarch
python3-editor-1.0.4-4.el8.noarch
python3-etcd3gw-0.2.5-1.el8.noarch
python3-eventlet-0.25.2-3.1.el8.noarch
python3-fasteners-0.14.1-20.el8.noarch
python3-fluidity-sm-0.2.0-16.el8.noarch
python3-futurist-2.3.0-2.el8.noarch
python3-glanceclient-1:3.2.2-2.el8.noarch
python3-greenlet-0.4.13-4.el8.x86_64
python3-invoke-1.4.0-1.el8.noarch
python3-jinja2-2.10.1-5.el8.noarch
python3-jsonschema-3.2.0-5.el8.noarch
python3-kazoo-2.8.0-1.el8.noarch
python3-keystonemiddleware-9.1.0-2.el8.noarch
python3-kiwisolver-1.1.0-4.el8.x86_64
python3-kombu-1:4.6.11-2.el8.noarch
python3-ldap-3.3.1-2.el8.x86_64
python3-lexicon-1.0.0-9.el8.noarch
python3-libguestfs-1:1.44.0-9.module_el8+310+72016cce.x86_64
python3-libvirt-8.0.0-2.module_el8+310+72016cce.x86_64
python3-matplotlib-3.1.1-2.el8.x86_64
python3-matplotlib-data-3.1.1-2.el8.noarch
python3-matplotlib-data-fonts-3.1.1-2.el8.noarch
python3-matplotlib-tk-3.1.1-2.el8.x86_64
python3-memcached-1.58-11.el8.noarch
python3-microversion-parse-1.0.1-1.el8.noarch
python3-migrate-0.13.0-1.el8.noarch
python3-mock-3.0.5-7.el8.noarch
python3-monotonic-1.5-5.el8.noarch
python3-networkx-2.5-1.el8.noarch
python3-nova-1:22.4.0-1.el8.noarch
python3-numexpr-2.7.1-1.el8.x86_64
python3-numpy-1:1.14.3-10.el8.x86_64
python3-numpy-f2py-1:1.14.3-10.el8.x86_64
python3-openvswitch2.13-2.13.0-214.el8s.x86_64
python3-os-brick-4.0.5-1.el8.noarch
python3-os-resource-classes-1.0.0-1.el8.noarch
python3-os-traits-2.4.0-2.el8.noarch
python3-os-vif-2.2.1-1.el8.noarch
python3-os-win-5.2.0-1.el8.noarch
python3-oslo-cache-2.6.3-1.el8.noarch
python3-oslo-concurrency-4.3.1-1.el8.noarch
python3-oslo-db-8.4.1-1.el8.noarch
python3-oslo-messaging-12.5.2-1.el8.noarch
python3-oslo-middleware-4.1.1-2.el8.noarch
python3-oslo-policy-3.5.0-2.el8.noarch
python3-oslo-privsep-2.4.0-2.el8.noarch
python3-oslo-reports-2.2.0-2.el8.noarch
python3-oslo-rootwrap-6.2.0-2.el8.noarch
python3-oslo-service-2.4.1-1.el8.noarch
python3-oslo-upgradecheck-1.1.1-2.el8.noarch
python3-oslo-versionedobjects-2.3.0-2.el8.noarch
python3-oslo-vmware-3.7.0-2.el8.noarch
python3-ovsdbapp-1.6.1-1.el8.noarch
python3-pandas-0.25.3-1.el8.x86_64
python3-paramiko-2.7.2-1.el8.noarch
python3-paste-3.5.0-1.el8.noarch
python3-paste-deploy-2.1.0-3.el8.noarch
python3-pillow-5.1.1-21.el8.x86_64
python3-pyOpenSSL-19.0.0-1.el8.noarch
python3-pyasn1-0.4.6-3.el8s.noarch
python3-pyasn1-modules-0.4.6-3.el8s.noarch
python3-pycadf-3.1.1-2.el8.noarch
python3-pydot-1.4.1-1.el8.noarch
python3-pygraphviz-1.5-9.el8.x86_64
python3-pynacl-1.4.0-1.el8.x86_64
python3-pyngus-2.3.0-4.el8.noarch
python3-pyroute2-0.5.13-1.1.el8.noarch
python3-pyrsistent-0.16.0-3.el8.x86_64
python3-qpid-proton-0.30.0-1.el8.x86_64
python3-rdo-openvswitch-1:2.13-3.el8.noarch
python3-redis-3.3.8-1.el8.noarch
python3-repoze-lru-0.7-6.el8s.noarch
python3-retrying-1.2.3-21.el8.noarch
python3-routes-2.4.1-12.el8s.noarch
python3-rpm-generators-5-8.el8.noarch
python3-rpm-macros-3-45.el8.noarch
python3-rsa-4.6-2.el8s.noarch
python3-scipy-1.0.0-21.module_el8+762+77bd8591.x86_64
python3-sqlalchemy-1.3.2-3.module_el8+778+ea5e2816.x86_64
python3-sqlparse-0.3.1-3.el8.noarch
python3-statsd-3.2.1-16.el8.noarch
python3-suds-0.7-0.11.94664ddd46a6.el8.noarch
python3-tables-3.5.2-6.el8.x86_64
python3-taskflow-4.5.0-2.el8.noarch
python3-tempita-0.5.1-25.el8s.noarch
python3-tenacity-6.2.0-1.el8.noarch
python3-tkinter-3.6.8-62.el8.x86_64
python3-tooz-2.7.2-1.el8.noarch
python3-vine-1.3.0-4.el8.noarch
python3-voluptuous-0.11.7-2.el8.noarch
python3-warlock-1.3.3-1.el8.noarch
python3-webob-1.8.6-3.el8s.noarch
python3-yappi-1.2.5-1.el8.x86_64
python3-zake-0.2.2-18.el8.noarch
qpid-proton-c-0.30.0-1.el8.x86_64
rdo-openvswitch-1:2.13-3.el8.noarch
scrub-2.5.2-16.el8.x86_64
supermin-5.2.1-2.module_el8+310+72016cce.x86_64
sysfsutils-2.1.0-25.el8.x86_64
syslinux-6.04-6.el8.x86_64
syslinux-extlinux-6.04-6.el8.x86_64
syslinux-extlinux-nonlinux-6.04-6.el8.noarch
syslinux-nonlinux-6.04-6.el8.noarch
tcl-1:8.6.8-2.el8.x86_64
texlive-base-7:20180414-29.el8.noarch
texlive-dvipng-7:20180414-29.el8.x86_64
texlive-kpathsea-7:20180414-29.el8.x86_64
texlive-lib-7:20180414-29.el8.x86_64
texlive-tetex-7:20180414-29.el8.noarch
texlive-texlive.infra-7:20180414-29.el8.noarch
tk-1:8.6.8-1.el8.x86_64
xorg-x11-fonts-ISO8859-1-100dpi-7.5-19.el8.noarch
完毕!
[root@compute yum.repos.d]# cd
[root@compute ~]#
编辑配置文件
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:rootroot@controller ##第一行
my_ip = 192.168.100.129
[api]
auth_strategy = keystone ##890左右
[keystone_authtoken]
www_authenticate_uri = http://controller:5000/
auth_url = http://controller:5000/
memcached_servers = controller:11211 ##2680左右
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = redhat
[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip ##5350左右
novncproxy_base_url = http://controller:6080/vnc_auto.html
[glance]
api_servers = http://controller:9292 ##2030左右
[oslo_concurrency]
lock_path = /var/lib/nova/tmp ##3750左右
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default ##4290左右
auth_url = http://controller:5000/v3
username = placement
password = redhat
启动服务
[root@compute ~]# systemctl start libvirtd.service openstack-nova-compute.service
[root@compute ~]# systemctl enable libvirtd.service openstack-nova-compute.service
Created symlink /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service → /usr/lib/systemd/system/openstack-nova-compute.service.
返回控制节点
确认及发现计算节点
[root@controller ~(admin)]$ source keystonerc_admin
[root@controller ~(admin)]$ ping 192.168.100.129
PING 192.168.100.129 (192.168.100.129) 56(84) bytes of data.
64 bytes from 192.168.100.129: icmp_seq=1 ttl=64 time=7.29 ms
64 bytes from 192.168.100.129: icmp_seq=2 ttl=64 time=0.784 ms
^C
--- 192.168.100.129 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 0.784/4.036/7.288/3.252 ms
[root@controller ~(admin)]$ openstack compute service list --service nova-compute
+----+--------------+---------+------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+--------------+---------+------+---------+-------+----------------------------+
| 5 | nova-compute | compute | nova | enabled | up | 2024-08-28T11:50:48.000000 |
+----+--------------+---------+------+---------+-------+----------------------------+
[root@controller ~(admin)]$ 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': df605cf2-4246-4212-a02a-a237ac56cec0
Checking host mapping for compute host 'compute': 28beb780-f6ef-4713-ac7c-3463d7f1b5fe
Creating host mapping for compute host 'compute': 28beb780-f6ef-4713-ac7c-3463d7f1b5fe
Found 1 unmapped computes in cell: df605cf2-4246-4212-a02a-a237ac56cec0
[root@controller ~(admin)]$ vim /etc/nova/nova.conf
##打开后修改
[scheduler]
discover_hosts_in_cells_interval = 300
[root@controller ~(admin)]$ nova service-list
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+-----------------+-------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | Forced down |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+-----------------+-------------+
| b4390dd1-b2ff-45e2-a52a-2833bbb12455 | nova-conductor | controller | internal | enabled | up | 2024-08-28T11:52:36.000000 | - | False |
| f9b2396b-c97a-446c-9c19-1ba321eaf8f0 | nova-scheduler | controller | internal | enabled | up | 2024-08-28T11:52:39.000000 | - | False |
| 22527ad0-d6a2-471b-9a9e-6c6157725a0c | nova-compute | compute | nova | enabled | up | 2024-08-28T11:52:38.000000 | - | False |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+-----------------+-------------+
评论