OpenStack Xena : Designate 利用方法2021/11/24 |
OpenStack DNS Service(Designate)の利用方法です。
当例では以下のような環境を例に Designate をインストールしています。
------------+---------------------------+---------------------------+------------ | | | 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 | | Neutron Server | | Nova Compute | | Keystone Glance | | OVN-Northd | | Open vSwitch | | Nova API | | Cinder Volume | | OVN Metadata Agent | | Cinder API | | iSCSI Target | | OVN-Controller | | | | Designate Services | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[1] | Openstack システムを利用可能な任意のユーザーで認証して、DNS エントリを作成します。 作業は、どこでもよいですが、当例ではコントロールノード上で行います。 例として [server.education] の正引きゾーンを作成します。 |
[cent@dlp ~(keystone)]$ openstack zone create --email dnsmaster@server.education server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | CREATE | | attributes | | | created_at | 2021-11-24T07:47:49.000000 | | description | None | | email | dnsmaster@server.education | | id | 87b30616-9b03-466c-af32-0c41c1d71a46 | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 2decda8bcd724687a1cf05064ab21fdf | | serial | 1637740069 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | None | | version | 1 | +----------------+--------------------------------------+ # [status] が [ACTIVE] であれば OK [cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+-------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+-------------------+---------+------------+--------+--------+ | 87b30616-9b03-466c-af32-0c41c1d71a46 | server.education. | PRIMARY | 1637740069 | ACTIVE | NONE | +--------------------------------------+-------------------+---------+------------+--------+--------+ # A レコードを登録する [cent@dlp ~(keystone)]$ openstack recordset create --record '192.168.100.10' --type A server.education. node01 +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | action | CREATE | | created_at | 2021-11-24T07:48:15.000000 | | description | None | | id | 0e6baa20-c089-47b7-9796-37ecfeee1923 | | name | node01.server.education. | | project_id | 2decda8bcd724687a1cf05064ab21fdf | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | None | | version | 1 | | zone_id | 87b30616-9b03-466c-af32-0c41c1d71a46 | | zone_name | server.education. | +-------------+--------------------------------------+ # [status] が [ACTIVE] であれば OK [cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 1f646e3f-f6c9-444a-a2a2-53e7cd0d223a | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1637740095 3510 600 86400 3600 | ACTIVE | NONE | | b2b2a7a0-eccd-488b-9b4a-34c6e831ea68 | server.education. | NS | network.srv.world. | ACTIVE | NONE | | 0e6baa20-c089-47b7-9796-37ecfeee1923 | node01.server.education. | A | 192.168.100.10 | ACTIVE | NONE | +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ # 確認 [cent@dlp ~(keystone)]$ dig -p 5354 @network.srv.world node01.server.education. ; <<>> DiG 9.11.26-RedHat-9.11.26-6.el8 <<>> -p 5354 @network.srv.world node01.server.education. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 53877 ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 8192 ;; QUESTION SECTION: ;node01.server.education. IN A ;; ANSWER SECTION: node01.server.education. 3600 IN A 192.168.100.10 ;; Query time: 24 msec ;; SERVER: 10.0.0.50#5354(10.0.0.50) ;; WHEN: Wed Nov 24 16:48:44 JST 2021 ;; MSG SIZE rcvd: 68 |
[2] | 例として [192.168.100.0/24] の逆引きゾーンを作成します。 |
[cent@dlp ~(keystone)]$ openstack zone create --email dnsmaster@server.education 100.168.192.in-addr.arpa. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | CREATE | | attributes | | | created_at | 2021-11-24T07:49:21.000000 | | description | None | | email | dnsmaster@server.education | | id | 662a6700-5576-4a28-a8c4-273492993c54 | | masters | | | name | 100.168.192.in-addr.arpa. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 2decda8bcd724687a1cf05064ab21fdf | | serial | 1637740161 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | None | | version | 1 | +----------------+--------------------------------------+ # [status] が [ACTIVE] であれば OK [cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 87b30616-9b03-466c-af32-0c41c1d71a46 | server.education. | PRIMARY | 1637740095 | ACTIVE | NONE | | 662a6700-5576-4a28-a8c4-273492993c54 | 100.168.192.in-addr.arpa. | PRIMARY | 1637740161 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ # PTR レコードを登録する [cent@dlp ~(keystone)]$ openstack recordset create --record 'node01.server.education.' --type PTR 100.168.192.in-addr.arpa. 10 +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | action | CREATE | | created_at | 2021-11-24T07:49:52.000000 | | description | None | | id | 6c7bf71d-2729-4f30-b0c7-646de303cb06 | | name | 10.100.168.192.in-addr.arpa. | | project_id | 2decda8bcd724687a1cf05064ab21fdf | | records | node01.server.education. | | status | PENDING | | ttl | None | | type | PTR | | updated_at | None | | version | 1 | | zone_id | 662a6700-5576-4a28-a8c4-273492993c54 | | zone_name | 100.168.192.in-addr.arpa. | +-------------+--------------------------------------+ # [status] が [ACTIVE] であれば OK [cent@dlp ~(keystone)]$ openstack recordset list 100.168.192.in-addr.arpa. +--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 56bff51c-83fb-424f-9870-27defbb48158 | 100.168.192.in-addr.arpa. | SOA | network.srv.world. dnsmaster.server.education. 1637740192 3584 600 86400 3600 | ACTIVE | NONE | | d3f6d625-a7d3-49e1-954d-0091cd27a1a0 | 100.168.192.in-addr.arpa. | NS | network.srv.world. | ACTIVE | NONE | | 6c7bf71d-2729-4f30-b0c7-646de303cb06 | 10.100.168.192.in-addr.arpa. | PTR | node01.server.education. | ACTIVE | NONE | +--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+ # 確認 [cent@dlp ~(keystone)]$ dig -p 5354 @network.srv.world -x 192.168.100.10 ; <<>> DiG 9.11.26-RedHat-9.11.26-6.el8 <<>> -p 5354 @network.srv.world -x 192.168.100.10 ; (1 server found) ;; global options: +cmd ;; Got answer: ;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 57476 ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 8192 ;; QUESTION SECTION: ;10.100.168.192.in-addr.arpa. IN PTR ;; ANSWER SECTION: 10.100.168.192.in-addr.arpa. 3600 IN PTR node01.server.education. ;; Query time: 25 msec ;; SERVER: 10.0.0.50#5354(10.0.0.50) ;; WHEN: Wed Nov 24 16:50:22 JST 2021 ;; MSG SIZE rcvd: 93 |
[3] | レコードやゾーンを削除するには以下のように実行します。 |
[cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 1f646e3f-f6c9-444a-a2a2-53e7cd0d223a | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1637740095 3510 600 86400 3600 | ACTIVE | NONE | | b2b2a7a0-eccd-488b-9b4a-34c6e831ea68 | server.education. | NS | network.srv.world. | ACTIVE | NONE | | 0e6baa20-c089-47b7-9796-37ecfeee1923 | node01.server.education. | A | 192.168.100.10 | ACTIVE | NONE | +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ # [node01] レコードを削除する [cent@dlp ~(keystone)]$ openstack recordset delete server.education. node01.server.education. +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | action | DELETE | | created_at | 2021-11-24T07:48:15.000000 | | description | None | | id | 0e6baa20-c089-47b7-9796-37ecfeee1923 | | name | node01.server.education. | | project_id | 2decda8bcd724687a1cf05064ab21fdf | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | 2021-11-24T07:51:09.000000 | | version | 2 | | zone_id | 87b30616-9b03-466c-af32-0c41c1d71a46 | | zone_name | server.education. | +-------------+--------------------------------------+[cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 1f646e3f-f6c9-444a-a2a2-53e7cd0d223a | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1637740269 3510 600 86400 3600 | ACTIVE | NONE | | b2b2a7a0-eccd-488b-9b4a-34c6e831ea68 | server.education. | NS | network.srv.world. | ACTIVE | NONE | +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+[cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 87b30616-9b03-466c-af32-0c41c1d71a46 | server.education. | PRIMARY | 1637740269 | ACTIVE | NONE | | 662a6700-5576-4a28-a8c4-273492993c54 | 100.168.192.in-addr.arpa. | PRIMARY | 1637740192 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ # [server.education.] ゾーンを削除する [cent@dlp ~(keystone)]$ openstack zone delete server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | DELETE | | attributes | | | created_at | 2021-11-24T07:47:49.000000 | | description | None | | email | dnsmaster@server.education | | id | 87b30616-9b03-466c-af32-0c41c1d71a46 | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 2decda8bcd724687a1cf05064ab21fdf | | serial | 1637740269 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | 2021-11-24T07:51:53.000000 | | version | 7 | +----------------+--------------------------------------+[cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 662a6700-5576-4a28-a8c4-273492993c54 | 100.168.192.in-addr.arpa. | PRIMARY | 1637740192 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ |
Sponsored Link |