Constant 500 Server Errors
-
I can’t seem to make this plugin work, and I can’t seem to find any similar support issues/discussions. In addition, it seems this particular plugin gets very little replies when people have problems, so I am shooting in the dark and hoping for something…
I have a configuration like this:
1. Load balancer using tcp balancing
2. 3 application servers (ubuntu 14.04, php7.0-fpm, etc.)
3. 1 Master Percona(MySQL 5.6)
4. 1 Slave Percona(MySQL 5.6)Slave server is configured to replicate from master, and it is working perfectly as expected.
My load balancer works perfectly to balance traffic among the 3 app servers. All three app servers can connect to the database servers without issue. I have manually tested via terminal from all three app servers.
App servers have a Read/Write user that can connect to the Master DB server. App servers have a Read-Only user that can connect to the Slave DB server.
I have WordPress 4.4.1 running on the app servers using Gluster and the site is working perfectly, as long as I only connect with the Master DB. It is when I try to add HyperDB and distribute reads/writes to their appropriate DB that problems arise.
My wp-config defines the master DB host and slave DB host. It also defines the users and their respective passwords. I have tried the following scenarios:
1. Use only 1 username/pw combo for both db servers with full privileges
2. Use 2 username/pw combos for each server (which i truly want because readonly has read only access to the particular db)I have tried configuring the hosts using their hostname (properly set in /etc/hosts on all servers and tested multiple times to ensure no networking issues).
I have tried configuring the hosts using their private IP addresses, and even port 3306, just in case that was an issue.
I have tried even using only the master db server as both the read/write and the read-only server. I have tried using the slave db server as the read/write and read-only server (making sure to restore all db back to sync with master so we are not out of sync or having corrupt tables).
Here is my experience:
1. When I run the WordPress site using normal setup (standard config and only 1 db connection) everything works perfectly. Can browse the site, can edit/save pages and posts, can install, delete plugins, etc. Everything works 100% as expected. Whether I connect to the Master or Slave DB server.
2. When I add db.php to the /wp-content folder to activate HyperDB, I get 2 outcomes:
a. Either I can see the static homepage with out-of-date information, but when I try to access /wp-admin I get 500 server error
b. I get 500 server error on all pagesI have tried to define the hosts in db-config.php with many settings. Currently it is:
$wpdb->add_database(array(
‘host’ => ‘xxx.xxx.xxx.xx’,
‘user’ => ‘user’,
‘password’ => ‘password’,
‘name’ => ‘db-name’,
‘write’ => 1,
‘read’ => 1,));
$wpdb->add_database(array(
‘host’ => ‘xxx.xxx.xxx.xx’,
‘user’ => ‘user’,
‘password’ => ‘password’,
‘name’ => ‘db-name’,
‘write’ => 0,
‘read’ => 1,
));*note – I have omitted the ip addresses, username, pw, and db-name to protect the security of our system. They are correctly in the file. At present trying to hard-code them to db-config to override wp-config. I have also tried setting them as variables and then defining them in wp-config.
No matter what I do, how much I check connections, networking, wp-config, db-config, caching setting, etc. NOTHING WORKS. All I get is 500 server errors from HyperDB.
Any ideas?
- The topic ‘Constant 500 Server Errors’ is closed to new replies.