OpenStack部署之Placement项目(7-4)

Posted 时代广场的蟋蟀

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenStack部署之Placement项目(7-4)相关的知识,希望对你有一定的参考价值。

OpenStack部署之Placement项目(7-4)

一、Placement概述

二、OpenStack-Placement组件部署

CT VM:192.168.10.101 NAT:192.168.221.101

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

mysql -uroot -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

2、创建Placement服务用户和API的endpoint

创建placement用户、授权、创建placement服务
openstack user create --domain default --password PLACEMENT_PASS placement   #创建角色placement指定域名default,密码PASS...
openstack role add --project service --user placement admin  #将placement用户加入service项目中,并赋予admin权限
openstack service create --name placement --description "Placement API" placement  #在service项目中创建服务名字placement描述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


3、安装placement服务

yum -y install openstack-placement-api


修改placement配置文件/etc/placement/placement.conf
cp -a /etc/placement/placement.conf,.bak
grep -Ev '^$|#' /etc/placement/placement.conf.bak > /etc/placement/placement.conf

添加/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

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



4、修改00-placemenct-api.conf配置文件

00-placemenct-api.conf(安装完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

5、测试访问和端口号

curl 测试访问
curl ct:8778

查看端口占用(netstat、lsof)
netstat -natp | grep 8778

检查placement状态
placement-status upgrade check

6、总结

以上是关于OpenStack部署之Placement项目(7-4)的主要内容,如果未能解决你的问题,请参考以下文章

OpenStack的部署T版——Placement组件

OpenStack的部署T版——Placement组件

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

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

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

openstack篇 placement组件部署(t版)