OpenStack stein安装(四)placement
admin
2023-03-13 04:41:07
0

  placement服务提供一个HTTP API,用于跟踪资源提供者清单和使用情况。placement作为数据模型上的web服务进行操作。安装包括创建必要的数据库以及安装和配置web服务。这是一个简单的过程,但是要将placement与OpenStack云的其余部分集成起来,有相当多的步骤。
  其他一些OpenStack服务(尤其是nova)需要安装placement,因此应该在其他服务之前安装placement,而在Identity (keystone)之后安装placement。

安装准备

安装配置placement服务之前,建库等。

  1. 建立数据库

    1. 完成下列建库操作:
        ○ 使用root用户登录:
            $ mysql -u root -p root123 
        ○ 建立placement database:
            MariaDB [(none)]> CREATE DATABASE placement;
        ○ Grant proper access to the database:
            MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%'  IDENTIFIED BY 'placement123';
    
    2. Configure User and Endpoints
        1. Source the admin credentials to gain access to admin-only CLI commands:
            $ . admin-openrc
        2. Create a Placement service user using your chosen PLACEMENT_PASS:
            $ openstack user create --domain default --password-prompt placement
    
            User Password:placement123
            Repeat User Password:placement123
            +---------------------+----------------------------------+
            | Field               | Value                            |
            +---------------------+----------------------------------+
            | domain_id           | default                          |
            | enabled             | True                             |
            | id                  | fa742015a6494a949f67629884fc7ec8 |
            | name                | placement                        |
            | options             | {}                               |
            | password_expires_at | None                             |
            +---------------------+----------------------------------+
        3. Add the Placement user to the service project with the admin role:
            $ openstack role add --project service --user placement admin
     
        4. Create the Placement API entry in the service catalog:
            $ openstack service create --name placement \
              --description "Placement API" placement
    
            +-------------+----------------------------------+
            | Field       | Value                            |
            +-------------+----------------------------------+
            | description | Placement API                    |
            | enabled     | True                             |
            | id          | 2d1a27022e6e4185b86adac4444c495f |
            | name        | placement                        |
            | type        | placement                        |
            +-------------+----------------------------------+
        5. Create the Placement API service endpoints:
            注意:域名为你规划好url, 必须能够解析.
            $ openstack endpoint create --region RegionOne placement public http://stack.flex.net:8778
            +--------------+----------------------------------+
            | Field        | Value                            |
            +--------------+----------------------------------+
            | enabled      | True                             |
            | id           | 2b1b2637908b4137a9c2e0470487cbc0 |
            | interface    | public                           |
            | region       | RegionOne                        |
            | region_id    | RegionOne                        |
            | service_id   | 2d1a27022e6e4185b86adac4444c495f |
            | service_name | placement                        |
            | service_type | placement                        |
            | url          | http://controller:8778           |
            +--------------+----------------------------------+
    
            $ openstack endpoint create --region RegionOne placement internal http://stack.flex.net:8778
            +--------------+----------------------------------+
            | Field        | Value                            |
            +--------------+----------------------------------+
            | enabled      | True                             |
            | id           | 02bcda9a150a4bd7993ff4879df971ab |
            | interface    | internal                         |
            | region       | RegionOne                        |
            | region_id    | RegionOne                        |
            | service_id   | 2d1a27022e6e4185b86adac4444c495f |
            | service_name | placement                        |
            | service_type | placement                        |
            | url          | http://controller:8778           |
            +--------------+----------------------------------+
    
            $ openstack endpoint create --region RegionOne placement admin http://stack.flex.net:8778
            +--------------+----------------------------------+
            | Field        | Value                            |
            +--------------+----------------------------------+
            | enabled      | True                             |
            | id           | 3d71177b9e0f406f98cbff198d74b182 |
            | interface    | admin                            |
            | region       | RegionOne                        |
            | region_id    | RegionOne                        |
            | service_id   | 2d1a27022e6e4185b86adac4444c495f |
            | service_name | placement                        |
            | service_type | placement                        |
            | url          | http://controller:8778           |
            +--------------+----------------------------------+
    安装配置组件
  2. Install the packages:
    # yum install openstack-placement-api
  3. Edit the /etc/placement/placement.conf file and complete the following actions:

    ○ In the [placement_database] section, configure database access:
        [placement_database]
        # ...
        connection = mysql+pymysql://placement:placement123@dbs.flex.net/placement
    ○ In the [api] and [keystone_authtoken] sections, configure Identity service access:
        [api]
        # ...
        auth_strategy = keystone
    
        [keystone_authtoken]
        # ...
        auth_url = http://stack.flex.net:5000/v3
        memcached_servers = dbs.flex.net:11211
        auth_type = password
        project_domain_name = default
        user_domain_name = default
        project_name = service
        username = placement
        password = placement123
    
        注意: 注释或移除在掉在[keystone_authtoken]区域中的其它的选项
  4. Populate the placement database:
    # su -s /bin/sh -c "placement-manage db sync" placement
    完成完装
    ○ Restart the httpd service:
        # systemctl restart httpd
    校验安装

    你需要admin的权限验证

  5. 加载admin的访问凭据,执行管理员命令:
    $ . admin-openrc
  6. 执行状态检查命令:
    $ placement-status upgrade check
    +----------------------------------+
    | Upgrade Check Results            |
    +----------------------------------+
    | Check: Missing Root Provider IDs |
    | Result: Success                  |
    | Details: None                    |
    +----------------------------------+
    | Check: Incomplete Consumers      |
    | Result: Success                  |
    | Details: None                    |
    +----------------------------------+
  7. 运行对placement API的命令(这个步骤我没有成功,但不影响):

    ○ Install the osc-placement plugin:
        $ pip install osc-placement
    ○ List available resource classes and traits:
        $ openstack --os-placement-api-version 1.2 resource class list --sort-column name
        +----------------------------+
        | name                       |
        +----------------------------+
        | DISK_GB                    |
        | IPV4_ADDRESS               |
        | ...                        |
    
        $ openstack --os-placement-api-version 1.6 trait list --sort-column name
        +---------------------------------------+
        | name                                  |
        +---------------------------------------+
        | COMPUTE_DEVICE_TAGGING                |
        | COMPUTE_NET_ATTACH_INTERFACE          |
        | ...                                   |

相关内容

热门资讯

为190元“仅退款”榴莲千里讨... 极目新闻记者 王鹏因为一笔190元的恶意“仅退款”订单,卖家自掏5000余元,驱车1600公里赴山东...
“AI智能回答”误称律师“被判... 据澎湃新闻报道,南京执业律师李小亮发现,在百度手机App、百度网站搜索其个人姓名+职务时,百度“AI...
年初铺的草皮五一咋又铲除?自然... 江西省上饶市的周先生近日向华商报大风新闻反映:今年五一假期时,他注意到上饶市广丰区北河滨路芦林街道源...
浏阳烟花厂爆炸事故4名重症患者... 截至今天(9日)上午11时,浏阳烟花厂爆炸事故在院患者42人,原5名重症患者中4人已转为轻症;在院患...
中东战火不断,为何全球股市不跌... 最近与一位美国学者交流,他讲到一个颇有意味的场景:在华尔街一场交流中,包括他在内的3位国际问题研究专...
景区回应“母亲节穿旗袍免费入园... 近日,南京天生桥景区推出的母亲节当天女士穿旗袍免费入园活动引发争议,有人认为母亲节女士穿旗袍活动,策...
一本正经胡说八道,谁为AI幻觉... AI幻觉频发,误导用户、毁损名誉的责任,该由谁来承担?南京律师李小亮在百度上搜索自己的信息,结果百度...
老人在直播间疯狂刷火箭 周佳欣、郑凯丹、朱娅、蒋婉、黄铃、王佳、李婉晴/文64岁的王雅达又往直播间里刷了一枚“火箭”。屏幕上...
汉坦病毒阳性乘客在乌斯怀亚港登... 自世卫组织(WHO)5月6日公布荷兰泛海探险公司(Oceanwide Expeditions)旗下极...
冰箱不制冷的原因有哪几种 冰箱的电压在正常的情况下,压缩机没有正常的运转,而且有噪声和旋转的声音,压缩机一旦出现故障,冰箱就会...