OpenStack T版-Placement组件部署

Controller节点配置

创建数据库和授权用户

创建数据库

[root@controller ~]# mysql -uroot -p000000
MariaDB [(none)]> CREATE DATABASE placement;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY '000000';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY '000000'; 
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit

 

创建用户服务和API的endpoint

创建用户服务

[root@controller ~]# openstack user create --domain default --password 000000 placement
#创建placement用户
[root@controller ~]# openstack role add --project service --user placement admin
#给与placement用户对service项目拥有admin权限
[root@controller ~]# openstack service create --name placement --description "Placement API" placement
#创建一个placement服务,服务类型为placement

创建API的endpoint

三种API端点代表三种服务:admin、internal、public

[root@controller ~]# openstack endpoint create --region RegionOne placement public http://controller:8778
[root@controller ~]# openstack endpoint create --region RegionOne placement internal http://controller:8778
[root@controller ~]# openstack endpoint create --region RegionOne placement admin http://controller:8778

 

安装 openstack-placement 软件包

[root@controller ~]# yum -y install openstack-placement-api

 

编辑配置文件

编辑placement.conf

[root@controller ~]# cp /etc/placement/placement.conf{,.bak}
#在保留源文件属性的前提下进行批量复制
[root@controller ~]# grep -Ev '^$|#' /etc/placement/placement.conf.bak > /etc/placement/placement.conf
#对placement.conf.bak反向过滤掉空格和注释项,覆盖到placement.conf
[root@controller ~]# vi /etc/placement/placement.conf
[DEFAULT]
[api]
auth_strategy = keystone          #指定keystone地址

[cors]
[keystone_authtoken]
auth_url = http://controller:5000/v3
memcached_servers = controller:11211        #session信息是缓存放到了memcached中
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = placement
password = 000000

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

[profiler]
:wq

导入数据库

[root@controller ~]# su -s /bin/sh -c "placement-manage db sync" placement

编辑00placementapi.conf

[root@controller ~]# vi /etc/httpd/conf.d/00-placement-api.conf
最底部添加
<Directory /usr/bin>    #此处是bug,必须添加下面的配置来启用对placement api的访问,否则在访问apache的
<IfVersion >= 2.4>      #api时会报403;添加在文件的最后即可
Require all granted
</IfVersion>
<IfVersion < 2.4>       #apache版本;允许apache访问/usr/bin目录;否则/usr/bin/placement-api将不允许被访问
Order allow,deny 
Allow from all #允许apache访问
</IfVersion>
<Directory /usr/bin>
:wq

重启http服务

[root@controller ~]# systemctl enable httpd
[root@controller ~]# systemctl restart httpd

 

验证服务

curl测试访问

[root@controller ~]# curl controller:8778

查看端口占用状态

[root@controller ~]# netstat -natp | grep 8778

检查placement状态

[root@controller ~]# placement-status upgrade check

作者: 红烧悠鸽
本文采用 CC BY-NC-SA 4.0 协议
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇