搜索

第 3 章 安装和配置 DNS 服务

download PDF

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

在部署 DNS 服务时,director 会自动执行此类操作,如为主动-主动高可用性模式启用 DNS 服务,并激活端口和浮动 IP 地址的自动化。director 还将网络服务(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 服务(designate)。director 使用编排服务(heat)模板和环境文件,它们是您的 RHOSP 部署的一组计划。undercloud 导入这些计划,并按照其说明安装和配置 DNS 服务和 RHOSP 部署。

先决条件

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

流程

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

    $ source ~/stackrc
  4. 创建自定义环境 YAML 文件,其中包含 DesignateBindNSRecords 参数的声明,其值为位于 DNS 服务器(designate)池中的子区域的名称服务器记录(NS 记录):

    parameter_defaults:
      DesignateBindNSRecords: ['<NS_record_child-zone-1>', '<NS_record_child-zone-2>', '...']

    示例

    在本例中,DNS 池包含子区域: ns1.sales.example.org.ns2.sales.example.org.ns3.sales.example.org. 用于父区 example.org。

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

    示例

    $ 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

    注意

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

验证

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

    $ openstack endpoint list -c "Service Name" -c Enabled -c URL

    输出示例

    +--------------+---------+-------------------------------------------------+
    | 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                       |
    +--------------+---------+-------------------------------------------------+

其他资源

  • 使用 director 安装和管理 Red Hat OpenStack Platform 指南中的 部署命令选项
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.