How create two WordPress nodes in two VMs and make it HA?
-
Hi Community,
Is it possible to have two WordPress instances in two different Virtual machines and share the same database and content directory? I have a WordPress website running on a Linux virtual machine with a MySQL database, which is installed in a separate VM. Now, I am trying to install another WordPress instance on another virtual machine (from a different location) to have a high-availability system. I created an NFS share, copied the wp-content directory to the NFS share, and mounted it with the first instance. I restarted Apache, and it seems to be working fine. I installed another WordPress, configured it with the same database, and mounted the wp-content directory with NFS share. The service is starting, but the issue is it’s redirecting me to the first vm. I know why it’s redirecting to the old instance; it is because the option_value of siteurl and home from the wp_options table is the old instance IP.
Do you know how I can access both instances separately? The goal is to add both instances to the load balancer for HA. I know there is a networking option within WordPress, but that won’t work since I want to have the site on two different physical servers. In that, there won’t be downtime if I patch a server, or just in case of a disaster, I will at least have one instance running. If someone can guide me, I appreciate that.
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.