Linux Project
-
I want to do a Linux project, I want to have 2 CentOS7 Servers and have DNS load balance, or provide failover, assuming one of the boxes fails.
-
How do I have 2 linux boxes "sync" so there identical. They will have a full LAMP stack, and WordPress installed.
-
How do I configure DNS to rotate between them, however if ones fails, just load the working one?
-
-
Truly identical you do with DRBD.
-
@Aaron-Studer said:
- How do I configure DNS to rotate between them, however if ones fails, just load the working one?
That depends. Do you want to make them into a single, HA system? If so, configure DRBD and Pacemaker and turn them into a cluster.
The NORMAL way to do this is to not do it at all. You just put both DNS entries into your DNS setup and your systems automatically try one then the other if the first one fails. No DNS level setup to do at all. DNS is naturally redundant.
-
Why are you running DNS on your web servers?
-
@scottalanmiller said:
Why are you running DNS on your web servers?
I am not, I am using cloudflare, can cloudflare do that for free?
-
@scottalanmiller said:
Truly identical you do with DRBD.
Didn't want to do anything that highend. A once daily sync would be fine, I just don't want the site to be down. Since I am using wordpress could I just sync the DB? Any maybe sync the files using rSync?
-
@Aaron-Studer said:
@scottalanmiller said:
Truly identical you do with DRBD.
Didn't want to do anything that highend. A once daily sync would be fine, I just don't want the site to be down. Since I am using wordpress could I just sync the DB? Any maybe sync the files using rSync?
You could setup a cron job to take a wordpress backup and a cron job on the second one to import the backup. Not the most elegant way to do it though.
-
@Aaron-Studer said:
@scottalanmiller said:
Truly identical you do with DRBD.
Didn't want to do anything that highend. A once daily sync would be fine, I just don't want the site to be down. Since I am using wordpress could I just sync the DB? Any maybe sync the files using rSync?
Then Rsync. The answer is always Rsync with UNIX.
-
Remember that a database has its files open, always. So you can't sync them. You have to backup and restore them. Nothing can sync an open file.
-
@scottalanmiller will rsync ruin my DB?
-
-
If you want a full-on MySQL cluster...
-
So in that case it would be a 2 part job, 1 sync WP directory. 2 backup \ restore DB?
-
@Aaron-Studer said:
So in that case it would be a 2 part job, 1 sync WP directory. 2 backup \ restore DB?
You can do it that way.... three steps...
- Backup
- Sync
- Restore
-
You could do something like this and have it store to something both can access: http://jamieflarity.com/computers/how-to-backup-your-wordpress-database-and-files-without-a-plugin/ then just do a cronjob to import the sql.gz on the second server
-
Or you could cluster the MySQL instances. It is pretty rare that you would want to protect a system anywhere but at the application level. The idea that you do it somewhere beneath the apps themselves is a notion that vendors like VMware try to push to SMB clients who don't understand that apps needs to replicate themselves and can do so far better than the platform can.
-
Hm..... Just found this....
-
So want I am thinking about doing is running a server at home and on C@C, and having them in sync. then if ether one goes down, no problem.
-
@Aaron-Studer said:
So want I am thinking about doing is running a server at home and on C@C, and having them in sync. then if ether one goes down, no problem.
That mostly makes sense. Dealing with the dynamic IP address of your house is the pain. But this doesn't explain the DNS thing.
-
How do I setup cloudflare to point to 2 ip addresses?