参考链接:https://docs.openstack.org/placement/train/install/install-rdo.html

操作步骤:

1、建库授权

MariaDB [(none)]> CREATE DATABASE placement;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY 'PLACEMENT_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY 'PLACEMENT_DBPASS';

2、创建用户、服务、绑定admin角色

openstack user create --domain default --password-prompt placement
openstack role add --project service --user placement admin
openstack service create --name placement --description "Placement API" placement

3、创建endpoint

openstack endpoint create --region RegionOne  placement public http://controller:8778
openstack endpoint create --region RegionOne  placement internal http://controller:8778
openstack endpoint create --region RegionOne  placement admin http://controller:8778

4、安装并配置组件

yum install openstack-placement-api

修改配置文件/etc/placement/placement.conf

[placement_database]
# ...
connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement

[api]
# ...
auth_strategy = 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 = placement
password = PLACEMENT_PASS

5、同步数据库

su -s /bin/sh -c "placement-manage db sync" placement

6、重启httpd服务

systemctl restart httpd