You can use PowerDNS with the MySQL backend instead of the default SQLite one if required.
Warning
If you use PowerDNS in the slave
mode, you must run MySQL
with a storage engine that supports transactions, for example,
InnoDB that is the default storage engine for MySQL
in MCP.
Using a non-transaction storage engine may negatively affect your database after some actions, such as failures in an incoming zone transfer.
For more information, see: PowerDNS documentation.
Note
While following the procedure below, replace ${node}
with a short name of the required node where applicable.
To enable the MySQL backend for PowerDNS:
Open your Reclass model Git repository.
Modify nodes/_generated/${full_host_name}.yml
, where
${full_host_name}
is the FQDN of the particular node. Add the following
classes and parameters:
classes:
...
- cluster.<cluster_name>
- system.powerdns.server.single
...
parameters:
...
powerdns:
...
server:
...
backend:
engine: mysql
host: ${_param:cluster_vip_address}
port: 3306
dbname: ${_param:mysql_powerdns_db_name}
user: ${_param:mysql_powerdns_db_name}
password: ${_param:mysql_powerdns_password}
Substitute <cluster_name>
with the appropriate value.
Warning
Do not override the cluster_vip_address
parameter.
Create a classes/system/galera/server/database/powerdns_${node}.yml
file
and add the databases to use with the MySQL backend:
parameters:
mysql:
server:
database:
powerdns_${node}:
encoding: utf8
users:
- name: ${_param:mysql_powerdns_user_name_${node}}
password: ${_param:mysql_powerdns_user_password_${node}}
host: '%'
rights: all
- name: ${_param:mysql_powerdns_user_name_${node}}
password: ${_param:mysql_powerdns_user_password_${node}}
host: ${_param:cluster_local_address}
rights: all
Add the following class to
classes/cluster/<cluster_name>/openstack/control.yml
:
classes:
...
- system.galera.server.database.powerdns_${node}
Add the MySQL parameters for Galera to
classes/cluster/<cluster_name>/openstack/init.yml
. For example:
parameters:
_param:
...
mysql_powerdns_db_name_${node}: powerdns_${node}
mysql_powerdns_user_name_${node}: pdns_slave_${node}
mysql_powerdns_user_password_${node}: ni1iX1wuf]ongiVu
Log in to the Salt Master node.
Refresh pillar information:
salt '*' saltutil.refresh_pillar
Apply the Galera states:
salt -C 'I@galera:master' state.sls galera
Proceed to deploying PowerDNS as described in Deploy a new PowerDNS server for Designate.
Optional. After you deploy PowerDNS:
NATIVE
domains, set
binlog_format
to MIXED
or ROW
to prevent differences in data
between replicated servers. For details, see:
MySQL documentation.