温馨提示×

CentOS Stream 8 手工搭建 OpenStack V 版(04 Placement)

小云
111
2023-10-14 13:49:02
栏目: 编程语言

在CentOS Stream 8上手工搭建OpenStack V版(04 Placement)的步骤如下:

  1. 安装OpenStack软件包和依赖项:
sudo dnf install centos-release-openstack-victoria
sudo dnf install openstack-placement-api
  1. 配置数据库:
sudo mysql_secure_installation
sudo mysql
CREATE DATABASE placement;
GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' \
IDENTIFIED BY 'PLACEMENT_DBPASS';
GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' \
IDENTIFIED BY 'PLACEMENT_DBPASS';
  1. 配置身份验证:
sudo openstack user create --domain default --password-prompt placement
sudo openstack role add --project service --user placement admin
sudo openstack service create --name placement \
--description "Placement API" placement
sudo openstack endpoint create --region RegionOne \
placement public http://controller:8778
sudo openstack endpoint create --region RegionOne \
placement internal http://controller:8778
sudo openstack endpoint create --region RegionOne \
placement admin http://controller:8778
  1. 编辑/etc/placement/placement.conf文件:
[placement_database]
connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement
[api]
auth_strategy = 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 = placement
password = PLACEMENT_PASS
[placement]
os_region_name = RegionOne
[cors]
[placement_database]
connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement
[api]
auth_strategy = 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 = placement
password = PLACEMENT_PASS
[placement]
os_region_name = RegionOne
[cors]
  1. 同步数据库:
sudo su -s /bin/sh -c "placement-manage db sync" placement
  1. 启动服务:
sudo systemctl enable httpd
sudo systemctl start httpd
sudo systemctl enable placement-api
sudo systemctl start placement-api

现在,您已经成功地在CentOS Stream 8上手工搭建了OpenStack V版(04 Placement)。

0