OpenStack Caracal : Designate 設定 (Network ノード)2024/05/23 |
OpenStack DNS Service(Designate)をインストールします。
当例では以下のような環境を例に Designate をインストールします。 ------------+--------------------------+--------------------------+------------ | | | eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] | | (Control Node) | | (Network Node) | | (Compute Node) | | | | | | | | MariaDB RabbitMQ | | Neutron L2/L3 Agent | | Libvirt | | Memcached Nginx | | Neutron Metadata | | Nova Compute | | Keystone httpd | | Open vSwitch | | Neutron L2 Agent | | Glance Nova API | | iSCSI Target | | Open vSwitch | | Neutron Server | | Cinder Volume | | | | Neutron Metadata | | Designate Services | | | | Cinder API | | | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[1] | Designate サービス および BIND 9 をインストールします。 |
root@network:~# apt -y install designate-api designate-central designate-worker designate-producer designate-mdns python3-designateclient bind9 bind9utils nginx libnginx-mod-stream
|
[2] | Designate から BIND が利用できるよう設定しておきます。 |
root@network:~# rndc-confgen -a -k designate -c /etc/bind/designate.key wrote key file "/etc/bind/designate.key" root@network:~# chown bind:designate /etc/bind/designate.key root@network:~# chmod 640 /etc/bind/designate.key root@network:~# mv /etc/bind/named.conf.options /etc/bind/named.conf.options.org
root@network:~#
vi /etc/bind/named.conf.options // 新規作成
options {
directory "/var/cache/bind";
listen-on port 53 { any; };
listen-on-v6 port 53 { none; };
// クエリの許可範囲は自身の環境に合わせて置き換え
allow-query { localhost; 10.0.0.0/24; };
allow-new-zones yes;
request-ixfr no;
recursion no;
dnssec-validation auto;
auth-nxdomain no;
};
include "/etc/bind/designate.key";
controls {
inet 0.0.0.0 port 953
allow { localhost; } keys { "designate"; };
};
chmod 644 /etc/bind/named.conf.options root@network:~# chown -R bind:bind /etc/bind root@network:~# systemctl restart bind9 |
[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@dlp.srv.world:5672 root_helper = sudo designate-rootwrap /etc/designate/rootwrap.conf [database] # MariaDB 接続情報 connection = mysql+pymysql://designate:password@dlp.srv.world:3306/designate [service:api] listen = 127.0.0.1:9001 auth_strategy = keystone api_base_uri = https://network.srv.world:9001 enable_api_v2 = True enabled_extensions_v2 = quotas, reports # Keystone 認証情報 [keystone_authtoken] www_authenticate_uri = https://dlp.srv.world:5000 auth_url = https://dlp.srv.world:5000 memcached_servers = dlp.srv.world:11211 auth_type = password project_domain_name = Default user_domain_name = Default project_name = service username = designate password = servicepassword # Apache2 Keystone で自己署名の証明書を使用の場合は [true] insecure = false [service:worker] enabled = True notify = True [storage:sqlalchemy] # MariaDB 接続情報 connection = mysql+pymysql://designate:password@dlp.srv.world:3306/designate [oslo_policy] enforce_new_defaults = true 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 restart 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/bind/designate.key 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 restart designate-worker designate-producer designate-mdns root@network:~# systemctl enable designate-worker designate-producer designate-mdns
|
[4] | ネットワークノード用の SSL/TLS 証明書を取得 または 自己署名の証明書を作成して、Nginx にプロキシの設定をします。 |
root@network:~# unlink /etc/nginx/sites-enabled/default
root@network:~#
vi /etc/nginx/nginx.conf # 最終行に追記 stream { upstream designate-api { server 127.0.0.1:9001; } server { listen 10.0.0.50:9001 ssl; proxy_pass designate-api; } ssl_certificate "/etc/letsencrypt/live/network.srv.world/fullchain.pem"; ssl_certificate_key "/etc/letsencrypt/live/network.srv.world/privkey.pem"; } systemctl restart nginx |
[5] | Openstack に認証可能な任意のノードでステータスを確認します。全て [up] 状態であれば OK です。 |
root@dlp ~(keystone)#
root@dlp ~(keystone)# apt -y install python3-designateclient openstack dns service list +--------------+--------------+--------------+--------+-------+--------------+ | id | hostname | service_name | status | stats | capabilities | +--------------+--------------+--------------+--------+-------+--------------+ | 7382fbbc- | network.srv. | central | UP | - | - | | c7d4-40dc- | world | | | | | | 88c9- | | | | | | | 28262d86cb47 | | | | | | | 38453309- | network.srv. | api | UP | - | - | | d0be-41bb-af | world | | | | | | 3d- | | | | | | | 34e65c7b5874 | | | | | | | 2a761f64- | network.srv. | mdns | UP | - | - | | 37bd-4f28- | world | | | | | | 9e86- | | | | | | | 0f9a316259f3 | | | | | | | 6e0cad06- | network.srv. | worker | UP | - | - | | 187b-4a44- | world | | | | | | bfbd- | | | | | | | 3d3b57888f98 | | | | | | | c366e5c9- | network.srv. | producer | UP | - | - | | ff48-4a66- | world | | | | | | acc7- | | | | | | | 1664376b1606 | | | | | | +--------------+--------------+--------------+--------+-------+--------------+ |
Sponsored Link |