Skip to content

安装及配置Placement放置服务

安装Placement软件包

yum -y install openstack-placement-api
cat /etc/group | grep placement
cat /etc/passwd | grep placement

创建Placement数据库并授权

mysql -uroot -p000000 -e "CREATE DATABASE placement;"
mysql -uroot -p000000 -e "grant all privileges on placement.* to placement@'%' identified by '000000';"
mysql -uroot -p000000 -e "grant all privileges on placement.* to placement@localhost identified by '000000';"

修改Placement配置文件

备份

cp /etc/placement/placement.conf /etc/placement/placement.bak

去掉配置文件的所有注释和空行,生成新的配置文件

grep -Ev '^$|#' /etc/placement/placement.bak > /etc/placement/placement.conf

编辑配置文件就行编辑

vi /etc/placement/placement.conf

修改[placement_database]部分

[placement_database]
connection = mysql+pymysql://placement:000000@controller/placement

修改[keystong_authtoken],修改[api]

[keystong_authtoken]
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
username = placement
password = 000000
project_name = project
user_domain_name = Default
project_domain_name = Default
[api]
auth_strategy = keystone

修改Apache配置文件

cp /etc/httpd/conf.d/00-placement-api.conf /etc/httpd/conf.d/00-placement-api.conf.back
vi /etc/httpd/conf.d/00-placement-api.conf

在"VirtualHost"节点中添加

<Directory /usr/bin>
    <IfVersion >= 2.4>
        Require all granted
    </IfVersion>
</Directory>

查看apache版本

httpd -v

初始化Placement数据库

同步

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

检查

mysql -uroot -p000000
use placement;
show tables;

Placement组件初始化

创建Placement用户并分配角色

source admin-login
openstack user create --domain default --password 000000 placement
openstack role add --project project --user placement admin

创建Placement服务及服务端点

创建服务

openstack service create --name placement placement

创建服务端点

openstack endpoint create --region RegionOne placement public http://controller:8778
openstack endpoint create --region RegionOne placement internal http://controller:8778

创建admin用户访问的端点

openstack endpoint create --region RegionOne placement admin http://controller:8778

启动Placement服务

systemctl restart httpd.service 

检测Placement服务

查看端口占用情况

netstat -tnlup | grep 8778

检测服务端点

curl http://controller:8778

所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自linlink~文档