Installing Traffic Distributor in Jelastic is super easy and it enables Blue-green deployment for zero-downtime updates, A/B testing of new releases, high availability and failover protection. You can redirect a portion or all traffic to a new version of an application, perform ongoing A/B testing by routing part of the traffic to a newer version of an application to compare performance and get advanced failover protection and achieve high availability by sharing the load between two fully functional applications.
To install Traffic Distributor simply navigate to the marketplace (top left of your dashboard).
Go to the Apps tab of Marketplace, Dev & Admin Tools section to locate the Traffic Distributor package (or just use search field at the top) and click the Install button for it.
Initially, you’ll be shown frame with an overview and the key benefits are highlighted.
Click OK to proceed.
You can specify the following parameters to configure your Traffic Distributor and to set up required routing.
- Entrypoint – switcher with either Shared Load Balancer or Public IP position
- Balancers – the amount of the NGINX instances you would like to add to the Traffic Distributor topology
- Routing method – select from the three available types of traffic distribution: Round Robin, Sticky Sessions and Failover
- Traffic ratio – set backend’s weight (priority) to control the requests distribution
- Backends – select two environments to be balanced, either from the automatically fetched list of available ones from your account or type in the required IP address / domain name (for custom host)
- Environment – domain name for your environment (e.g. traffic-distributor)
- Display Name – optionally, an alias to be shown for environment (Traffic Distributor by default)
- Region – a drop-down list of the available environment regions
When you have specified all of the required data, click the Install button.
After a couple of minutes, you’ll see an installation success window with information on the Traffic Distributor usage.
Using the links in the frame, you can learn how to:
- apply Blue-Green Deploy
- adopt Failover Protection
- perform A/B Testing
- Inject Distributor into running project
- bind a Custom domain
- enable Custom SSL
Traffic Distributor Reconfiguration
After installing the Traffic Distributor, you’ll get a dedicated environment with the NGINX load balancer(s) and an add-on attached. It ensures quick and simple re-configuration and provides access to additional options:
Hover over the NGINX instance in your Traffic Distributor environment and click the Add-ons button to open the corresponding tab.
To change the configurations for your add-on, click the Configure button in center of the frame or select the appropriate option from the menu list in the top right corner.
Here, you can re-configure any Traffic Distributor option, the same as during the installation process:
If you make any changes, click the apply button.
You’ll see the corresponding success notification at the top right corner of the dashboard.
Within the traffic-distributor log, you can find information on the actions applied to your add-on with the corresponding operation time stamps and current distribution values.
Configure an App Entry Point via TD
If your app is being run in production, it most likely has a custom domain name already bound to the initial environment.
Tip: To bind a custom domain name to an environment, follow one of these guides depending on the entry point used:
- if using Shared Load Balancer – configure Custom Domain Name
- if using Public IP – follow the Setting DNS A Record tutorial
For the correct redirection of requests (i.e. to process them through the distributor), we need to move the appropriate entry point to a TD environment. It will be placed in front of the chosen pair of endpoints and share the incoming load among them, based on the settings specified.
In order to accomplish this, follow one of these easy procedures based on the custom domain binding method used:
if using CNAME redirect – swap domains among the initial and TD environments
if using A Record – swap Public IPs to transfer used external IP to the TD environment
Hover over the environment your custom domain is bound to (e.g. Minecraft Server) and select Settings.
Within the opened tab, the domain binding section will be displayed by default. Select your Traffic Distributor environment within drop-down list of the Swap domains option.
Click Swap and confirm.
In a few moments the custom domain name of your application will be moved to the environment with Traffic Distributor and both of your backends will become available via this domain.
Swap Public IPs
The easiest way to pass a Public IP from a primary environment (i.e. the one your custom domain is attached to) to Traffic Distributor is by using the corresponding External Addresses Swap function, available through Jelastic CLI.
It enables you to perform the required configurations in a single command, saving you from manual A Record reconfiguration. If you prefer to work via GUI, this operation can also be accomplished with a manual change of the Public IP address that your domain points to. To do this, make sure that the NGINX balancer instance in your Traffic Distributor environment has an external IP address attached and get its value via the dashboard.
Then, re-configure your A record via the DNS manager, so that it leads to this new IP address.
Note: For these changes to be applied, you need to wait for the current DNS record cache to expire (as until this happens, DNS servers may return the old domain address upon request). To know the exact period the domain’s old IP address will be kept in cache, check the TTL setting value within your DNS manager (usually states in seconds).
Do not forget to recheck your application configurations for the hardcoded IP-dependent settings and adjust them accordingly.
After the application entry point address is changed, you can detach the Public IP from the initial primary environment (if it is no longer required for direct access) and do not pay for the unused option.
And that’s all it takes. All incoming traffic for your custom domain will be processed by Jelastic’s Traffic Distributor solution, which will route it accordingly based on the traffic ratios set between application endpoints.
Try our free 2 week trial to see how the Traffic Distributor within Jelastic can work for your environments.