Comparing Different Load Balancers? Get our free guide
  • Support
  • Blog
  • +1 866 998 0508
The latest insights from the load balancing experts | Loadbalancer.org
  • Solutions
  • Services
  • Products
  • Resources
  • Get Started
  • Support
  • Blog
Buy Now
  • Solutions
  • Services
  • Products
  • Resources
  • Get Started
  • call
  • contact

The latest insights from the load balancing experts | Loadbalancer.org

  • Latest posts
  • By topic
    • How Tos
    • Events
    • Guest Blogs
    • Top Ten Blogs
    • HA Proxy
  • By sector
    • Healthcare
    • Storage
    • Security
    • Print
    • Microsoft
  • How-To's
  • High Availability
  • HAProxy
  • Just for Fun
  • Security
  • Amazon AWS
  • News
  • Events
  • Linux
  • Healthcare
  • Top 10 Blogs
  • Reviews and Comparisons
  • SSL
  • Microsoft Azure
  • Web Application Firewall (WAF)
  • Case Studies
  • Microsoft Exchange
  • Disaster Recovery
  • Direct Server Return (DSR)
  • Global Server Load Balancing (GSLB)
  • Microsoft
  • Google Cloud Platform (GCP)
  • Print
  • Denial of Service
  • Microsoft Remote Desktop Services
  • Web Filters / Proxy
  • Guest Blogs
  • Object Storage
  • Broadcast Media
  • X-Forwarded-For Header (XFF)
  • VMware
  • Nutanix
  • open source
See more tags

GSLB — Why Global Server Load Balancers don’t always suck? (Polaris-GSLB) Part 2

5 December 2016 / 3 min read / Global Server Load Balancing (GSLB)

UPDATE - December 2017: Just for your information - we've finally found a decent reason to use GSLB!

In part one we were introduced to Polaris-GSLB which is a cool little open source GSLB solution, we went through a simple use case scenario and discussed the features it supports. In part two of this Blog I’m going to show you how to build Polaris-GSLB on CentOS 7. I assume you already have a CentOS 7 minimal or better installed and that you've configured the basics such as set an IP address, installed your favourite editor and generally got the server setup how you want it.

Okay so lets start with installing some pre-reqs and enable / start memcached.

[root@gslb ~]# yum install -y make gcc gcc-c++ openssl-devel sqlite-devel bzip2-devel boost-devel zlib-devel memcached wget bind-utils bzip2 git

[root@gslb ~]# systemctl enable memcached
[root@gslb ~]# systemctl start memcached

Next we need our own Python as the one included with CentOS 7 is too old for our purposes, I've gone for 3.5.2 because trying 3.4.3 which was recommended on the Polaris-GSLB Github page didn't seem to support the topology function properly.

[root@gslb ~]# PYTHON_VERSION=3.5.2
[root@gslb ~]# wget -P /tmp/ http://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz
[root@gslb ~]# tar -xvJf /tmp/Python-${PYTHON_VERSION}.tar.xz -C /tmp
[root@gslb ~]# cd /tmp/Python-${PYTHON_VERSION}
[root@gslb ~]# ./configure --prefix=/opt/python-${PYTHON_VERSION}
[root@gslb ~]# make -j 4 && make altinstall

Symlink Python and Pip.

[root@gslb ~]# ln -s /opt/python-3.5.2/bin/python3.5 /opt/python-3.5.2/bin/python3
[root@gslb ~]# ln -s /opt/python-3.5.2/bin/pip3.5 /opt/python-3.5.2/bin/pip3

Install Python modules.

[root@gslb ~]# /opt/python-${PYTHON_VERSION}/bin/pip3 install pyyaml
[root@gslb ~]# /opt/python-${PYTHON_VERSION}/bin/pip3 install python-memcached
[root@gslb ~]# /opt/python-${PYTHON_VERSION}/bin/pip3 install python-daemon-3K

Now that we have successfully built and installed Python we need to install PowerDNS which is used for the back-end.

[root@gslb ~]# PDNS_VERSION=3.4.8
[root@gslb ~]# wget -P /tmp/ https://downloads.powerdns.com/releases/pdns-${PDNS_VERSION}.tar.bz2
[root@gslb ~]# tar -xvf /tmp/pdns-${PDNS_VERSION}.tar.bz2 -C /tmp
[root@gslb ~]# cd /tmp/pdns-${PDNS_VERSION}
[root@gslb ~]# ./configure --with-modules="remote" && make -j 4 && make install

Next we'll need to grab Polaris-GSLB from Git, build and install it.

[root@gslb ~]# cd /tmp
[root@gslb ~]# git clone https://github.com/polaris-gslb/polaris-gslb.git
[root@gslb ~]# cd polaris-gslb
[root@gslb ~]# /opt/python-${PYTHON_VERSION}/bin/python3 setup.py install
[root@gslb ~]# cp /opt/polaris/etc/pdns.conf.dist /usr/local/etc/pdns.conf
[root@gslb ~]# cp /opt/polaris/etc/polaris-lb.yaml.dist /opt/polaris/etc/polaris-lb.yaml
[root@gslb ~]# cp /opt/polaris/etc/polaris-topology.yaml.dist /opt/polaris/etc/polaris-topology.yaml
[root@gslb ~]# cp /opt/polaris/etc/polaris-health.yaml.dist /opt/polaris/etc/polaris-health.yaml
[root@gslb ~]# cp /opt/polaris/etc/polaris-pdns.yaml.dist /opt/polaris/etc/polaris-pdns.yaml
[root@gslb ~]# sed -i '1s/.*/export\ PATH=\/opt\/python-3.5.2\/bin\:\$PATH/' /etc/default/polaris
[root@gslb ~]# sed -i '2s/.*/export\ POLARIS_INSTALL_PREFIX=\/opt\/polaris/' /etc/default/polaris

Create systemd scripts and start remaining services.
PowerDNS Script: /usr/lib/systemd/system/pdns.service

[Unit]
Description=PowerDNS Authoritative Server
Documentation=man:pdns_server(1) man:pdns_control(1)
Documentation=https://doc.powerdns.com
Wants=network-online.target
After=network-online.target mysqld.service postgresql.service slapd.service

[Service]
Type=notify
ExecStart=/usr/local/sbin/pdns_server
Restart=on-failure
RestartSec=1
StartLimitInterval=0
PrivateTmp=true
PrivateDevices=true
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_CHOWN CAP_SYS_CHROOT
NoNewPrivileges=true
# ProtectSystem=full will disallow write access to /etc and /usr, possibly
# not being able to write slaved-zones into sqlite3 or zonefiles.
ProtectSystem=full
ProtectHome=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6

[Install]
WantedBy=multi-user.target

Polaris-GSLB script : /usr/lib/systemd/system/polaris-gslb.service

[Unit]
Description=Polaris-GSLB
After=network-online.target

[Service]
ExecStart=/opt/polaris/bin/polaris-health start
Type=forking
Restart=on-failure
RestartSec=1
StartLimitInterval=0

[Install]
WantedBy=multi-user.target

Finally start the PowerDNS and Polaris-GSLB services.

[root@gslb ~]# systemctl enable pdns
[root@gslb ~]# systemctl start pdns

[root@gslb ~]# systemctl enable polaris-gslb
[root@gslb ~]# systemctl start polaris-gslb

And that's it! It should be all installed now, you can test if it's working by using the examples in the first part of the Blog : GSLB – Why Global Server Load Balancers Don’t Always Suck? (Polaris-GSLB) 

Found in

Global Server Load Balancing (GSLB), High Availability, Linux

About the author

Aaron West-profile-image
Aaron West

Coming from a background assisting companies large and small to get the most from open source solutions. Aaron found joining the support team at Loadbalancer.org a natural progression. Aaron’s interests include distro-hopping, B Movies and quality time spent with his family.

Read More

Related posts

Global Server Load Balancing (GSLB)
Global Server Load Balancing (GSLB)
17 Mar 2021
Choosing the best option to host across multiple locations or data centers Aaron West
There are loads of options available for hosting applications across multiple sites or data centers. But how do you pick the best one for your needs?

8 min read

Read more
Global Server Load Balancing (GSLB)
Global Server Load Balancing (GSLB)
4 Jan 2021
Making the most of GSLB: If you’ve got it, use it Ged Ward
Global Server Load Balancing (GSLB) enables you to distribute internet or corporate network traffic across servers in multiple locations, anywhere in the world. But why – and when – should you use it?

5 min read

Read more
SSL
SSL
13 Dec 2016
Loadbalancer.org with Let's Encrypt- quick and dirty! Aaron West
Let’s Encrypt offers us a free way to get SSL certs with the aim to be less complex than our current solutions, hmm... Well that sounds pretty cool! I had known about Let’s

7 min read

Read more

Get started

Get in touch

Start a conversation about the right solution for your business.

Get in touch

Create your quote

Transparent pricing you can see straight away.

Create your quote

Download now

Try us free for 30 days – see why our customers love us.

Download now

Schedule a virtual meeting with us

Working remotely or from home? Let’s meet on a call or online.

Let's meet

Follow Loadbalancer.org

+1 833 274 2566
  • Company
    • Solutions
    • Services
    • Load balancer
    • Why Loadbalancer.org
    • Blog
    • Professional services
    • Sitemap
  • Load balancer
    • Get a quote
    • Free trial
    • Online demo
  • Resources
    • Manuals
    • Deployment guides
    • Applications
    • White papers
    • Case studies
    • Solutions
  • Support
    • FAQ's
    • Open a ticket
    • Security news
  • Applications
    • Healthcare
    • Storage
    • Print
    • Security
    • Microsoft
The latest insights from the load balancing experts | Loadbalancer.org

The latest insights from the load balancing experts | Loadbalancer.org. All rights reserved

  • Contact Us
  • Terms & Conditions
  • Privacy Policy