0

Is it possible to configure apache server (using proxy mod for example) so that it works with blue/green (all trafic to one server, if its down we redirect to the other one) or canary (for example 10% users are redirected to A server, while others to B server) deployment strategies? Or, if it's not possible with apache, how can i achieve this? I know apache can work like a simple load balancer (same amount of requests to each app-server). My app architecture looks like this (without any balancing): apache -> app-server(wildfly).

0

Yes, you can do that with Apache load balance please refer below url.

apache load balancer server backup

if your willing to use another technology , my recommendation is Nginx. Because, it's really simple.

your 1st question is --> all trafic to one server, if its down we redirect to the other one

yes, you can do that using Nginx with backup connection. in that case one of the server marked as a backup server and does not receive requests unless other server is unavailable.

upstream app_server 
{

       server 10.10.10.1:8080;
       server 10.10.10.2:8080 backup;
}


server {

        listen 80;
        server_name example.com;

        location / {

                proxy_pass http://app_server;

        }
}

your second question is --> you can do that with Nginx + Server Weights

upstream app_server 
{

       server 10.10.10.1:8080;
       server 10.10.10.2:8080 weight=9;
}


server {

        listen 80;
        server_name example.com;

        location / {

                proxy_pass http://app_server;

        }
}

With this configuration of weights, out of every ten requests, nine are sent 10.10.10.2 (server B) and one to 10.10.10.1 (server A)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.