Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Oct 26, 2010 5:58 pm 
Offline
Newbie

Joined: Mon Oct 25, 2010 8:38 am
Posts: 2
Hello,

Took the plunge and ordered 2 512 servers to test the high availability tutorial, http://library.linode.com/linux-ha/ip-failover-heartbeat-pacemaker-drbd-mysql-ubuntu-10.04, and was going well until the end when I noticed my second node was not syncing.

A few pastebins for you:

crm_mon output - http://p.linode.com/4330 - everything working as it should

cat /proc/drbd output - http://p.linode.com/4331 - sync appears to have worked

I then checked the mounts and on node 1 it reports that the 2 images have mounted to intended location:

Code:
/dev/drbd0 /var/lib/mysql ext3 rw,relatime,errors=continue,data=writeback 0 0
/dev/drbd1 /srv/www ext3 rw,relatime,errors=continue,data=writeback 0 0


On node 2 however, they are not mounted at all.

My question is, from the tutorial, should I be performing "mkfs.ext3 /dev/drbd0" and "mkfs.ext3 /dev/drbd1" on node 2, as I get an error if I try and mount these as node1 is configured to.

Any help appreciated, feel like I'm at the last hurdle and just can't make the finish line!


Top
   
 Post subject:
PostPosted: Wed Oct 27, 2010 10:07 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
I may be talking out of my ass here, as I have limited knowledge of DRBD, but I'm pretty sure you're not supposed to mount one filesystem on both machines at the same time. That would be very bad.

You might try forcing the slave to mount the filesystem read-only, but even then you should be careful because data could change out under the software, and that's bad.


Top
   
 Post subject:
PostPosted: Wed Oct 27, 2010 11:45 pm 
Offline
Senior Member

Joined: Sat Feb 10, 2007 7:49 pm
Posts: 96
Website: http://www.arbitraryconstant.com/
Yes.

Simultaneously mounting on two hosts requires a filesystem specially designed to deal with it, like GFS or OCFS2.


Top
   
 Post subject:
PostPosted: Fri Oct 29, 2010 2:46 pm 
Offline
Junior Member

Joined: Mon Jun 27, 2005 3:40 am
Posts: 48
Correct. DRBD requires a failover mechanism in place to handle the mounting for you.


Top
   
 Post subject:
PostPosted: Wed Nov 24, 2010 2:51 pm 
Offline

Joined: Wed Nov 24, 2010 2:32 pm
Posts: 1
Location: Montreal, QC
Sorry for bringing this up late. I've had the occasion to experiment with DRBD a couple of weeks ago.

Most of the answers to your problem may be found in the DRBD manual here: http://www.drbd.org/users-guide/.
The surface reason why you cannot mount more than one node is that DRBD only allows one node to be primary by default. To allow two nodes to be primary, you need to setup a few things:

-Specify "allow-two-primaries" in drbd.conf. See http://www.drbd.org/users-guide/s-enable-dual-primary.html.
-Setup both of your nodes on a cluster.
-Implement a filesystem that allows for concurrent access, such as GFS or OCFS2. See http://www.drbd.org/users-guide/ch-gfs.html and http://www.drbd.org/users-guide/ch-ocfs2.html.

If dual primaries is not a requirement (Failover versus mirror setup),
you do not need to format or partition your drive on node2, only on node1 once. DRBD will replicate the exact configuration on the disk on node2 for you. To mount DRBD on node2, you must do the following:

-Unmount drbd on node1
-Place resource on node1 as secondary: sudo drbdadm secondary all
-Place resource on node2 as primary: sudo drbdadm primary all
-Mount drbd on node2

If you wish for the process to be automated, you should check out on monitoring software such as Heartbeat or Pacemaker. Pacemaker is less old-school, but I personally went Heartbeat since I only needed a quick way of manually switching MySQL/Apache/IP Aliasing over to the failover node whenever node1 crashes and doesn't turn back on.

Hope this helps anyone with a similar problem as well.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group