Load Balance Events Service Traffic
This page takes you through the sample configuration for a load balancer for the Events Service. It introduces you to the concepts and requirements around load balancing Events Service traffic.
Load Balancing Events Service Traffic Overview
To distribute load among the members of an Events Service cluster, you need to set up a load balancer. For a single node Events Service deployment, using a load balancer is optional but recommended, since it minimizes the work of scaling up to an Events Service cluster later.
To configure the load balancer, add the Events Service cluster members to a server pool to which the load balancer distributes traffic on a round-robin basis. Configure a routing rule for the primary port (9080 by default) of each Events Service node. Every member of the Events Service cluster, primary node or not, needs to be included in the routing rule. Keep in mind that increasing the size of the cluster will involve changes to the load balancer rules described here.
The following figure shows a sample deployment scenario. The load balancer forwards traffic for the Controller and any Events Service clients, Analytics Agents in this example.
About these Instructions
The following instructions describe how to install and configure a load balancer for the Events Service. The steps below provide two examples: load balancing with an Nginx and load balancing with HAProxy with SSL termination at the load balancer. The steps demonstrate commands in a CentOS 6.6 Linux operating system environment.
No two environments are exactly alike, so be sure to adapt the steps for your load balancer type, operating systems, and other site-specific requirements.
Nginx Sample Configuration
HA Proxy Sample Configuration: Terminating SSL at the Load Balancer
By terminating SSL at the load balancer in front of the Events Service cluster, you can relieve the Events Service machines from the processing burden of SSL. Since the connections between the load balancer and Events Service machines are not secured in this scenario, it is only suitable for deployments in which the load balancer and Events Service machines reside within an internal, secure network.
The following instructions describe how to set up SSL termination at the load balancer. These steps use HAProxy as the example load balancer. An overview of the steps are:
- Step 1: Install the HAProxy Software
- Step 2: Create the Security Certificate
- Step 3: Configure the Load Balancer
- Step 4: Configure the Agent
- Step 5: Configure the Controller
The following diagram shows a sample deployment reflected in the configuration steps:
Before Starting
To perform these steps, you need:
- Root access on the load balancer machine.
- OpenSSL installed on the load balancer machine.
- HAProxy software (minimum version HAProxy 1.5) on the load balancer machine.
Step 1: Install the HAProxy Software
If not already installed, install HAProxy on the load balancer machine. The manner in which you install it depends on your operating system and the package manager it uses. If using yum package manager on Linux, for example, enter the following command:
sudo yum install haproxy
Step 2. Create the Security Certificate
The security certificate secures the connection between the load balancer and Events Service clients, including the Application Analytics Agent. You can use a self-signed certificate or a certificate signed by a certificate authority (CA) to secure the connection between the load balancer and clients. The following steps walk you through each scenario:
For production use, we recommend the use of a certificate signed by a third-party CA or your own internal CA rather than a self-signed certificate.
Create a Self-Signed Certificate on the Load Balancer Machine
Create and Install a Certificate Signed by a Certificate Authority
Step 3. Configure the Load Balancer
Step 4: Configure the Agent
Perform these steps on each machine on which the Analytics Agent runs.
Step 5: Configure the Controller
If not already done, configure the connection from the Controller to the Events Service through the load balancer using a secure connection as well: