🐼
- Placement组件部署
- 创建数据库实例和用户
- 创建Placement服务用户和API的endpoint
- Placement 的安装与配置
- 修改Apache配置文件
- 验证
Placement组件部署
openstack部署遵循以下顺序
创建数据库实例和用户
mysql -u root -p密码
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';flush privileges;
exit
创建Placement服务用户和API的endpoint
# 创建placement用户
openstack user create --domain default --password PLACEMENT_PASS placement
#让placement用户对service项目拥有admin权限
openstack role add --project service --user placement admin
#创建一个placement服务,服务类型为placement
# 注册API端口到placement的service中,注册信息会写入数据库中
openstack endpoint create --region RegionOne placement public http://ct:8778
openstack endpoint create --region RegionOne placement internal http://ct:8778
openstack endpoint create --region RegionOne placement admin http://ct:8778
Placement 的安装与配置
yum -y install openstack-placement-api#备份配置文件
cp -a /etc/placement/placement.conf{,.bak}
grep -Ev '^$|#' /etc/placement/placement.conf.bak > /etc/placement/placement.conf#传参
openstack-config --set /etc/placement/placement.conf placement_database connection mysql+pymysql://placement:PLACEMENT_DBPASS@ct/placement
openstack-config --set /etc/placement/placement.conf api auth_strategy keystone
openstack-config --set /etc/placement/placement.conf keystone_authtoken auth_url http://ct:5000/v3
openstack-config --set /etc/placement/placement.conf keystone_authtoken memcached_servers ct:11211
openstack-config --set /etc/placement/placement.conf keystone_authtoken auth_type password
openstack-config --set /etc/placement/placement.conf keystone_authtoken project_domain_name Default
openstack-config --set /etc/placement/placement.conf keystone_authtoken user_domain_name Default
openstack-config --set /etc/placement/placement.conf keystone_authtoken project_name service
openstack-config --set /etc/placement/placement.conf keystone_authtoken username placement
openstack-config --set /etc/placement/placement.conf keystone_authtoken password PLACEMENT_PASScat /etc/placement/placement.conf
#导入数据库
su -s /bin/sh -c "placement-manage db sync" placement
修改Apache配置文件
#安装完placement服务后会自动创建(虚拟主机配置)
cd /etc/httpd/conf.d
vim 00-placement-api.conf
#末尾添加
<Directory /usr/bin>
<IfVersion >= 2.4>Require all granted
</IfVersion>
<IfVersion < 2.4>Order allow,deny Allow from all
</IfVersion>
</Directory>#重启apache
systemctl restart httpd
验证
#curl 测试访问
curl ct:8778#查看端口占用
netstat -natp | grep 8778#检查placement状态
placement-status upgrade check