Installing Juno on Ubuntu

Architecture

Please see Production Architecture for general production architecture notes.

  • Ubuntu as the Operating System
  • Designate
  • RabbitMQ
  • MySQL
  • PowerDNS Backend
  • Keystone for AuthN / AuthZ (Not included in this guide)

Prerequisites

Install

$ sudo apt-get install mysql-server rabbitmq-server pdns-server pdns-backend-mysql

RabbitMQ

Note

Do the following commands as “root” or via sudo <command>

Create a user:

$ rabbitmqctl add_user designate designate

Give the user access to the / vhost:

$ sudo rabbitmqctl set_permissions -p "/" designate ".*" ".*" ".*"

MySQL

Note

The following commands should be done using the mysql command line or similar.

Create the MySQL user

$ mysql -u root -p
Enter password: <enter your password here>

mysql> GRANT ALL ON designate.* TO 'designate'@'localhost' IDENTIFIED BY 'designate';
mysql> GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'powerdns';

Create the database

mysql> CREATE DATABASE `designate` CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE DATABASE `powerdns` CHARACTER SET utf8 COLLATE utf8_general_ci;

PowerDNS

Edit the config:

$ sudo editor /etc/powerdns/pdns.conf

Settings:

launch = gmysql

Edit the MySQL backend settings:

$ sudo editor /etc/powerdns/pdns.d/pdns.local.gmysql.conf

Settings:

gmysql-host=localhost
gmysql-dbname=powerdns
gmysql-user=powerdns
gmysql-password=powerdns

Delete a couple unnecessary files:

$ rm /etc/powerdns/bindbackend.conf
$ rm /etc/powerdns/pdns.d/pdns.simplebind.conf

Installing using Source (Git)

  1. Install pre-requisites:
$ sudo apt-get install libmysqlclient-dev
$ sudo apt-get install git python-dev python-pip
$ sudo apt-get build-dep python-lxml
  1. Clone the repository:
$ git clone https://git.openstack.org/openstack/designate designate
  1. Change directory to the newly cloned repository
$ cd designate
  1. Checking out a specific version:

In some cases you might want to pin the repository version to a specific version of the repository like a stable one.

Example for the Juno release:

$ git checkout stable/juno
  1. Install all dependencies using pip
$ sudo pip install -r requirements.txt
$ sudo pip install MySQL-python
  1. Install Designate:
$ sudo python setup.py develop
  1. Copy over configuration files
$ sudo cp -R etc/designate /etc/
$ ls /etc/designate/*.sample | while read f; do sudo cp $f $(echo $f | sed "s/.sample$//g"); done

Create directories

Since we are not running packages some directories are not created for us.

$ sudo mkdir /var/lib/designate /var/log/designate
# Needed if you are running designate as a non root user.
$ sudo chown designate /var/lib/designate /var/log/designate

Configuring

Designate

$ sudo editor /etc/designate/designate.conf

Copy or mirror the configuration from this sample file here:

[DEFAULT]
########################
## General Configuration
########################
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
debug = True

# Top-level directory for maintaining designate's state
state_path = /var/lib/designate

# Log directory #Make sure and create this directory, or set it to some other directory that exists
logdir = /var/log/designate

# Driver used for issuing notifications
notification_driver = messaging

# Use "sudo designate-rootwrap /etc/designate/rootwrap.conf" to use the real
# root filter facility.
# Change to "sudo" to skip the filtering and just run the command directly
# root_helper = sudo

########################
## Service Configuration
########################
#-----------------------
# Central Service
#-----------------------
[service:central]
# Driver used for backend communication (e.g. fake, rpc, bind9, powerdns)
backend_driver = powerdns

# Maximum domain name length
max_domain_name_len = 255

# Maximum record name length
max_record_name_len = 255

#-----------------------
# API Service
#-----------------------
[service:api]
# Address to bind the API server
api_host = 0.0.0.0

# Port the bind the API server to
api_port = 9001

# Authentication strategy to use - can be either "noauth" or "keystone"
auth_strategy = keystone

# Enabled API Version 1 extensions
enabled_extensions_v1 = diagnostics, quotas, reports, sync

#-----------------------
# Keystone Middleware
#-----------------------
[keystone_authtoken]
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = designate
admin_password = designate

########################
## Storage Configuration
########################
#-----------------------
# SQLAlchemy Storage
#-----------------------
[storage:sqlalchemy]
# Database connection string - to configure options for a given implementation
# like sqlalchemy or other see below
connection = mysql://designate:designate@localhost/designate
#connection_debug = 100
#connection_trace = True
#sqlite_synchronous = True
idle_timeout = 3600
max_retries = 10
retry_interval = 10

########################
## Backend Configuration
########################
#-----------------------
# PowerDNS Backend
#-----------------------
[backend:powerdns]
connection = mysql://powerdns:powerdns@localhost/powerdns
#connection_debug = 100
#connection_trace = True
#sqlite_synchronous = True
idle_timeout = 3600
max_retries = 10
retry_interval = 10

Sync Database schemas

Initialize and sync the database schemas for Designate and PowerDNS:

$ designate-manage database sync

$ designate-manage powerdns sync

Register Designate with Keystone

For howto register Designate with Keystone you can check the code used in the devstack plugin.

There should be no version registered in the URL for the endpoint.

Starting the services

Central:

$ designate-central

API:

$ designate-api

You should now be able to create zones and use nslookup or dig towards localhost to query pdns for it.