第 3 章 安装和配置 DNS 服务


在部署或重新部署 Red Hat OpenStack Platform (RHOSP)时,您可以通过包含指定的环境文件来安装和配置 DNS 服务(指定)。用于部署 RHOSP director 的工具集使用编排服务(heat)环境模板和环境文件作为如何安装和配置 DNS 服务以及 RHOSP 部署的其余部分的计划。

在部署 DNS 服务时,director 会自动执行这些操作,如为主动高可用性模式启用 DNS 服务,并激活端口和浮动 IP 地址的自动化。director 还将 Networking 服务(neutron)配置为指向 DNS 服务中包含的 Unbound 解析器。

注意

您可以通过在自定义 heat 环境文件中设置 UnboundForwardResolvers 来明确禁用 Unbound 解析器的配置。

您还可以通过为 director 提供必要的 DNS 服务器信息,将 DNS 服务与预先存在的 DNS 基础架构集成。

重要

在 RHOSP 17.1 中,将 DNS 服务与预先存在的 DNS 基础架构集成是一个技术预览功能。

本节中包含的主题有:

3.1. 部署 DNS 服务

您可以使用 Red Hat OpenStack Platform (RHOSP) director 部署 DNS 服务(指定)。director 使用编排服务(heat)模板和环境文件,它们是 RHOSP 部署的一组计划。undercloud 导入这些计划,并按照说明安装和配置 DNS 服务和 RHOSP 部署。

先决条件

  • 您必须是有权访问 RHOSP undercloud 的 stack 用户。

流程

  1. 如果您要将 DNS 服务器与预先存在的 DNS 基础架构集成,请访问 第 3.2 节 “使用预先存在的 BIND 9 服务器部署 DNS 服务”
  2. 以 stack 用户身份登录 undercloud 主机。
  3. 提供 undercloud 凭证文件:

    $ source ~/stackrc
    Copy to Clipboard Toggle word wrap
  4. 创建自定义环境 YAML 文件,其中包含 DesignateBindNSRecords 参数的声明,其值是位于 DNS 服务器(指定)池中的子区域的名字服务器记录(NS 记录):

    parameter_defaults:
      DesignateBindNSRecords: ['<NS_record_child-zone-1>', '<NS_record_child-zone-2>', '...']
    Copy to Clipboard Toggle word wrap

    Example

    在本例中,DNS 池包含子区域: ns1.sales.example.org.ns2.sales.example.org.、parent zone example.org. 的 ns3.sales. example.org。

    parameter_defaults:
      DesignateBindNSRecords: ['ns1.sales.example.org.', 'ns2.sales.example.org.', 'ns3.sales.example.org.']
    Copy to Clipboard Toggle word wrap
  5. 运行部署命令,并包括核心 heat 模板、其他环境文件、designate.yaml 环境文件以及包含池 NS 记录的文件。

    Example

    $ openstack overcloud deploy --templates \
    -e <other_environment_files> \
    -e /usr/share/openstack-tripleo-heat-templates/environments/\
    services/designate.yaml \
    -e /home/stack/my_pool_ns_records.yaml
    Copy to Clipboard Toggle word wrap
    注意

    director 在堆栈更新或升级过程中将各种 DNS 服务组件更新为最新的指定镜像。

验证

  • 确认 DNS 服务已安装,并且定义了端点。

    $ openstack endpoint list -c "Service Name" -c Enabled -c URL
    Copy to Clipboard Toggle word wrap

    输出示例

    +--------------+---------+-------------------------------------------------+
    | Service Name | Enabled | URL                                             |
    +--------------+---------+-------------------------------------------------+
    | swift        | True    | http://198.51.100.61:8080                       |
    | designate    | True    | http://203.0.113.103:9001                       |
    | heat-cfn     | True    | http://192.0.2.137:8000/v1                      |
    | designate    | True    | http://192.0.2.137:9001                         |
    | placement    | True    | http://203.0.113.103:8778/placement             |
    | cinderv3     | True    | http://203.0.113.103:8776/v3/%(tenant_id)s      |
    | heat         | True    | http://203.0.113.103:8004/v1/%(tenant_id)s      |
    | heat-cfn     | True    | http://203.0.113.103:8000/v1                    |
    | nova         | True    | http://203.0.113.103:8774/v2.1                  |
    | heat         | True    | http://192.0.2.137:8004/v1/%(tenant_id)s        |
    | glance       | True    | http://203.0.113.103:9292                       |
    | heat         | True    | http://203.0.113.103:8004/v1/%(tenant_id)s      |
    | glance       | True    | http://203.0.113.103:9292                       |
    | neutron      | True    | http://203.0.113.103:9696                       |
    | nova         | True    | http://192.0.2.137:8774/v2.1                    |
    | cinderv3     | True    | http://192.0.2.137:8776/v3/%(tenant_id)s        |
    | placement    | True    | http://203.0.113.103:8778/placement             |
    | keystone     | True    | http://192.168.24.17:35357                      |
    | neutron      | True    | http://192.0.2.137:9696                         |
    | nova         | True    | http://203.0.113.103:8774/v2.1                  |
    | heat-cfn     | True    | http://203.0.113.103:8000/v1                    |
    | cinderv3     | True    | http://203.0.113.103:8776/v3/%(tenant_id)s      |
    | glance       | True    | http://192.0.2.137:9292                         |
    | placement    | True    | http://192.0.2.137:8778/placement               |
    | swift        | True    | http://198.51.100.61:8080/v1/AUTH_%(tenant_id)s |
    | swift        | True    | http://192.0.2.137:8080/v1/AUTH_%(tenant_id)s   |
    | designate    | True    | http://203.0.113.103:9001                       |
    | keystone     | True    | http://192.0.2.137:5000                         |
    | neutron      | True    | http://203.0.113.103:9696                       |
    | keystone     | True    | http://203.0.113.103:5000                       |
    +--------------+---------+-------------------------------------------------+
    Copy to Clipboard Toggle word wrap

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat