【Placement】服务 是从【nova】服务中拆分出来的组件,作用是收集各个【node】节点的可用资源,把【node】节点的资源统计写入到【MySQL】
【Placement】服务会被【nova scheduler】服务进行调用
【Placement】服务的监听端口是【8778】
//ct(192.168.61.55):
mysql -uroot -p1
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';
#赋予用户远程权限:
#允许用户'placement'远程登录(%)连接到mysql服务器中'placement,并使用'PLACEMENT_DBPASS'作为密码
flush privileges;
#刷新数据库的系统权限相关表,否则可能会出现拒绝访问的现象
exit;
#退出MariaDB数据库,或'ctrl+c'
openstack user create --domain default --password PLACEMENT_PASS placement
openstack role add --project service --user placement admin
openstack service create --name placement --description "Placement API" placement
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
#注册的信息会写入到mysql中
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
su -s /bin/sh -c "placement-manage db sync" placement
#可能会Warning提示你,这个没问题的,你可以再执行一次看看就没有Warning了
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>
systemctl restart httpd
curl ct:8778
netstat -natp | grep 8778
或
lsof -i:8778
placement-status upgrade check