从 Liberty 升级到 Mitaka¶
池配置¶
我们更新了池配置数据存储的方式。
之前,配置内容分散在 designate.conf 文件和 designate 数据库中。
在 Mitaka 中,我们将所有数据都迁移到了数据库,以避免混淆,并避免配置文件中存在的巨大复杂性。
警告
升级的这一部分 需要停机时间。
我们提供了两个新的 designate-manage 工具命令,可以协助迁移。
为了使配置语法更简单,我们使用基于 YAML 的新配置文件来将信息加载到数据库中。
---
- name: default
# The name is immutable. There will be no option to change the name after
# creation and the only way will to change it will be to delete it
# (and all zones associated with it) and recreate it.
description: Default PowerDNS Pool
# Attributes are Key:Value pairs that describe the pool. for example the level
# of service (i.e. service_tier:GOLD), capabilities (i.e. anycast: true) or
# other metadata. Users can use this information to point their zones to the
# correct pool
attributes: {}
# List out the NS records for zones hosted within this pool
ns_records:
- hostname: ns1-1.example.org.
priority: 1
- hostname: ns1-2.example.org.
priority: 2
# List out the nameservers for this pool. These are the actual PowerDNS
# servers. We use these to verify changes have propagated to all nameservers.
nameservers:
- host: 192.0.2.2
port: 53
# List out the targets for this pool. For PowerDNS, this is the database
# (or databases, if you deploy a separate DB for each PowerDNS server)
targets:
- type: powerdns
description: PowerDNS Database Cluster
# List out the designate-mdns servers from which PowerDNS servers should
# request zone transfers (AXFRs) from.
masters:
- host: 192.0.2.1
port: 5354
# PowerDNS Configuration options
options:
host: 192.0.2.2
port: 53
connection: 'mysql+pymysql://designate:password@127.0.0.1/designate_pdns?charset=utf8'
# Optional list of additional IP/Port's for which designate-mdns will send
# DNS NOTIFY packets to
also_notifies:
- host: 192.0.2.4
port: 53
# Optional configuration to provide a catalog zone for the pool's zones.
# If configured, catalog_zone_fqdn is required and all other keys are
# optional.
catalog_zone:
catalog_zone_fqdn: cat.example.org.
catalog_zone_refresh: 60
# TSIG secret and algorithm to use for securing AXFRs for catalog zones.
catalog_zone_tsig_key: SomeSecretKey
catalog_zone_tsig_algorithm: hmac-sha512
我们提供了一个命令,允许您获取当前运行的配置,并将其导出为新的 YAML 格式。
注意
您需要至少运行一个 central 实例,并且运行 designate-manage 的机器需要访问消息队列
designate-manage pool generate_file --file output.yml
这将创建一个 YAML 文件,其中包含所有当前定义的池及其所有配置。
我们建议将其迁移到配置管理系统或其他文档管理系统。
从现在开始,所有池的更新都应通过更新此文件并运行来完成
designate-manage pool update --file /path/to/file.yml
池 - 逐步指南¶
确保没有两个名称相同的池。
停止所有 Designate 服务。
部署新的 Mitaka 代码
启动
designate-central- 运行
designate-manage pool export_from_config --file output.yml
确保输出文件正确(参考每个值的示例文件)
运行
designate-manage pool update --file output.yml --dry_run True --delete True确保此命令的输出没有删除任何池
运行
designate-manage pool update --file output.yml --delete True启动剩余的 designate 服务。