In most cases, developers face the problem of traffic distribution between several backends when already having some running application, with a pool of existing users and constant incoming load. Thus, beside of the general traffic sharing configuration difficulties, it is additionally complicated with the necessity to apply the appropriate “on-fly” changes to the front-end application instance. In many cases, it causes a temporary app downtime. So in order to minimize such negative influence on your customers, below we’ll consider the ways to easily and painlessly integrate CirrusGrid Traffic Distributor (TD) solution into your running application topology.
Note: Traffic Distributor provides ability to benefit on a number of useful solutions, like:
To achieve this, you’ll need to pass through the following steps:
For this example, we run application in Apache server within the primary-env environment.
1. First of all, you need to set up one more environment with the same application inside (we’ll name it second-env).
Note: Don’t forget to properly configure the hardcoded data (e.g. direct links, IPs, etc) for application inside your cloned environment if such are used.
2. Now we are ready to install Traffic Distributor, specifying both these environments as backends.
Tip: If there are several environment regions available at the chosen hosting provider platform, you can subsequently migrate one of your environments to a different hardware set. This will grant better failover protection, as you’ll be able to deal with the hardware-dependent problem at one of your backends (if such occurs) by routing requests to the instance, that remained operable.
3. That’s it! Traffic Distributor is already set and ready to handle requests to our application.
The only thing that remained to do is to redirect incoming traffic from the first environment to Traffic Distributor.
If being run in production, most likely your application has some custom domain name already bound to our initial environment (primary-env in our case).
Tip: To bind a custom domain name to environment, follow one of these guides depending on used entrypoint:
For the proper redirection of requests (i.e. to process them through distributor), we need to move the appropriate entrypoint to TD environment. In such a way, it will be placed in front of the chosen pair of backends and share the incoming load among them based on specified settings. In order to accomplish this, follow one of the next simple procedures based on the used custom domain binding method:
1. Hover over the environment your custom domain is bound to (e.g. primary-env) and select Settings from the set of appeared functional icons.
2. Within the opened environment settings tab, the required Custom domains section will be displayed by default, so just select your Traffic Distributor environment within drop-down list of the Swap domains suboption.Now, click the Swap button and confirm this action within the appeared pop-up to apply the changes.
3. In a minute your application custom domain name will be moved to the environment with Traffic Distributor, so that both of your backends will become available via this domain.
The easiest way to pass Public IP from primary-env (i.e. the one your custom domain is attached to) to Traffic Distributor is using of the corresponding External Addresses Swap functionality, available through CirrusGrid CLI.
It allows to perform the required configurations in a single command, sparing you from the manual A Record reconfiguration. However, if you prefer to work via GUI, this operation can also be accomplished with a manual change of Public IP address your domain points to. For that:
1. Ensure that NGINX balancer instance in your Traffic Distributor environment has external IP address attached and get its value through the dashboard.
2. Then, re-configure your A record via DNS manager, so that it leads to this new IP address.
3. After the application entrypoint address is changed, you can detach Public IP from the initial primary-env (if it is no more required for direct access) and do not pay for the unused option.
That’s it! Now all incoming traffic for your custom domain will be processed by CirruGrid Traffic Distributor solution, which, in its turn, will route it according to the set traffic ratio between application backends.
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.