Redirecting admin url traffic to a particular load balancer

By Ankit Sahu

Current Setup:
I’ve two load balancer each containing EC2 instances from different regions. Primary region has Read-write DB & secondary has read-only replica of primary DB.

There are also 2 record sets in Route 53 which are configured with load balancer such that whenever a user hits my website, the traffic is distributed among these two load balancer in 70:30

Why I’m opting for read-only? so that i just have to update one DB and the changes are synced across the slaves.

When I update my website with admin url, there is a 30% chance that I am connected to the read-only DB, hence I’ll get server error as the DB gets locked.

What I’m looking for:
Is it possible to route my traffic to the read-write DB whenever someone accesses admin url, should always hit my primary server, so that the any write operation is done in my read-write DB only.

I’m using Apache server with mysql DB.

Thank you.

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273