Chapter 2. Installing DNSaaS for High Availability
This chapter describes how to install DNSaaS (designate) in a high availability configuration. In this configuration the DNSaaS service is installed on a primary node, and it configuration is replicated to secondary nodes. The high availability service is performed by redis, allowing a secondary node to take over in the event of a failure on the primary node. Note that memcached is not supported as the High Availability back-end.
DNS-as-a-Service (DNSaaS), also known as Designate, is available in this release as a Technology Preview, and therefore is not fully supported by Red Hat. If you are interested in running DNSaaS in your production environment, please file a support ticket and mention the bug tracker BZ#1374002, so we can gauge the interest for this tool. For more information about Technology Preview features, see https://access.redhat.com/support/offerings/techpreview.
2.1. Install the DNS service Copy linkLink copied to clipboard!
This section describes how to install the required DNS service. This can be a standalone server or co-located on an OpenStack controller:
2.2. Configure DNSaaS on the primary node Copy linkLink copied to clipboard!
This section describes how to install and configure DNSaaS. Perform these steps on the primary (master) node:
Install the DNSaaS packages.
yum install -y openstack-designate-api openstack-designate-central openstack-designate-sink openstack-designate-pool-manager openstack-designate-mdns openstack-designate-common python-designate python-designateclient openstack-designate-agent openstack-utils bind bind-utils python-redis
yum install -y openstack-designate-api openstack-designate-central openstack-designate-sink openstack-designate-pool-manager openstack-designate-mdns openstack-designate-common python-designate python-designateclient openstack-designate-agent openstack-utils bind bind-utils python-redisCopy to Clipboard Copied! Toggle word wrap Toggle overflow Disable the
namedservice:systemctl disable named
systemctl disable namedCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Source your
openstackrcfile, as the following steps interact with OpenStack services. To ease the deployment process, this guide relies on a number of variables; you will need to populate the values accordingly:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure
redis-sentinel:-
Ensure the
/etc/redis.conffile contains abindclause pointing to the external IP address. Edit
/etc/redis-sentinel.confand change thelocalhostIP address to the Primary Controller public IP address. Remember to do this on each participating controller, and specify the same IP address in everyredis-sentinelnode.sed -i "s/sentinel monitor mymaster 127.0.0.1 6379 2/sentinel monitor mymaster $REDIS_SERVER_IP 6379 2/g" /etc/redis-sentinel.conf
sed -i "s/sentinel monitor mymaster 127.0.0.1 6379 2/sentinel monitor mymaster $REDIS_SERVER_IP 6379 2/g" /etc/redis-sentinel.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Ensure the
Enable and start the
redisandredis-sentinelservices:systemctl enable redis redis-sentinel systemctl start redis redis-sentinel
# systemctl enable redis redis-sentinel # systemctl start redis redis-sentinelCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy
/etc/redis-sentinel.confto the other OpenStack controllers that runredisand repeat step 3. Export the
redis-sentinelcluster name:REDIS_SENTINEL_NAME=`grep -v \\# /etc/redis-sentinel.conf | grep "sentinel monitor" | awk '{print $3}'`REDIS_SENTINEL_NAME=`grep -v \\# /etc/redis-sentinel.conf | grep "sentinel monitor" | awk '{print $3}'`Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the backend database:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the DNSaaS service account in keystone:
openstack user create designate --password $DESIGNATE_PASSWORD --email designate@localhost
openstack user create designate --password $DESIGNATE_PASSWORD --email designate@localhostCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the DNSaaS account to the
serviceproject:openstack role add --project $SERVICES_TENANT_ID --user designate admin
openstack role add --project $SERVICES_TENANT_ID --user designate adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the DNSaaS service:
openstack service create dns --name designate --description "Designate DNS Service"
openstack service create dns --name designate --description "Designate DNS Service"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the DNSaaS endpoint:
openstack endpoint create --region RegionOne --publicurl http://$DESIGNATE_VIP_IP:9001 --internalurl http://$DESIGNATE_VIP_IP:9001 --adminurl http://$DESIGNATE_VIP_IP:9001 designate
openstack endpoint create --region RegionOne --publicurl http://$DESIGNATE_VIP_IP:9001 --internalurl http://$DESIGNATE_VIP_IP:9001 --adminurl http://$DESIGNATE_VIP_IP:9001 designateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the keystone token settings to the DNSaaS configuration:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the API extensions for DNSaaS:
crudini --set /etc/designate/designate.conf service:api enabled_extensions_v1 "diagnostics, quotas, reports, sync, touch" crudini --set /etc/designate/designate.conf service:api enabled_extensions_v2 "quotas, reports"
crudini --set /etc/designate/designate.conf service:api enabled_extensions_v1 "diagnostics, quotas, reports, sync, touch" crudini --set /etc/designate/designate.conf service:api enabled_extensions_v2 "quotas, reports"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure DNSaaS to integrate with the
Instancesproject:crudini --set /etc/designate/designate.conf service:central managed_resource_tenant_id $INSTANCES_TENANT_ID
crudini --set /etc/designate/designate.conf service:central managed_resource_tenant_id $INSTANCES_TENANT_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the connection to the backend database:
crudini --set /etc/designate/designate.conf storage:sqlalchemy connection mysql+pymysql://designate:$DESIGNATE_PASSWORD@$MYSQL_SERVER_IP/designate crudini --set /etc/designate/designate.conf pool_manager_cache:sqlalchemy connection mysql+pymysql://designate:$DESIGNATE_PASSWORD@$MYSQL_SERVER_IP/designate_pool_manager
crudini --set /etc/designate/designate.conf storage:sqlalchemy connection mysql+pymysql://designate:$DESIGNATE_PASSWORD@$MYSQL_SERVER_IP/designate crudini --set /etc/designate/designate.conf pool_manager_cache:sqlalchemy connection mysql+pymysql://designate:$DESIGNATE_PASSWORD@$MYSQL_SERVER_IP/designate_pool_managerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the Messaging endpoint:
crudini --set /etc/designate/designate.conf oslo_messaging_rabbit rabbit_hosts $RABBIT_SERVER_IP:5672
crudini --set /etc/designate/designate.conf oslo_messaging_rabbit rabbit_hosts $RABBIT_SERVER_IP:5672Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
redis-sentinelconnection:crudini --set /etc/designate/designate.conf coordination backend_url redis://$REDIS_SERVER_IP:26379?sentinel=$REDIS_SENTINEL_NAME
crudini --set /etc/designate/designate.conf coordination backend_url redis://$REDIS_SERVER_IP:26379?sentinel=$REDIS_SENTINEL_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Populate and prepare the Designate MySQL database:
su -s /bin/sh -c "designate-manage database sync" designate su -s /bin/sh -c "designate-manage pool-manager-cache sync" designate
su -s /bin/sh -c "designate-manage database sync" designate su -s /bin/sh -c "designate-manage pool-manager-cache sync" designateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start only the
centralandapidesignate services:systemctl enable designate-central designate-api systemctl start designate-central designate-api
systemctl enable designate-central designate-api systemctl start designate-central designate-apiCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the following file as
/etc/designate/pools.yaml. Remember that you need to change the variablesEXTERNAL_DNS_SERVER_FQDN,EXTERNAL_DNS_SERVER_IPandDESIGNATE_SERVER_1. There are provisions for additional DNS servers, if needed:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy
/etc/rndc.keyto/etc/designate/rndc.key. Remember to set permissions accordingly:chown designate:designate /etc/designate/rndc.key
chown designate:designate /etc/designate/rndc.keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow Load the above YAML file into the DNSaaS runtime configuration:
su -s /bin/sh -c "designate-manage pool update" designate
su -s /bin/sh -c "designate-manage pool update" designateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the remaining DNSaaS services:
systemctl enable designate-pool-manager designate-mdns designate-sink systemctl start designate-pool-manager designate-mdns designate-sink
systemctl enable designate-pool-manager designate-mdns designate-sink systemctl start designate-pool-manager designate-mdns designate-sinkCopy to Clipboard Copied! Toggle word wrap Toggle overflow NOTE: Do not close your SSH session, as you will need the populated variables in the following sections.
2.3. Add secondary nodes Copy linkLink copied to clipboard!
You can add secondary nodes that will participate in the redis cluster. Perform these steps on the secondary nodes:
Install the DNSaaS packages.
yum install -y openstack-designate-api openstack-designate-central openstack-designate-sink openstack-designate-pool-manager openstack-designate-mdns openstack-designate-common python-designate python-designateclient openstack-designate-agent openstack-utils bind bind-utils python-redis
yum install -y openstack-designate-api openstack-designate-central openstack-designate-sink openstack-designate-pool-manager openstack-designate-mdns openstack-designate-common python-designate python-designateclient openstack-designate-agent openstack-utils bind bind-utils python-redisCopy to Clipboard Copied! Toggle word wrap Toggle overflow Disable the
namedservice:systemctl disable named
systemctl disable namedCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure Redis Sentinel:
-
Esure that in
/etc/redis.confthebindclause points to the this controller external IP address. Copy the
redis-sentinelconfiguration from your master node. Leave the IP address unchanged:scp designate-1:/etc/redis-sentinel.conf /etc
scp designate-1:/etc/redis-sentinel.conf /etcCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Esure that in
Enable and start the
redisandredis-sentinelservices:systemctl enable redis redis-sentinel systemctl start redis redis-sentinel
# systemctl enable redis redis-sentinel # systemctl start redis redis-sentinelCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Repeat steps 1 to 3 for each controller that is running
redis. Test the
redis-sentinelfunctionality:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy your DNSaaS configuration from your master node:
scp designate-1:/etc/designate/* /etc/designate
scp designate-1:/etc/designate/* /etc/designateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the only needed services. NOTE: Do not start the
poolagent in the standby nodes.systemctl enable designate-api designate-central designate-mdns designate-sink systemctl start designate-api designate-central designate-mdns designate-sink
systemctl enable designate-api designate-central designate-mdns designate-sink systemctl start designate-api designate-central designate-mdns designate-sinkCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Configure neutron integration Copy linkLink copied to clipboard!
Perform this procedure on the primary node.
Create the DNS zone:
ZONE_ID=`openstack zone create --email admin@$ZONE_NAME $ZONE_NAME. -f value -c id` crudini --set /etc/designate/designate.conf handler:nova_fixed domain_id $ZONE_ID crudini --set /etc/designate/designate.conf handler:neutron_floatingip domain_id $ZONE_ID
ZONE_ID=`openstack zone create --email admin@$ZONE_NAME $ZONE_NAME. -f value -c id` crudini --set /etc/designate/designate.conf handler:nova_fixed domain_id $ZONE_ID crudini --set /etc/designate/designate.conf handler:neutron_floatingip domain_id $ZONE_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the configuration to the remaining designate cluster members. For example:
scp /etc/designate/* designate-2:/etc/designate scp /etc/designate/* designate-3:/etc/designate
scp /etc/designate/* designate-2:/etc/designate scp /etc/designate/* designate-3:/etc/designateCopy to Clipboard Copied! Toggle word wrap Toggle overflow For the primary node only: restart the designate services:
for i in api central mdns pool-manager sink ; do systemctl restart designate-$i donefor i in api central mdns pool-manager sink ; do systemctl restart designate-$i doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow On the remaining nodes, restart the designate services:
for i in api central mdns sink ; do systemctl restart designate-$i donefor i in api central mdns sink ; do systemctl restart designate-$i doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow On the primary node, configure the neutron integration:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy the
/etc/neutron/plugins/ml2/ml2_conf.iniand/etc/neutron/neutron.confconfiguration to the other participating controllers. Once the files have finished copying, restart the
neutronservice:openstack-service restart neutron
openstack-service restart neutronCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make the
neutronservice aware that all instances within the internal network are now part of the DNS domain managed by designate:neutron net-update $INTERNAL_NET_ID --dns_domain $ZONE_NAME.
neutron net-update $INTERNAL_NET_ID --dns_domain $ZONE_NAME.Copy to Clipboard Copied! Toggle word wrap Toggle overflow