How to host one Wordpress site on two locations?

Terrance

Member
Registered
Joined
Jun 30, 2016
Messages
33
Points
0
This is just my idea to help my wordpress site uptime 100% when one of locations goes offline. It is possible to achieve that, for example the site loads from location A if the location B goes offline it will use the location A is online. For the database, when I add a new post it gets added on both servers.
 

VirtuBox

Well-known member
Registered
Joined
May 3, 2016
Messages
1,622
Points
83
In a first time you can create a database replication, to have two databases running with the same data. ->
https://www.howtoforge.com/tutorial/replicating-a-master-database-using-mariadb-10/
But to have a website running in complete replication, you have to use a load-balancing, to handle and route the traffic in the two servers, and to redirect to only one in case of failure. it require 2 IP and another server to be the router with a proxy like squid or varnish.

That's pretty hard to setup. My advice will be : try to optimize your server to handle traffic (nginx, php7, mariadb, redis etc ...) and you should not have more than 5 minutes of downtime per year.
 

KevinHV

Member
Registered
Joined
Sep 8, 2016
Messages
57
Points
8
Hello

You must have 2 shared hosting account or VPS with shell access. So that you can use rsync data from Server A to B . You can also set interval time between two servers. After that specific time, your data will be copied to other server. By this way you can keep data of same website on 2 locations.
 

UWH-David

Member
Registered
Joined
Jan 18, 2016
Messages
45
Points
8
You can do this many different ways. You can round robin via DNS, failover via DNS or setup load balancing. A quick and easy way to set this is up via nginx and its load balancer /upstream option or Apache mod_proxy_balancer.
 

hynds

Well-known member
Registered
Joined
Aug 30, 2016
Messages
165
Points
18
I think the easiest way is using sync service between your 2 locations. This way will keep your source and database in 2 locations. However you only have 1 domain pointing to 1 location, so that you need also to config it automatically points to the 2nd location if the 1st is down. I think this is a hard process to do, and you need research carefully before taking action.
Good luck to you,
 

UWH-David

Member
Registered
Joined
Jan 18, 2016
Messages
45
Points
8
Agreed. In our experience creating a cron for rsync along with utilizing Tungsten replicator for mySQL as it has a better system for error checking and timeouts was the easiest and most reliable to accomplish this when using round-robin or load-balancing. Tungsten is very versatile with other database systems as well and is up to version 4.0. Here is some great documentation on the method:
www.percona.com/blog/2015/05/04/keep-your-mysql-data-in-sync-when-using-tungsten-replicator/
code.google.com/archive/p/tungsten-replicator/

I think the easiest way is using sync service between your 2 locations. This way will keep your source and database in 2 locations. However you only have 1 domain pointing to 1 location, so that you need also to config it automatically points to the 2nd location if the 1st is down. I think this is a hard process to do, and you need research carefully before taking action.
Good luck to you,
 

webhoster

New member
Registered
Joined
Jul 23, 2016
Messages
8
Points
0
This is just my idea to help my wordpress site uptime 100% when one of locations goes offline. It is possible to achieve that, for example the site loads from location A if the location B goes offline it will use the location A is online. For the database, when I add a new post it gets added on both servers.
Hi Terrance,

You can use Cloudflare, it caches your website pages and keeps it on globally distributed network of servers. When your site goes offline, it shows pages from cache on its server.

When a visitor visits your website in browser, it will show your website pages from nearest cloudflare server, this makes your website faster.

If you keep your website on many servers you will have to manage updates in all pages and database on all servers. With cloudflare, you don't need to manage each and every copy of your website.
 
Older Threads
Latest Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top