Solved

Complete Server Mirroring

Posted on 2011-02-14
18
402 Views
Last Modified: 2012-06-27
I am trying to mirror a Centos OS colo server I have. I just recently rented a temp box from my data center to start this project off a bit.

Here is the problem I am running into.
I am trying to use heartbeat and DRBD on both servers to do this unless someone here can provide me a better solution.

>>We will need a fresh partition on each servers so that we can create a DRBD between both the servers on that partition. As we cannot create a DRBD on a live partition as >>it will reinitialize it and will loose the data subsequently
>>Heartbeat can be set up without much prerequisite
>>We will need an external floating IP to be set up by the DC(working by the routers) so that we can assign them to the active server as per need
>>We will need to create internal floating IPs as well, which can be done by us(we will just need an internal IP assigned as well)

Apparently my DC can't provide me with a floating ip.


How can I setup the mirroring. Even if I had two servers in different locations how can I set this up

0
Comment
Question by:sobeservices2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
18 Comments
 
LVL 5

Accepted Solution

by:
stermeau earned 72 total points
ID: 34888834
Hi,

You can install and run DRBD without a floating IP.
The floating is used to have an automatic failover mechanism.
What are you looking for exactly? Is it just a mirror or an hot standy you are trying to setup?
Regards
0
 

Author Comment

by:sobeservices2
ID: 34888916
What do you mean hot stand?

I am trying to set it up as an automatic failover.

This is what one fourm told me

"We will need the floating ip in order to setup heartbeat and drbd on both servers and an alternative to floating ip will be to setup NAT redirection in the iptables which is too complicated and may not work desirably. Also in the event of one server going down, NAT would start not working. In the sense, we need a floating ip to work this drdb and heartbeat."

If I can't get a automatic failover I could I guess use mirroring and if Server A were to fail manual switch to B
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 428 total points
ID: 34888921
You might want to consider the Andrew FS as an alternative to DRBD.

presumably the only thing you would mirror is the data

Are you looking at the centos clustering setup that will move DC provided IP from one node to the other?
The problem is you would have to have access to three IPs or depending on your provider have a private IP between the two server and the DC provided IP as a cluster resource.  The problem though is that as part of the cluster configuration you would need to run a route add script to add the correct routing rules to the active node when the DC provided IP is allocated.
It also depends on what services your system provides.
mysql backend could be setup with master/master replication.
the options are limitless to achieve what I think you want, but depend on what options are available to you from the DC.  
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:sobeservices2
ID: 34889055
Well my DC said they could provide DRBD that wouldn't be a problem but the floating ip would be sense they are on two different networks.

I am looking for exact 1 to 1 mirroring both boxes have Centos os right now and both boxes have cpanel. So I would want a exact 1 to 1 mirroring going on.

But my devices (servers) are in two separate locations. One's at a DC and one is in house small business office with comcast internet and 5 statics.

Current Server A is Main
Server B is a temp sever

I want to mirror these devices as the first step. The in house server will come in play later down the road.


Usage of the server are for web/email and mysql

0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 428 total points
ID: 34891655
The two being in separate location the only way to have a floating IP is if you obtain a range from arin.net and then have BGP peering with your providers such that you would control the advertisement of your IP blocks and by extension which server is accessed when someone uses yourip w.x.y.z

Mirroring The server when they are in different location would mean/suggest that the only thing that is mirrored are the data files for the application while the two are functional on their own.

DRBD might be a bandwidth hog and might not be suitable for linking servers in separate locations depending on the cost of data transfer since you'll be paying twice once for the outgoing traffic on one and once for the incoming traffic on the other.

In your situation the only way to control which server is accessed the DC or the  Home, is via DNS control i.e. www.yourdomain.com points to DC_ip. once the DC server is down, you would alter the DNS record for yourdomain.com to now point the www.yourdomain.com to your Comcast static IP.
You could have both listed with a short TTL i.e. 60 seconds such that the request will be DNS distributed (DNS loadbalancing)

0
 

Author Comment

by:sobeservices2
ID: 34892137
OK could I have DRBD setup in a mirrior

Server A - DC
Server B - inhouse

I would change change the NS server information in the event that something fail and traffic would be directed to new server????

Is this correct?


But the DRBD would contently keep these two devices in sync?

Also could I control the DRBD between the two maybe sync on a different type of schedule instead of instant sync to keep bandwidth down if I had to ????
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 428 total points
ID: 34892748
There is an Async option in DRBD, but you run the risk that you switch from one to the other while the data did not propagate.  You also need to determine what you will put on the DRBD volume and what you would replicate through other means.
I.e. database file might be better replicated via the application layer versus via drbd.
etc.
0
 

Author Comment

by:sobeservices2
ID: 34892792
I want mysql replicated , website data, and email

Humm not sure what to do now. confused
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 428 total points
ID: 34892876
mysql replication should be Application level which will provide the option of loadbalancing the access i.e. either side can be accessed and work. DRBD would mean that prior to switching you would need to start mysql and change the DRBD replication direction.

DRBD can be where the web pages are stored as well as the emails provided you are using a Maildir format  (each message in its own file) rather than a mailbox (single file for each user).

0
 

Author Comment

by:sobeservices2
ID: 34892967
How do I know if I am using Maildir. I use cpanel?

0
 

Author Comment

by:sobeservices2
ID: 34892971
How about replication of settings for spam program assp and cfs firewall?
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 428 total points
ID: 34893459
you could use rsync since you can not have /etc/ on a replicating volume since most of your system settings are there. If you configure your anti-spam to reference the rules from a different directory than you can use drbd or Andrew FS (AFS) or you can have the rules within a mysql table.
Cpanel is the GUI based system manager tool, what is the backend mail server: sendmail, postfix, exim, qmail, etc. where are the emails stored? Look within that directory structure to see if it has the forma directory_name with new, cur and tmp subfolders where new and cur have individual message files.
0
 

Author Comment

by:sobeservices2
ID: 34897019
Ok here is what I think I am going to do

Server A (main server old) called domain1.com
NS Server - ns1/ns2 domain1.com
8 Statics for about 8 websites

Server B (temp server) called domain2.com
NS Server - n1/n2 domain2.com
8 Statics for about 8 websites

What I think I am going to do first is copy all the information from Server A to Server B which I already have done.
Setup a DRBD between both servers.
I guess I will not be able to have failover but atleast I will have both servers syncing content websites/ email/ cpanel stuff / spam settings/ mysql/ etc

Sence Server A will have a different ns domain name as server B
When I get ready to pull Server A out I will switch the NS in my register to the name server of server B

Run off of server B till I get a chance to build my new server up. Once I have built my new serve up with Centos OS 5.5 64 bit and cpanel.
I will also place DRBD on the new server.

Could I then manually copy the data and settings from temp Server B over to the new server?
Or can I use DRBD to copy and mirror the stuff back over?

Once everything is copied to new server which I will assign the same domain name ns info of the server I just pulled offline.
I will have the new server fully operational and ready

Then I will go back into the register settings and change the ns server to point back to the new box.

Please advise and make suggestions on the above and let me know if this is an easy doable solution
0
 
LVL 78

Expert Comment

by:arnold
ID: 34897133
DRBD needs available unallocated/unused space on the local harddrive.
Are currently server A and server B production?

I'd recommend you setup two servers as you think you would server A and serverB and test your procedure.

You could use VM to test this setup with VMWARE or VirtualBox.
0
 

Author Comment

by:sobeservices2
ID: 34897303
Currently Server A is production but will not have the DRBD. Server B is not production yet but will add DRBD to the device and the new server down line
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 428 total points
ID: 34898088
You should test the implementation that you are envisioning so that you know the approximate bandwidth/other issues that might come up.
IMHO, application level replication should be used when possible especially with mysql (note monitoring is needed to make sure the replication is functioning and issues can be detected early) this way you can load balance since you could write and read from either database server.

The optimal solution could revolve around implementing different features for different items.
Have a look at the Andrew FileSystem (AFS) and see whether file replication is better than the low level block replication that DRBD is offering in some cases it is and in some cases it is not.
0
 

Author Comment

by:sobeservices2
ID: 34899385
Ok thanks guys..

IMHO what does this mean?

I will look more into AFS lots of commits about that I've only gone into detail on DRBD
Could I use a little of both maybe???
0
 
LVL 78

Expert Comment

by:arnold
ID: 34900059
In My Humble Opinion.

You could use AFS and DRBD but simplification if available is encouraged.
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question