Jump to: navigation, search

Difference between revisions of "Designate/Vancouver/Workshop"

Line 13: Line 13:
 
== Designate Installation Instructions ==
 
== Designate Installation Instructions ==
  
=== Install Designate ===
 
# Start the VM
 
#:*vagrant up
 
# Log into the VM
 
#:* vagrant ssh
 
 
# Install Designate and its dependencies
 
# Install Designate and its dependencies
#:* cd /home/vagrant/designate
+
cd /home/vagrant/designate
#:* ''sudo apt-get -y build-dep python-lxml''
+
pip install -r requirements.txt
#:* ''sudo pip install -r requirements.txt -r test-requirements.txt''
+
sudo python setup.py develop
#:*  sudo python setup.py develop
+
 
 
# Make copies of designate config files from templates
 
# Make copies of designate config files from templates
#:* cd etc/designate (/home/vagrant/designate/etc/designate)
+
cd /home/vagrant/designate/etc/designate
#:* ls *.sample | while read f; do cp $f $(echo $f | sed "s/.sample$//g"); done
+
 
# Copy over config file with pre-set values to designate.conf
+
####
#: (Replace contents of designate.conf with contents of file /home/vagrant/designate.conf.wkshp )
+
# The configuration file is set for you at etc/designate/designate.conf, you can diff it with designate.conf.sample
#:* cp /home/vagrant/designate.conf.wkshp ./designate.conf
+
###
# Create directory for maintaining designate state information (this directory was referenced by 'state_path' variable in designate.conf file)
+
 
#:* sudo mkdir /var/lib/designate
 
 
# Create directory for maintaining designate log files (this directory was referenced by 'logdir' variable in designate.conf file)
 
# Create directory for maintaining designate log files (this directory was referenced by 'logdir' variable in designate.conf file)
#:* sudo mkdir /home/vagrant/designate/log
+
mkdir /home/vagrant/logs/  
==== Verify the DNS server (PowerDNS) config ====
+
 
Verify 'gmysql-dbname='''pdns'''' in /etc/powerdns/pdns.d/pdns.local.gmysql
+
# Create, Initialize and sync the databases
:* cat /etc/powerdns/pdns.d/pdns.local.gmysql
+
# The Designate database
 +
mysql -e 'CREATE DATABASE `designate` CHARACTER SET utf8 COLLATE utf8_general_ci;'
 +
designate-manage database sync
 +
 
 +
# The PowerDNS database
 +
mysql -e 'CREATE DATABASE `powerdns` CHARACTER SET utf8 COLLATE utf8_general_ci;'
 +
designate-manage powerdns sync f26e0b32-736f-4f0a-831b-039a415c481e
 +
 
 +
# Restart pDNS after replacing it's DB
 +
sudo service pdns restart
  
==== Verify PowerDNS is running on port 53 ====
+
# Start the Designate Central Service
:* sudo netstat -tnlp (look for '''pdns_server-in''')
+
sudo stop designate-central
 +
sudo start designate-central
  
==== Test PowerDNS ====
+
# Start the Designate API Service
:* dig @localhost openstack.com (You should get some response with status:SERVFAIL)
+
sudo stop designate-api
 +
sudo start designate-api
  
==== Create, Initialize and sync the databases ====
+
# Start the Designate mDNS Service
===== The Designate database =====
+
sudo stop designate-mdns
:* mysql -e 'CREATE DATABASE `designate` CHARACTER SET utf8 COLLATE utf8_general_ci;'
+
sudo start designate-mdns
:* sudo designate-manage database init
 
:* sudo designate-manage database sync
 
  
===== The PowerDNS database =====
+
# Start the Designate Pool Manager Service
(Database already exists. Just init and sync)
+
sudo stop designate-pool-manager
:* sudo designate-manage powerdns init
+
sudo start designate-pool-manager
:* sudo designate-manage powerdns sync
 
==== Start the Designate Central Service ====
 
:* sudo designate-central &
 
  
==== Start the Designate API Service ====
+
# Setup the Designate Keystone service and endpoints
:* sudo designate-api &
+
# First set user 'admin' particulars then create service and endpoint
 +
source /home/vagrant/openrc.admin
  
==== Check services are up ====
+
keystone service-list | grep designate | awk '{print $2}' | xargs --no-run-if-empty -n 1 keystone service-delete
:* ps aux | grep designate
 
  
====  Setup the Designate Keystone service and endpoints ====
+
keystone service-create --name designate --type dns --description "Designate Service"
First set user 'admin' particulars then create service and endpoint
+
keystone endpoint-create --service designate --publicurl http://127.0.0.1:9001 #--adminurl http://127.0.0.1:9001 --internalurl http://127.0.0.1:9001
:* source /home/vagrant/openrc.admin
 
:* keystone service-create --name designate --type dns --description "Designate Service"
 
:* keystone endpoint-create --service designate --publicurl http://127.0.0.1:9001/v1 --adminurl http://127.0.0.1:9001/v1 --internalurl http://127.0.0.1:9001/v1
 
  
=== Install Designate Client ===
+
# Confirm the service exists
:* cd /home/vagrant/python-designateclient
+
keystone catalog --service dns
:* sudo pip install -r requirements.txt -r test-requirements.txt
 
:* sudo python setup.py develop
 
===== Test Designate Client =====
 
:* cd /home/vagrant
 
:* source openrc.admin
 
:* designate --debug server-list
 
  
=== Exercise the Designate API ===
+
# Install Designate Client
=====Test API locally on VM: =====
+
cd /home/vagrant/python-designateclient
:* curl http://localhost:9001
+
sudo pip install -r requirements.txt
=====Test API from External Client (e.g. Google Chrome HTTP Client):=====
+
sudo python setup.py develop
:* http://localhost:9001/v2/
 
More Sample Helpful commands below in "Other Designate Workshop Command Lines"
 
  
== Other Designate Workshop Command Lines ==
+
# Install Designate Horizon Panels
* killall designate-api
+
#
* killall designate-central
+
cd /home/vagrant/designate/contrib/designate-dashboard
 +
python setup.py sdist
 +
sudo pip install dist/*.tar.gz
 +
sudo cp designatedashboard/enabled/_70_dns_add_group.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
 +
sudo cp designatedashboard/enabled/_71_dns_project.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
 +
sudo service apache2 restart
  
:Also, other log files exist in '''/var/log''' (e.g syslog for traces on services such as PowerDNS)
+
# Tell designate what you want your ns records to be
 +
designate server-create --name ns.example.com.
  
 
= Additional Notes on the workshop =
 
= Additional Notes on the workshop =
*PowerDNS was used as the backend rather than BIND as it is better tested as of now. 
 
 
*A single node was used so that it is easier to control and easier for newbies to install.
 
*A single node was used so that it is easier to control and easier for newbies to install.

Revision as of 21:23, 19 May 2015

Designate: Interactive Workshop - Install and Operate - Openstack Summit, May 2015

Designate provides DNSaaS services for OpenStack.

This interactive workshop will guide attendees on how Designate can be installed with PowerDNS. For the purposes of the workshop the various designate components will be installed on a single node. Once installed it shows some of the V1 and V2 APIs for domain and record management. The workshop will conclude by using a tool like dig to retrieve the added records from the PowerDNS backend, showing a fully functional by-hand deployment.

The workshop will also cover the steps for contributing to the development of Designate.

Several of the Designate contributors will be on hand during the workshop to help attendees work through the deployment.

See also: "Designate: An Overview of DNSaaS for Openstack" and “Designate: Deep Dive for Operators/Deployers”

Designate Installation Instructions

  1. Install Designate and its dependencies

cd /home/vagrant/designate pip install -r requirements.txt sudo python setup.py develop

  1. Make copies of designate config files from templates

cd /home/vagrant/designate/etc/designate

  1. The configuration file is set for you at etc/designate/designate.conf, you can diff it with designate.conf.sample
  1. Create directory for maintaining designate log files (this directory was referenced by 'logdir' variable in designate.conf file)

mkdir /home/vagrant/logs/

  1. Create, Initialize and sync the databases
  2. The Designate database

mysql -e 'CREATE DATABASE `designate` CHARACTER SET utf8 COLLATE utf8_general_ci;' designate-manage database sync

  1. The PowerDNS database

mysql -e 'CREATE DATABASE `powerdns` CHARACTER SET utf8 COLLATE utf8_general_ci;' designate-manage powerdns sync f26e0b32-736f-4f0a-831b-039a415c481e

  1. Restart pDNS after replacing it's DB

sudo service pdns restart

  1. Start the Designate Central Service

sudo stop designate-central sudo start designate-central

  1. Start the Designate API Service

sudo stop designate-api sudo start designate-api

  1. Start the Designate mDNS Service

sudo stop designate-mdns sudo start designate-mdns

  1. Start the Designate Pool Manager Service

sudo stop designate-pool-manager sudo start designate-pool-manager

  1. Setup the Designate Keystone service and endpoints
  2. First set user 'admin' particulars then create service and endpoint

source /home/vagrant/openrc.admin

keystone service-list | grep designate | awk '{print $2}' | xargs --no-run-if-empty -n 1 keystone service-delete

keystone service-create --name designate --type dns --description "Designate Service" keystone endpoint-create --service designate --publicurl http://127.0.0.1:9001 #--adminurl http://127.0.0.1:9001 --internalurl http://127.0.0.1:9001

  1. Confirm the service exists

keystone catalog --service dns

  1. Install Designate Client

cd /home/vagrant/python-designateclient sudo pip install -r requirements.txt sudo python setup.py develop

  1. Install Designate Horizon Panels

cd /home/vagrant/designate/contrib/designate-dashboard python setup.py sdist sudo pip install dist/*.tar.gz sudo cp designatedashboard/enabled/_70_dns_add_group.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled sudo cp designatedashboard/enabled/_71_dns_project.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled sudo service apache2 restart

  1. Tell designate what you want your ns records to be

designate server-create --name ns.example.com.

Additional Notes on the workshop

  • A single node was used so that it is easier to control and easier for newbies to install.