安装placement放置服务
创建placement数据库
mysql -uroot 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;
创建placement用户
openstack user create --domain default --password PLACEMENT_PASS placement
将Placement用户添加到服务项目中
openstack role add --project service --user placement admin
创建placement API服务实体
openstack service create --name placement --description "Placement API" placement
创建placement API服务访问端点
openstack endpoint create --region RegionOne placement public http://controller:8778 openstack endpoint create --region RegionOne placement internal http://controller:8778 openstack endpoint create --region RegionOne placement admin http://controller:8778
安装placement软件包
yum install openstack-placement-api -y
修改配置文件/etc/placement/placement.conf
cp /etc/placement/placement.conf /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@controller/placement openstack-config --set /etc/placement/placement.conf api auth_strategy keystone openstack-config --set /etc/placement/placement.conf keystone_authtoken auth_url http://controller:5000/v3 openstack-config --set /etc/placement/placement.conf keystone_authtoken memcached_servers controller: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
填充placement数据库
su -s /bin/sh -c "placement-manage db sync" placement mysql placement -e 'show tables'
修改placement的apache配置文件,官方文档没有提到,如果不修改,计算服务检查时将会报错
#启用placement API访问 [root@controller ~]# vim /etc/httpd/conf.d/00-placement-api.conf ... 15 #SSLCertificateKeyFile #SSLCertificateKeyFile ... <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.service netstat -lntup|grep 8778 lsof -i:8778 #curl地址看是否能返回json curl http://controller:8778
验证检查健康状态
placement-status upgrade check