这是本人的一些学习笔记,如果有错误的地方或者更好的解决方法,欢迎提出!!
openstack项目的 Placement 服务是一个用于监控平台中所有硬件资源使用情况的组件。它的主要作用是跟踪资源的使用情况,并将这些资源的统计信息写入到数据库中。主要组成是它的接口模块,这个模块监控系统资源信息,也可以被其他 OpenStack 服务调用,以便能够更好地管理和分配资源。
1.安装placement服务
[root@openstack01 ~]# yum install -y openstack-placement-api
检查placement有没有成功安装
[root@openstack01 ~]# cat /etc/passwd | grep placement
placement:x:991:988:OpenStack Placement:/:/bin/bash
[root@openstack01 ~]# cat /etc/group | grep placement
placement:x:988:
2.修改placement服务的配置文件
生成备份文件
[root@openstack01 ~]# cp /etc/placement/placement.conf /etc/placement/placement.conf.bak
去除空行注释,生成新的配置文件,方便修改
[root@openstack01 ~]# grep -Ev '^$|#' /etc/placement/placement.conf.bak > /etc/placement/placement.conf
打开去除空行注释的配置文件进行修改
root@openstack01 ~]# vi /etc/placement/placement.conf
[root@openstack01 ~]# cat /etc/placement/placement.conf
[DEFAULT]
[api]
[cors]
[keystone_authtoken]
auth_url=http://openstack01:5000
memcached_servers=openstack:11211
auth_type=password
username=placement
password=000000
project_name=project
user_domain_name=Default
project_domain_name=Default
[oslo_policy]
[placement]
[placement_database]
connection=mysql+pymysql://placement:000000@openstack01/placement
[profiler]
3.修改Apache服务配置文件
在</VirtualHost>节点下加入以下代码
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
4.创建placement数据库并授权
MariaDB [(none)]> create database placement;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> grant all privileges on placement.* to 'placement'@'%' identified by '000000';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all privileges on placement.* to 'placement'@'localhost' identified by '000000';
Query OK, 0 rows affected (0.001 sec)
5.初始化placement数据库
[root@openstack01 ~]# su placement -s /bin/sh -c 'placement-manage db sync'
检查数据库是否同步成功
6.初始化placement组件
导入环境变量
[root@openstack01 ~]# . admin-login
在云计算平台中创建placement用户
[root@openstack01 ~]# openstack user create placement --domain default --password 000000
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 23e1c6b1043640d58e556aacd6338c9c |
| name | placement |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
为用户placement分配管理员角色
[root@openstack01 ~]# openstack role add admin --project project --user placement
创建placement放置服务
[root@openstack01 ~]# openstack service create --name placement placement
+---------+----------------------------------+
| Field | Value |
+---------+----------------------------------+
| enabled | True |
| id | f5648dfaaef847b4b97af7208a9c67ce |
| name | placement |
| type | placement |
+---------+----------------------------------+
创建placement对外服务端点
[root@openstack01 ~]# openstack endpoint create --region RegionOne placement public http://openstack01:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 56397a2729ff45878f1687feca4d1799 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f5648dfaaef847b4b97af7208a9c67ce |
| service_name | placement |
| service_type | placement |
| url | http://openstack01:8778 |
+--------------+----------------------------------+
创建placement对内服务端点
[root@openstack01 ~]# openstack endpoint create --region RegionOne placement internal http://openstack01:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | aa806a125cf048a78edbae55419fe32d |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f5648dfaaef847b4b97af7208a9c67ce |
| service_name | placement |
| service_type | placement |
| url | http://openstack01:8778 |
+--------------+----------------------------------+
创建placement对管理员访问的端点
[root@openstack01 ~]# openstack endpoint create --region RegionOne placement admin http://openstack01:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 0e3eb4950b344e9091df5082ad00492c |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f5648dfaaef847b4b97af7208a9c67ce |
| service_name | placement |
| service_type | placement |
| url | http://openstack01:8778 |
+--------------+----------------------------------+
7.启动placement服务
[root@openstack01 conf.d]# systemctl restart httpd
验证placement服务是否开启
[root@openstack01 conf.d]# ss -lntpu | grep 8778
tcp LISTEN 0 128 :::8778 :::* users:(("httpd",pid=15799,fd=6),("httpd",pid=15798,fd=6),("httpd",pid=15797,fd=6),("httpd",pid=15796,fd=6),("httpd",pid=15795,fd=6),("httpd",pid=15786,fd=6))
至此,openstack中的placement服务安装配置完成
标签:placement,service,--,openstack,OpenStack,openstack01,root,id From: https://blog.csdn.net/m0_75109484/article/details/140750552