OpenStack部署(四、placement)
- Placement组件部署
-
- 1. 创建数据库实例和用户
- 2. 创建placement用户并设置endpoint服务端点
- 3. placement服务安装及配置
- 4. 修改apache配置文件
- 5. 测试
Placement组件部署
ct(控制节点):192.168.117.80
1. 创建数据库实例和用户
mysql -uroot -pcreate 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;
2. 创建placement用户并设置endpoint服务端点
#创建用户placement:指定默认域
openstack user create --domain default --password placement_pass placement
#将service项目加入到placement用户,并授予管理员权限
openstack role add --project service --user placement admin
#创建placement服务
openstack service create --name placement --description "Placement API" placement
#创建endpoint服务端点,分别为公共、私有、管理员三种类型
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
3. 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
vim /etc/placement/placement.conf
#导入数据库
su -s /bin/sh -c "placement-manage db sync" placement
4. 修改apache配置文件
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>
systemctl restart httpd
5. 测试
#curl 测试访问
curl ct:8778#查看端口占用(netstat、lsof)
netstat -natp | grep 8778#检查placement状态
placement-status upgrade check