0

i currently have a VirtualHost configured to load balance between 2 servers. however, to avoid race conditions that occur when both instances are active, i would like to switch to a hot/warm configuration where the second server is only used when the first server goes down. how can i configure that in my http.conf file?

here is my current VirtualHost config:

<VirtualHost *:8080>
    Header set Access-Control-Allow-Origin "*"
    ServerName redacted.example.com
    ProxyPreserveHost On

    <Proxy balancer://mycluster>
             BalancerMember http://10.0.0.1:8080
             BalancerMember http://10.0.0.2:8080
      </Proxy>
    ProxyPass / balancer://mycluster
    ProxyPassReverse / balancer://mycluster
</VirtualHost>

side notes: i would prefer to use apache httpd for this task, but i might consider other technologies if apache can't handle it. i am not sure i have the right terminology to describe a "alpha only if beta down" situation (e.g. hot/warm, failover, load balance)

0

apparently, the terminology i'm looking for is "hot standby". here is the appropriate config (note the status=+H):

<VirtualHost *:8080>
    Header set Access-Control-Allow-Origin "*"
    ServerName redacted.example.com
    ProxyPreserveHost On

    <Proxy balancer://mycluster>
             BalancerMember http://10.0.0.1:8080
             BalancerMember http://10.0.0.2:8080 status=+H
      </Proxy>
    ProxyPass / balancer://mycluster
    ProxyPassReverse / balancer://mycluster
</VirtualHost>

here is the relevant bit from the documentation:

status - Single letter value defining the initial status of this worker. [...] H: Worker is in hot-standby mode and will only be used if no other viable workers are available.

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.