Hi and thanks for the answer !<div><br></div><div>I got several pm urging me NOT to use active/active and OCFS2.</div><div><br></div><div>A more simpler active/passive and no OCFS2 would be the best choice.... Too many things could go wrong with OCFS2 and active/active + MySQL.</div>
<div><br></div><div>But you fully understood my configuration and thanks for your help.</div><div>My drbd.conf is almost like the one you sent me.</div><div><br></div><div>But in my case, i must have another problem.... it's not working.</div>
<div><br></div><div>One more question. I have 2 ethernet ports. eth1 is used to link both boxes together. </div><div>Should i use for DRBD + Heartbeat a different IP address and class than on eth0 which is on the LAN ? </div>
<div><br></div><div>Patrick<br><br><div class="gmail_quote">2011/4/22 Digimer <span dir="ltr"><<a href="mailto:linux@alteeve.com">linux@alteeve.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 04/22/2011 01:36 PM, Patrick Egloff wrote:<br>
> Hi all,<br>
><br>
> First of all, let me say that i'm a newbie with DRBD and not a high<br>
> level linux specialist...<br>
<br>
</div>Few are. Fewer still who claim to be. :)<br>
<div class="im"><br>
> I want to have a HA setup for my Intranet which is using PHP + MySQL.<br>
> (Joomla 1.6)<br>
><br>
> For that, i have 2 DELL servers with 5 HD RAID on which i installed a<br>
> CentOS 5.5 with<br>
><br>
> I tried to install OCFS2, DRBD and Heartbeat as active/active. I'm at<br>
> the point where i can access to my drbd partition /sda6, but i can't<br>
> make both boxes talk together.<br>
> I do have some errors will loading :<br>
> - mount.ocfs2 (device name specified was not found while opening device<br>
> /dev/drbd0)<br>
> - drbd is waiting for peer.... and i have to enter "yes" to stop the process<br>
><br>
> After reading a lot, i'm not even sure anymore if my first project is<br>
> the right choice...<br>
><br>
> Is the configuration i planned the best one for my usage or should i<br>
> change my plans for another setup with same result, that is high<br>
> availibility ?<br>
><br>
> If it makes sense to continue with drbd , i will be back with some<br>
> questions about my problems...<br>
><br>
><br>
> Thanks,<br>
<br>
</div>I can't speak to heartbeat or OCFS2, as I use RHCS and GFS2, but the<br>
concept should be similar. Aside from that, those are questions above<br>
DRBD anyway.<br>
<br>
First, your RAID 5 is done in hardware, so CentOS only sees /dev/sda,<br>
right? Second, Partition 6 is what you want to use as a backing device<br>
on either node for /dev/drbd0? If you want to run Active/Active, then<br>
you will also want Primary/Primary, right?<br>
<br>
Given those assumptions, you will need to have a drbd.conf similar to<br>
below. Note that the 'on foo {}' section must have the same hostname<br>
returned by `uname -n` from either node. Also, change the 'address' to<br>
match the IP address of the interface you want DRBD to communicate on.<br>
Lastly, make sure any firewall you have allows port 7789 on those<br>
interfaces.<br>
<br>
Finally, replace '/sbin/obliterate' with the path to a script that will<br>
kill (or mark Inconsistent) the other node in a split-brain situation.<br>
This is generally done using a fence device (aka: stonith).<br>
<br>
Line wrapping will likely make this ugly, sorry.<br>
<br>
====<br>
#<br>
# please have a a look at the example configuration file in<br>
# /usr/share/doc/drbd83/drbd.conf<br>
#<br>
<br>
# The 'global' directive covers values that apply to RBD in general.<br>
global {<br>
# This tells Linbit that it's okay to count us as a DRBD user. If you<br>
# have privacy concerns, set this to 'no'.<br>
usage-count yes;<br>
}<br>
<br>
# The 'common' directive sets defaults values for all resources.<br>
common {<br>
# Protocol 'C' tells DRBD to not report a disk write as complete until<br>
# it has been confirmed written to both nodes. This is required for<br>
# Primary/Primary use.<br>
protocol C;<br>
<br>
# This sets the default sync rate to 15 MiB/sec. Be careful about<br>
# setting this too high! High speed sync'ing can flog your drives and<br>
# push disk I/O times very high.<br>
syncer {<br>
rate 15M;<br>
}<br>
<br>
# This tells DRBD what policy to use when a fence is required.<br>
disk {<br>
# This tells DRBD to block I/O (resource) and then try to fence<br>
# the other node (stonith). The 'stonith' option requires that<br>
# we set a fence handler below. The name 'stonith' comes from<br>
# "Shoot The Other Nide In The Head" and is a term used in<br>
# other clustering environments. It is synonomous with with<br>
# 'fence'.<br>
fencing resource-and-stonith;<br>
}<br>
<br>
# We set 'stonith' above, so here we tell DRBD how to actually fence<br>
# the other node.<br>
handlers {<br>
# The term 'outdate-peer' comes from other scripts that flag<br>
# the other node's resource backing device as 'Inconsistent'.<br>
# In our case though, we're flat-out fencing the other node,<br>
# which has the same effective result.<br>
outdate-peer "/sbin/obliterate";<br>
}<br>
<br>
# Here we tell DRBD that we want to use Primary/Primary mode. It is<br>
# also where we define split-brain (sb) recovery policies. As we'll be<br>
# running all of our resources in Primary/Primary, only the<br>
# 'after-sb-2pri' really means anything to us.<br>
net {<br>
# Tell DRBD to allow dual-primary.<br>
allow-two-primaries;<br>
<br>
# Set the recover policy for split-brain recover when no device<br>
# in the resource was primary.<br>
after-sb-0pri discard-zero-changes;<br>
<br>
# Now if one device was primary.<br>
after-sb-1pri discard-secondary;<br>
<br>
# Finally, set the policy when both nodes were Primary. The<br>
# only viable option is 'disconnect', which tells DRBD to<br>
# simply tear-down the DRBD resource right away and wait for<br>
# the administrator to manually invalidate one side of the<br>
# resource.<br>
after-sb-2pri disconnect;<br>
}<br>
<br>
# This tells DRBD what to do when the resource starts.<br>
startup {<br>
# In our case, we're telling DRBD to promote both devices in<br>
# our resource to Primary on start.<br>
become-primary-on both;<br>
}<br>
}<br>
<br>
# The 'resource' directive defines a given resource and must be followed<br>
by the<br>
# resource's name.<br>
# This will be used as the GFS2 partition for shared files.<br>
resource r0 {<br>
# This is the /dev/ device to create to make available this DRBD<br>
# resource.<br>
device /dev/drbd0;<br>
<br>
# This tells DRBD where to store it's internal state information. We<br>
# will use 'internal', which tells DRBD to store the information at the<br>
# end of the resource's space.<br>
meta-disk internal;<br>
<br>
# The next two 'on' directives setup each individual node's settings.<br>
# The value after the 'on' directive *MUST* match the output of<br>
# `uname -n` on each node.<br>
on <a href="http://an-node01.alteeve.com" target="_blank">an-node01.alteeve.com</a> {<br>
# This is the network IP address on the network interface and<br>
# the TCP port to use for communication between the nodes. Note<br>
# that the IP address below in on our Storage Network. The TCP<br>
# port must be unique per resource, but the interface itself<br>
# can be shared.<br>
# IPv6 is usable with 'address ipv6 [address]:port'.<br>
address <a href="http://192.168.2.71:7789" target="_blank">192.168.2.71:7789</a>;<br>
<br>
# This is the node's storage device that will back this<br>
# resource.<br>
disk /dev/sda6;<br>
}<br>
<br>
# Same as above, but altered to reflect the second node.<br>
on <a href="http://an-node02.alteeve.com" target="_blank">an-node02.alteeve.com</a> {<br>
address <a href="http://192.168.2.72:7789" target="_blank">192.168.2.72:7789</a>;<br>
disk /dev/sda6;<br>
}<br>
}<br>
====<br>
<font color="#888888"><br>
--<br>
Digimer<br>
E-Mail: <a href="mailto:digimer@alteeve.com">digimer@alteeve.com</a><br>
AN!Whitepapers: <a href="http://alteeve.com" target="_blank">http://alteeve.com</a><br>
Node Assassin: <a href="http://nodeassassin.org" target="_blank">http://nodeassassin.org</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Patrick Egloff - TK5EP<br>email : <a href="mailto:pegloff@gmail.com" target="_blank">pegloff@gmail.com</a><br>
</div>