0

i've read here:

Wordpress Installation on Two Servers - Loadbalancing

and here:

https://www.quora.com/How-do-I-load-balance-on-WordPress-with-2-LAP-web-servers-and-1-Mysql-DB

none of the links addresses the following issue:

You go to server1, press "install plugin foobar" now server1 downloads files for plugin foobar. It makes DB changes for plugin foobar. But on server2, foobar files are not available. I cannot even make sure to be accessing server2 from the web as I get randomly dropped on server1 or server2.

Another problem: Plugin updates.

I go to server1 and press "update" on plugin foobar v1.0. It gets updated on server1 to v9.0. The plugin update, performs db changes as well. On server2 we still have the files from v1.0. Not good. Even if I manage to access server2, won't it be in a faulty state? that is: db from v9.0 and files from v1.0. The Plugin update might eventually not even work with this state, so it could be that I cannot update well foobar v1.0 to v9.0 on server2 once i reached the server.

Toskan
  • 115
  • 2
  • 2
  • 9
  • Can you please let us know 1. Servers? Windows or Linux, 2. How are they hosted, 3. how are you load balancing the site? 4. What file replication are you using? 5. What database product are you using? – Anthony Fornito Dec 02 '16 at 17:59
  • Options 1) Put Wordpress on a shared file system 2) Sync that wp-content directory between machines 3) Open two browser tabs, address the individual servers by IP, and update them at the same time. – Tim Dec 03 '16 at 20:16
  • @AnthonyFornito they are hosted on AWS. As I understand, round robin. database is mysql and it is shared. File replication we aren't using any – Toskan Dec 05 '16 at 18:44
  • @Tim option 3 would lead to both servers trying to perform the same actions on the DB, thus resulting at best with an error on one server. – Toskan Dec 05 '16 at 18:46
  • Good point. With option 3 probably best to update one then the other, as I suspect if the DB version shows it's up to date it won't bother doing it again. This would need testing. Putting Wordpress on shared storage would probably be better. Wordpress isn't really made to scale. – Tim Dec 05 '16 at 18:49
  • option 1 and 2. Wordpress has something called "automatic update" that is, security updates are applied automatically, and for good reason. When having 2 servers or more sharing a file system, and both get the notification to perform an update at the same time, one might break the DB (db changes at the same time) and break file sync maybe (both change file at the same time). It's at best suboptimal. What I thought is sync everything except `wp-config.php` so i can disable automatic update in `wp-config.php` on all server except one – Toskan Dec 07 '16 at 19:55

0 Answers0