PowerGSLB - PowerDNS Remote GSLB Backend
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
admin Version 1.6.2 Oct 26, 2016
database Add pointer record May 14, 2017
docker Update Docker image to CentOS 7.5 Jun 26, 2018
images Add class diagram Oct 30, 2016
pdf Add Bachelor PDF files Aug 12, 2016
pdns Fix views by disabling pdns cache Jan 21, 2018
powergslb Print powergslb thread name Jan 21, 2018
src/powergslb Change license to MIT Aug 20, 2017
stunnel Version 1.4.2 Feb 26, 2016
LICENSE Change license to MIT Aug 20, 2017
README.md Update Docker image to CentOS 7.5 Jun 26, 2018
powergslb.spec Change license to MIT Aug 20, 2017
setup.py Change license to MIT Aug 20, 2017

README.md

PowerGSLB - PowerDNS Remote GSLB Backend

PowerGSLB is a simple DNS based Global Server Load Balancing (GSLB) solution.

Table of Contents

Main features

  • Quick installation and setup
  • Written in Python 2.7
  • Built as PowerDNS Authoritative Server Remote Backend
  • Web based administration interface using w2ui
  • HTTPS support for the webserver using stunnel
  • DNS GSLB configuration stored in a MySQL / MariaDB database
  • Master-Slave DNS GSLB using native MySQL / MariaDB replication
  • Multi-Master DNS GSLB using native MySQL / MariaDB Galera Cluster
  • Modular architecture
  • Multithreaded architecture
  • Systemd status and watchdog support
  • Extendable health checks:
    • ICMP ping
    • TCP connect
    • HTTP request
    • Arbitrary command execution
  • Fallback if all the checks failed
  • Weighted (priority) records
  • Per record client IP / subnet persistence
  • DNS GSLB views support
  • All-in-one Docker image

Database diagram

Class diagram

Web based administration interface

Status grid

Advanced search

Add new record

More images

Installation on CentOS 7

Setup PowerGSLB, PowerDNS and stunnel

yum -y update
yum -y install epel-release
yum -y install gcc python-devel python-pip

pip install pyping subprocess32

VERSION=1.6.5
yum -y install \
    "https://github.com/AlekseyChudov/powergslb/releases/download/$VERSION/powergslb-$VERSION-1.el7.centos.noarch.rpm" \
    "https://github.com/AlekseyChudov/powergslb/releases/download/$VERSION/powergslb-admin-$VERSION-1.el7.centos.noarch.rpm" \
    "https://github.com/AlekseyChudov/powergslb/releases/download/$VERSION/powergslb-pdns-$VERSION-1.el7.centos.noarch.rpm" \
    "https://github.com/AlekseyChudov/powergslb/releases/download/$VERSION/powergslb-stunnel-$VERSION-1.el7.centos.noarch.rpm"

sed -i 's/^password = .*/password = your-database-password-here/g' /etc/powergslb/powergslb.conf

cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf~
cp "/usr/share/doc/powergslb-pdns-$VERSION/pdns/pdns.conf" /etc/pdns/pdns.conf

Setup MariaDB

yum -y install mariadb-server

sed -i '/\[mysqld\]/a bind-address=127.0.0.1\ncharacter_set_server=utf8' /etc/my.cnf.d/server.cnf

systemctl enable mariadb.service
systemctl start mariadb.service
systemctl status mariadb.service

mysql_secure_installation

VERSION=1.6.5
mysql -p << EOF
CREATE DATABASE powergslb;
GRANT ALL ON powergslb.* TO powergslb@localhost IDENTIFIED BY 'your-database-password-here';
USE powergslb;
source /usr/share/doc/powergslb-$VERSION/database/scheme.sql
source /usr/share/doc/powergslb-$VERSION/database/data.sql
EOF

Start services

systemctl enable powergslb.service pdns.service stunnel@powergslb
systemctl start powergslb.service pdns.service stunnel@powergslb
systemctl status powergslb.service pdns.service stunnel@powergslb

Test PowerGSLB

yum -y install bind-utils

dig @127.0.0.1 example.com SOA
dig @127.0.0.1 example.com A
dig @127.0.0.1 example.com AAAA
dig @127.0.0.1 example.com ANY

Web based administration interface

Open URL https://SERVER/admin/.

  • Default username: admin
  • Default password: admin

Building PowerGSLB RPM packages

You should always create RPM packages in a clean environment and preferably on a separate machine!

Please read How to create an RPM package.

yum -y update
yum -y install @Development\ Tools

VERSION=1.6.5
curl "https://codeload.github.com/AlekseyChudov/powergslb/tar.gz/$VERSION" > "powergslb-$VERSION.tar.gz"
rpmbuild -tb --define "version $VERSION" "powergslb-$VERSION.tar.gz"

Upon successful completion you will have four packages

~/rpmbuild/RPMS/noarch/powergslb-$VERSION-1.el7.centos.noarch.rpm
~/rpmbuild/RPMS/noarch/powergslb-admin-$VERSION-1.el7.centos.noarch.rpm
~/rpmbuild/RPMS/noarch/powergslb-pdns-$VERSION-1.el7.centos.noarch.rpm
~/rpmbuild/RPMS/noarch/powergslb-stunnel-$VERSION-1.el7.centos.noarch.rpm

Using PowerGSLB Docker image

For quick setup, you can pull all-in-one Docker image from docker.io.

VERSION=1.6.5

docker pull docker.io/alekseychudov/powergslb:"$VERSION"

docker run -it --name powergslb --hostname powergslb docker.io/alekseychudov/powergslb:"$VERSION"

docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' powergslb

docker exec -it powergslb bash

docker stop powergslb

For systemd to run in Docker container the following SELinux boolean should be enabled.

semanage boolean --modify --on container_manage_cgroup

Building PowerGSLB Docker image

To create an all-in-one Docker image.

VERSION=1.6.5

docker build -f docker/Dockerfile --build-arg VERSION="$VERSION" \
    --force-rm --no-cache -t powergslb:"$VERSION" https://github.com/AlekseyChudov/powergslb.git