• Hello.

    We are working on a simple load balancing implementation with HAProxy that will distribute the requests between two different instances of a web server with a shared wordpress directory over NFS. The first instance works well and is always accesible, but the second instance is inaccesible, it throws Error establishing a database connection¨.

    Additional information:
    We are using NFS, that is where the shared wordpress directory is.
    We are using NGINX 1.14.1
    We are using WordPress 5.5.3
    We are using MariaDB.
    We already verified the database information in wp-config.

    I could really use any advice on how to fix this.

    The database is accesed by both instances from the same wp-config file.

    Thank you. 🙂

    • This topic was modified 5 years, 5 months ago by ipiedrahiv.
    • This topic was modified 5 years, 5 months ago by ipiedrahiv.
Viewing 1 replies (of 1 total)
  • I’d look real hard at the addressing of those two servers and their addressing relationship to each other and the database.

    This isn’t really a WordPress issue… The load balancer and its servers should appear as any other singular webserver to the client browsers and appear as any other server to the subservient WordPress.

    You probably need to ask this question in some other forum like StackExchange.

    You might instead reduce it down to serving a single HTML ‘index’ webpage from that ‘host’ and troubleshoot that from there. If it will serve the index from either server then bring the WordPress back.

    I do believe the problem is centered around the second server not seeing the database at all or the database being unavailable for some reason due to the first server tying the database up as the second tries to access it but I’d expect that to be intermittent if it was.

    I doubt the problem is the NFS directory but the HTML index page should prove that as does the database connection error from the second server… If the NFS share wasn’t working you’d have nothing running on the second server to try to connect to the database.

    I’m not real crazy about the NGinx instead of Apache but that’s my personal preference… I like Apache for WordPress with NGinx as a Proxy but that’s mostly me being stodgy.

Viewing 1 replies (of 1 total)

The topic ‘Page not reachable after load balancing’ is closed to new replies.