OpenStack Placement deployment

Placement provides placement-apiWSGI scripts for running services with Apache, nginx or other web servers that support WSGI (python entry proxy is implemented through nginx or apache).
According to the packaging solution used to deploy OpenStack, the WSGI script may be located in /usr/bin or /usr/local/bin. The
Placement service is a component separated from the S version and separated from the nova service. The function is to collect the information of each node node. Available resources, write the resource statistics of the node node to mysql, and the Placement service will be called by the nova scheduler service. The listening port of the Placement service is 8778

One, create a database instance and database user

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. Create an endpoint for Placement service users and API

  • Create placement users
openstack user create --domain default --password PLACEMENT_PASS placement
  • Give placement users admin permissions for the service project
openstack role add --project service --user placement admin
  • Create a placement service, the service type is placement
openstack service create --name placement --description "Placement API" placement
  • Register the API port to the placement service; the registered information will be written to 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

Three, install placement service

yum -y install openstack-placement-api
  • Modify placement configuration file
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
  • Import the database
su -s /bin/sh -c "placement-manage db sync" placement

Fourth, modify the Apache configuration file

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>
  • Restart apache
systemctl restart httpd

Five, test

  • curl test access
curl ct:8778
  • View port occupation (netstat, lsof)
netstat -natp | grep 8778
  • Check placement status
placement-status upgrade check

Guess you like

Origin blog.csdn.net/weixin_51614581/article/details/115024564