CentOS 7
Sponsored Link

OpenStack Rocky : Designate 設定#22018/09/04

 
OpenStack DNS Service(Designate)をインストールします。
当例では以下のような環境を例に Designate をインストールします。
Network ノードに Designate サービス一式をインストールし、バックエンドの DNS サービスとして BIND 9 を設定します。 BIND 9 以外にも PowerDNS などもバックエンド DNS として利用可能です。
------------+---------------------------+---------------------------+------------
            |                           |                           |
        eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
+-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|    [ Control Node ]   |   |    [ Network Node ]   |   |    [ Compute Node ]   |
|                       |   |                       |   |                       |
|  MariaDB    RabbitMQ  |   |      Open vSwitch     |   |        Libvirt        |
|  Memcached  httpd     |   |        L2 Agent       |   |     Nova Compute      |
|  Keystone   Glance    |   |        L3 Agent       |   |      Open vSwitch     |
|  Nova API             |   |     Metadata Agent    |   |        L2 Agent       |
|  Neutron Server       |   |     Cinder Volume     |   |                       |
|  Metadata Agent       |   |   Heat API   API-CFN  |   |                       |
|  Cinder API           |   |   Heat Engine  Named  |   |                       |
|                       |   |   Designate Services  |   |                       |
+-----------------------+   +-----------------------+   +-----------------------+

[1] Designate サービス および BIND 9 をインストールします。
# Rocky, EPEL からインストール

[root@network ~]#
yum --enablerepo=centos-openstack-rocky,epel -y install openstack-designate-api openstack-designate-central openstack-designate-worker openstack-designate-producer openstack-designate-mdns python-designateclient bind bind-utils
[2] Designate から BIND が利用できるよう設定しておきます。
[root@network ~]#
rndc-confgen -a -k designate -c /etc/designate.key -r /dev/urandom

wrote key file "/etc/designate.key"
[root@network ~]#
chown named:designate /etc/designate.key

[root@network ~]#
chmod 640 /etc/designate.key

[root@network ~]#
mv /etc/named.conf /etc/named.conf.org

[root@network ~]#
vi /etc/named.conf
# 新規作成

options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { none; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        # クエリの許可範囲は自身の環境に合わせて置き換え
        allow-query     { localhost; 10.0.0.0/24; };
        allow-new-zones yes;
        request-ixfr no;
        recursion no;
        bindkeys-file "/etc/named.iscdlv.key";
        managed-keys-directory "/var/named/dynamic";
        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};
include "/etc/designate.key";
controls {
    inet 0.0.0.0 port 953
    allow { localhost; } keys { "designate"; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
zone "." IN {
        type hint;
        file "named.ca";
};

[root@network ~]#
chmod 640 /etc/named.conf

[root@network ~]#
chgrp named /etc/named.conf

[root@network ~]#
chown -R named. /var/named

[root@network ~]#
systemctl start named

[root@network ~]#
systemctl enable named

[3] Designate の設定です。
[root@network ~]#
mv /etc/designate/designate.conf /etc/designate/designate.conf.org

[root@network ~]#
vi /etc/designate/designate.conf
# 新規作成

[DEFAULT]
log_dir = /var/log/designate
# RabbitMQ 接続情報
transport_url = rabbit://openstack:password@10.0.0.30
root_helper = sudo designate-rootwrap /etc/designate/rootwrap.conf

[database]
# MariaDB 接続情報
connection = mysql+pymysql://designate:password@10.0.0.30/designate

[service:api]
listen = 0.0.0.0:9001
auth_strategy = keystone
api_base_uri = http://10.0.0.50:9001
enable_api_v2 = True
enabled_extensions_v2 = quotas, reports

# Keystone 認証情報
[keystone_authtoken]
www_authenticate_uri = http://10.0.0.30:5000
auth_url = http://10.0.0.30:5000
memcached_servers = 10.0.0.30:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = designate
password = servicepassword

[service:worker]
enabled = True
notify = True

[storage:sqlalchemy]
# MariaDB 接続情報
connection = mysql+pymysql://designate:password@10.0.0.30/designate

[root@network ~]#
chmod 640 /etc/designate/designate.conf

[root@network ~]#
chgrp designate /etc/designate/designate.conf

[root@network ~]#
su -s /bin/sh -c "designate-manage database sync" designate

[root@network ~]#
systemctl start designate-central designate-api

[root@network ~]#
systemctl enable designate-central designate-api
[root@network ~]#
vi /etc/designate/pools.yaml
# 新規作成 (ホスト名や IPアドレスは自身の環境に合わせて置き換え)

- name: default
  description: Default Pool
  attributes: {}
  ns_records:
    - hostname: network.srv.world.
      priority: 1
  nameservers:
    - host: 10.0.0.50
      port: 53
  targets:
    - type: bind9
      description: BIND9 Server
      masters:
        - host: 10.0.0.50
          port: 5354
      options:
        host: 10.0.0.50
        port: 53
        rndc_host: 10.0.0.50
        rndc_port: 953
        rndc_key_file: /etc/designate.key

[root@network ~]#
chmod 640 /etc/designate/pools.yaml

[root@network ~]#
chgrp designate /etc/designate/pools.yaml

[root@network ~]#
su -s /bin/sh -c "designate-manage pool update" designate

Updating Pools Configuration
[root@network ~]#
systemctl start designate-worker designate-producer designate-mdns

[root@network ~]#
systemctl enable designate-worker designate-producer designate-mdns
[4] SELinux を有効にしている場合は、ポリシーの変更が必要です。
[root@network ~]#
setsebool -P named_write_master_zones on

[5] Firewalld を有効にしている場合は、サービスポートの許可が必要です。
[root@network ~]#
firewall-cmd --add-service=dns --permanent

[root@network ~]#
firewall-cmd --add-port={5354/tcp,9001/tcp} --permanent

success
[root@network ~]#
firewall-cmd --reload

success
[6] Openstack に認証可能な任意のノードでステータスを確認します。全て [up] 状態であれば OK です。
[root@dlp ~(keystone)]#
openstack dns service list

+--------------------------------------+-------------------+--------------+--------+-------+--------------+
| id                                   | hostname          | service_name | status | stats | capabilities |
+--------------------------------------+-------------------+--------------+--------+-------+--------------+
| ded12d58-408e-4c91-bc62-237050fc44ec | network.srv.world | api          | UP     | -     | -            |
| ed805afa-de1e-46f0-93a7-6117527dc51e | network.srv.world | central      | UP     | -     | -            |
| 8012d120-03c5-4687-aae2-1a443eda614f | network.srv.world | producer     | UP     | -     | -            |
| 9a6bc4e3-df28-40b6-bf23-5871f28484a8 | network.srv.world | worker       | UP     | -     | -            |
| a59c4ba5-d38c-45ae-927f-3fc37d16cf20 | network.srv.world | mdns         | UP     | -     | -            |
+--------------------------------------+-------------------+--------------+--------+-------+--------------+
関連コンテンツ