Menginstal dan mengkonfigurasi controller node.

Menginstal dan mengkonfigurasi controller node.

Bagian ini menjelaskan cara menginstal dan mengkonfigurasi layanan Block Storage , code-named cinder, pada controller node. Layanan ini memerlukan setidaknya satu node storage tambahan yang memberikan volume untuk instance.

Prasyarat

Sebelum Anda menginstal dan mengkonfigurasi layanan Block Storage, Anda harus membuat database, kredensial layanan, dan API endpoint.

  1. Untuk membuat database, lengkapi langkah-langkah berikut ini:

    • Gunakan klien akses database untuk menghubungkan ke server database sebagai root user:

      $ mysql -u root -p
      
    • Buat cinder database:

      MariaDB [(none)]> CREATE DATABASE cinder;
      
    • Berikan akses yang tepat untuk cinder database:

      MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
        IDENTIFIED BY 'CINDER_DBPASS';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \
        IDENTIFIED BY 'CINDER_DBPASS';
      

      Ganti CINDER_DBPASS cinder dengan password yang sesuai.

    • Keluar dari klien akses database.

  2. Dapatkan sumber `admin credential untuk akses ke admin-only CLI commands:

    $ . admin-openrc
    
  3. Untuk membuat kredensial layanan, menyelesaikan langkah-langkah ini:

    • Buat cinder user:

      $ openstack user create --domain default --password-prompt cinder
      
      User Password:
      Repeat User Password:
      +---------------------+----------------------------------+
      | Field               | Value                            |
      +---------------------+----------------------------------+
      | domain_id           | default                          |
      | enabled             | True                             |
      | id                  | 9d7e33de3e1a498390353819bc7d245d |
      | name                | cinder                           |
      | options             | {}                               |
      | password_expires_at | None                             |
      +---------------------+----------------------------------+
      
    • Tambahkan peran admin ke cinder user:

      $ openstack role add --project service --user cinder admin
      

      Catatan

      Command ini tidak memberikan output.

    • Buat entitas layanan cinderv2 dan cinderv3:

      $ openstack service create --name cinderv2 \
        --description "OpenStack Block Storage" volumev2
      
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | OpenStack Block Storage          |
      | enabled     | True                             |
      | id          | eb9fd245bdbc414695952e93f29fe3ac |
      | name        | cinderv2                         |
      | type        | volumev2                         |
      +-------------+----------------------------------+
      
      $ openstack service create --name cinderv3 \
        --description "OpenStack Block Storage" volumev3
      
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | OpenStack Block Storage          |
      | enabled     | True                             |
      | id          | ab3bbbef780845a1a283490d281e7fda |
      | name        | cinderv3                         |
      | type        | volumev3                         |
      +-------------+----------------------------------+
      

    Catatan

    Layanan Block Storage memerlukan dua entitas layanan.

  4. Buat layanan Block Storage API endpoint:

    $ openstack endpoint create --region RegionOne \
      volumev2 public http://controller:8776/v2/%\(project_id\)s
    
    +--------------+------------------------------------------+
    | Field        | Value                                    |
    +--------------+------------------------------------------+
    | enabled      | True                                     |
    | id           | 513e73819e14460fb904163f41ef3759         |
    | interface    | public                                   |
    | region       | RegionOne                                |
    | region_id    | RegionOne                                |
    | service_id   | eb9fd245bdbc414695952e93f29fe3ac         |
    | service_name | cinderv2                                 |
    | service_type | volumev2                                 |
    | url          | http://controller:8776/v2/%(project_id)s |
    +--------------+------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      volumev2 internal http://controller:8776/v2/%\(project_id\)s
    
    +--------------+------------------------------------------+
    | Field        | Value                                    |
    +--------------+------------------------------------------+
    | enabled      | True                                     |
    | id           | 6436a8a23d014cfdb69c586eff146a32         |
    | interface    | internal                                 |
    | region       | RegionOne                                |
    | region_id    | RegionOne                                |
    | service_id   | eb9fd245bdbc414695952e93f29fe3ac         |
    | service_name | cinderv2                                 |
    | service_type | volumev2                                 |
    | url          | http://controller:8776/v2/%(project_id)s |
    +--------------+------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      volumev2 admin http://controller:8776/v2/%\(project_id\)s
    
    +--------------+------------------------------------------+
    | Field        | Value                                    |
    +--------------+------------------------------------------+
    | enabled      | True                                     |
    | id           | e652cf84dd334f359ae9b045a2c91d96         |
    | interface    | admin                                    |
    | region       | RegionOne                                |
    | region_id    | RegionOne                                |
    | service_id   | eb9fd245bdbc414695952e93f29fe3ac         |
    | service_name | cinderv2                                 |
    | service_type | volumev2                                 |
    | url          | http://controller:8776/v2/%(project_id)s |
    +--------------+------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      volumev3 public http://controller:8776/v3/%\(project_id\)s
    
    +--------------+------------------------------------------+
    | Field        | Value                                    |
    +--------------+------------------------------------------+
    | enabled      | True                                     |
    | id           | 03fa2c90153546c295bf30ca86b1344b         |
    | interface    | public                                   |
    | region       | RegionOne                                |
    | region_id    | RegionOne                                |
    | service_id   | ab3bbbef780845a1a283490d281e7fda         |
    | service_name | cinderv3                                 |
    | service_type | volumev3                                 |
    | url          | http://controller:8776/v3/%(project_id)s |
    +--------------+------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      volumev3 internal http://controller:8776/v3/%\(project_id\)s
    
    +--------------+------------------------------------------+
    | Field        | Value                                    |
    +--------------+------------------------------------------+
    | enabled      | True                                     |
    | id           | 94f684395d1b41068c70e4ecb11364b2         |
    | interface    | internal                                 |
    | region       | RegionOne                                |
    | region_id    | RegionOne                                |
    | service_id   | ab3bbbef780845a1a283490d281e7fda         |
    | service_name | cinderv3                                 |
    | service_type | volumev3                                 |
    | url          | http://controller:8776/v3/%(project_id)s |
    +--------------+------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      volumev3 admin http://controller:8776/v3/%\(project_id\)s
    
    +--------------+------------------------------------------+
    | Field        | Value                                    |
    +--------------+------------------------------------------+
    | enabled      | True                                     |
    | id           | 4511c28a0f9840c78bacb25f10f62c98         |
    | interface    | admin                                    |
    | region       | RegionOne                                |
    | region_id    | RegionOne                                |
    | service_id   | ab3bbbef780845a1a283490d281e7fda         |
    | service_name | cinderv3                                 |
    | service_type | volumev3                                 |
    | url          | http://controller:8776/v3/%(project_id)s |
    +--------------+------------------------------------------+
    

    Catatan

    Layanan Block Storage memerlukan endpoint untuk setiap entitas layanan.

Menginstal dan mengkonfigurasi komponen

  1. Instal paket:

    # yum install openstack-cinder
    
  1. Edit file /etc/cinder/cinder.conf dan menyelesaikan tindakan berikut:

    • Dalam bagian `` [Database] ``, konfigurasi akses database:

      [database]
      # ...
      connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
      

      Ganti CINDER_DBPASS dengan password yang Anda pilih untuk database Block Storage.

    • Dalam bagian [DEFAULT], lakukan konfigurasi akses antrian pesan RabbitMQ:

      [DEFAULT]
      # ...
      transport_url = rabbit://openstack:RABBIT_PASS@controller
      

      Ganti RABBIT_PASS dengan password yang Anda pilih untuk akun openstack di `` RabbitMQ``.

    • Dalam bagian ``[DEFAULT] `` dan `` [keystone_authtoken] ``, konfigurasi akses layanan Identity:

      [DEFAULT]
      # ...
      auth_strategy = keystone
      
      [keystone_authtoken]
      # ...
      auth_uri = http://controller:5000
      auth_url = http://controller:35357
      memcached_servers = controller:11211
      auth_type = password
      project_domain_name = default
      user_domain_name = default
      project_name = service
      username = cinder
      password = CINDER_PASS
      

      Ganti CINDER_PASS dengan password yang Anda pilih untuk cinder user dalam pelayanan Identity.

      Catatan

      Hilangkan komentar atau bahkan hapus pilihan lainnya dalam bagian ``[keystone_authtoken] ``.

    • Dalam bagian [DEFAULT] ``, konfigurasi opsi ``my_ip menggunakan management interface alamat IP dari controller node:

      [DEFAULT]
      # ...
      my_ip = 10.0.0.11
      
    • Dalam bagian [oslo_concurrency], konfigurasi lock path:

      [oslo_concurrency]
      # ...
      lock_path = /var/lib/cinder/tmp
      
  1. Isi database Block Storage:

    # su -s /bin/sh -c "cinder-manage db sync" cinder
    

    Catatan

    Abaikan pesan bantahan dalam output ini.

Konfigurasi Compute menggunakan Block Storage

  • Edit file /etc/nova/nova.conf dan tambahkan berikut untuk itu:

    [cinder]
    os_region_name = RegionOne
    

Finalisasi instalasi

  1. Restart layanan Compute API:

    # systemctl restart openstack-nova-api.service
    
  2. Mulai layanan Block Storage dan mengkonfigurasi mereka untuk mulai booting:

    # systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
    # systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.