1、数据库配置

  1. mysql -uroot -p123456
  2. CREATE DATABASE placement;
  3. GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY 'placement';
  4. GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY 'placement';
  5. #验证
  6. mysql -uroot -p123456 -e "show databases;"

2、创建项目

  1. openstack user create --domain default --password placement placement
  2. openstack role add --project service --user placement admin
  3. openstack service create --name placement --description "Placement API" placement
  4. openstack endpoint create --region RegionOne placement public http://controller:8778
  5. openstack endpoint create --region RegionOne placement internal http://controller:8778
  6. openstack endpoint create --region RegionOne placement admin http://controller:8778

3、安装

  1. yum install openstack-placement-api -y
  2. cp /etc/placement/placement.conf /etc/placement/placement.conf.bak
  3. sed -ri '/^[ \t]*(#|$)/d' /etc/placement/placement.conf

vim /etc/placement/placement.conf

  1. [placement_database]
  2. # ...
  3. connection = mysql+pymysql://placement:placement@controller/placement
  4. [api]
  5. # ...
  6. auth_strategy = keystone
  7. [keystone_authtoken]
  8. # ...
  9. auth_url = http://controller:5000/v3
  10. memcached_servers = controller:11211
  11. auth_type = password
  12. project_domain_name = Default
  13. user_domain_name = Default
  14. project_name = service
  15. username = placement
  16. password = placement

4、同步数据库

  1. su -s /bin/sh -c "placement-manage db sync" placement

5、重启http

  1. systemctl restart httpd

6、验证

  1. $placement-status upgrade check
  2. +----------------------------------+
  3. | Upgrade Check Results |
  4. +----------------------------------+
  5. | Check: Missing Root Provider IDs |
  6. | Result: Success |
  7. | Details: None |
  8. +----------------------------------+
  9. | Check: Incomplete Consumers |
  10. | Result: Success |
  11. | Details: None |
  12. +----------------------------------+