OpenStack 运维 - 部署Placement组件 [Tarin版]

Posted serendipity_cat

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenStack 运维 - 部署Placement组件 [Tarin版]相关的知识,希望对你有一定的参考价值。

一、创建数据库实例和数据库用户

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

openstack service create --name placement --description "Placement API" placement

④ 注册API端口到placement的service中

#注册的信息会写入到mysql中
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_PASS

#检查参数
cat /etc/placement/placement.conf

四、导入数据库及修改 Apache 配置文件

#导入数据
su -s /bin/sh -c "placement-manage db sync" placement

vim /etc/httpd/conf.d/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

五、测试访问、检查端口及 Placement 的状态

curl ct:8778

netstat -natp | grep 8778

placement-status upgrade check

以上是关于OpenStack 运维 - 部署Placement组件 [Tarin版]的主要内容,如果未能解决你的问题,请参考以下文章

OpenStack 运维 - 部署Dashboard组件 [T版]

网易OpenStack部署运维实战

网易OpenStack部署运维实战

网易OpenStack部署运维实战

Linux运维---16. Kolla部署OpenStack外接rabbit集群

OpenStack 运维 - 环境部署 | 报错排查