Zeus is a new GoGrid partner that provides a software load balancing product as a partner image called “Zeus Load Balancer 200Mbps”. There are three immediate features that come to mind when thinking about how to leverage Zeus within GoGrid: Load Balancing, Failover and Clustering. Note that this first image is a preview with certain feature set. It contains the majority of Zeus features but is capped at two clustered servers and 200 Mbits of bandwidth. Additional images are expected to be released by the end of the year.
This tutorial assumes that you have basic understanding of Linux and SSH as well as basic load balancing and failover strategies.
Cross Data Center Load Balancing / Failover
One of the main uses cases for Zeus is to load balance servers in the same data center. However, a more interesting use case is to quickly and easily load balance web servers within one data center and support failover to another data center. The process is straight forward. First, deploy the Zeus partner image as a VM with 1G RAM in the US-West-1. This example assumes that you already have web servers running on both the US-West-1 and US-East-1 data centers.
Once the Zeus image has been deployed, SSH into the server using the root login. Your logins can be found in the GoGrid web portal by clicking on the server icon, then Tools > Passwords.
We recommend changing your automatically created, default password as soon as you login.
The Message of the Day (MOTD) will have links to additional information and support. To begin, run the configuration (/usr/local/zeus/zxtm/configure). Note that you will be prompted to enter the license key. The key is located at /root/license.txt.
Once the configuration is complete, launch the web interface, typically https://IP_ADDRESS:9090
When you first launch the Zeus admin portal, you will be presented with a warning from your browser. This is because the Load Balancer requires a secure connection and is using a self-signed certificate. Most likely, your browser won’t recognize the certification and present a warning. Bypass the warnings and set an exception for this IP address.
Alternately, you can bypass the warnings but not set an exception and enter your own certificate once you are in the Admin portal:
Use your admin login (again, http://IP_ADDRESS:9090) to access the web interface. One of the first things that you want to do is to create the pool of IP addresses that you want to load balance.
- Click on the icon that says “Services”. You will then see a page with several tabs. Click on the tab called “Pools”. Look for the section that says “Create a new Pool”. First you will want to enter the IP address of the backup server in the US-East-1 Data Center. I have one setup using port 80 and I am calling the pool “East”. You can also set the type of monitoring you want against the pool. Since these are web servers, I am selecting “Simple HTTP” – this ensures that the web server is up and running. For example, if you use Ping, this tells you that the server is responding but not necessarily if the web server itself is down. The click “Create Pool”.
- Next, go back to “Create new Pool” and enter the IP addresses of the two VMs that contain your website in US-West-1 and set the port (typically 80). Give it a name – I am going to call this one, “West1″. Set the monitor here to “Simple HTTP”. Click “Create Pool”. You will now see an option to set the Failure Pool – enter the first pool that you create (“East”).
- Below Basic Settings is a section titled “Load Balancing”. You can also set the algorithm here – in this case, I set Round Robin which will attempt to balance traffic evenly between the nodes.
Next you will want to create a “Virtual Server” (Zeus’ terminology) which means to create a Traffic Manager (TM) instance on your server. Click on the “Virtual Servers” tab to create one. I have created one called “Clustered_TM”. Since I am balancing Web servers, I have set the Internal Protocol to “HTTP” and the Port to “80”. Note the Default Traffic Pool – this is the pool of web servers that I just created (“West1”). Set Enabled to “Yes” and hit the “Update” button to activate the load balancer.
The Zeus TM constantly monitors health so if there are any issues with the servers (such as a server no longer responding) in the pool, it will report it on the main page. Zeus can use different types of checks – in addition to ping, you can also check HTTP, DNS, FTP and others.
You may notice a few warnings when you setup Zeus. Here are some tips to help clear them.
- Java: Cannot start Java Runner, program ‘java’ not found
- Go to the System icon and click on the “Global Settings” tab. Scroll down to the Java Extensions bullet and select “No” for java!enabled. This is really only used if you are coding in the API and not if you are working via the UI.
- Cannot Bind to Port 80
- This is typically due to Apache2 running on Ubuntu. This should already be disabled by default but you can also manually stop it. SSH into your Zeus VM and enter: service apache2 stop
In this configuration, two servers are handling traffic evenly in the West. If one of the servers in the West nodes should fail, then the load balancer will send traffic to the server that is still running. If both should fail, the failure pool will activate, and traffic will route to the East server. Note that due to the distance from the West load balancer, there will be latency, however this will ensure that the website will still run even if there are issues with both servers in the West region.
Another useful feature is the ability to track activity and connections on the load balancer. First, click on the “Activity” icon and then the “Connections” tab. Since both the West servers are up and running, you can see that the traffic is balancing between those two servers.
The previous section only demonstrated setting up Zeus as a single instance. Zeus gives you the ability to setup a clustered pair, in order to provide coverage should one of the Zeus instances go down.
In order to build a cluster, you will need to configure a few things. First deploy a second instance of the Zeus image.
You will need to make some manual changes to the VMs first.
- SSH into your first Zeus server.
- Change to the proper directory: cd /etc/
- Edit the hosts file and include an entry for the second Zeus server that you just deployed
- i.e. (188.8.131.52 31852-1-67347) in the example
- Save and Exit
- SSH into your second Zeus server
- Edit the hosts file and include an entry for the first Zeus server
- Login to the GoGrid portal and restart both servers.
These steps make it easier for the Zeus servers to talk to each other. After the servers have restarted, go to the Admin page and run the following steps:
- Click on the System icon and then the “Traffic Managers” tab.
- Scroll down to the bottom and select “Join a Cluster”.
- You will be presented with a Wizard that will guide you to adding the server to a cluster. Follow the instructions on the Wizard to join a cluster (it should auto-detect other Zeus instances in your VLAN).
- This screenshot shows an existing cluster member since I already have this server as part of Zeus cluster.
Once the servers are in a cluster, they will share configurations so you can administer the cluster from either server.
The last step is to make the cluster invisible to the end user. You will need to use an additional public IP in order to do this. Click on the Services icon. Select the “Traffic IP Groups” tab.
Give the Traffic IP Group a name. In this example, I have created one called “Cluster_Traffic”. Add an unassigned public IP address. (IP addresses can be found within the List view under the Network section within the GoGrid portal.) Note that this is a Zeus setting. Even though it will be “taken” by Zeus, the GoGrid portal will still show this IP address as Unassigned.
You can then use this IP address as the outbound IP for your web cluster. It will leverage the use of both Zeus load balancers, automatically and transparently managing failover and traffic.
Zeus gives you the flexibility to launch load balancers as you need them and to directly manage as many server pools as you require. Although load balancing across data centers is possible, latency will not make this an elegant solution – you will need to implement global load balancing. Contact Zeus if you are interested in using this option. If you want to learn more about Zeus, you can get additional information and support from www.zeus.com/community/documentation.
Latest posts by Rupert Tagnipes (see all)
- Access your servers with GoGrid’s new Console service - May 23, 2013
- Software Defined Networking on the Edge - March 14, 2013
- High Availability with Dynamic Load Balancers - February 4, 2013