2-Node drbd.conf

From Alteeve Wiki
Jump to navigation Jump to search

 AN!Wiki :: How To :: 2-Node drbd.conf

This drbd.conf file relates to the 2-Node CentOS5 Cluster HowTo.

Detailed drbd.conf

#
# please have a a look at the example configuration file in
# /usr/share/doc/drbd83/drbd.conf
#

# This directive controls global settings. It should be the first directive in
# this configuration file.
global {
	# This is an optional argument that let's the folks at Linbit count you
	# as a user of DRBD. This can be turned off by changing this value to
	# 'no'.
	usage-count yes;
}

# The values here are inherited by any resources configured below.
common {
	# Protocol dictates what DRBD considers to be a "completed write".
	# There are three options;
	# A;
	#    A write is considered complete once the data has been written to
	#    the node's local disk and has been sent to the TCP send buffer.
	#    This option provides the highest performance with the greatest
	#    risk in case of a sudden node failure. Use with caution.
	# B;
	#    Like A, but instead waits for the data to reach the remote node's
	#    TCP receive buffer before reporting completed write. This is a
	#    balance of performance and safety, but can still cause problems if
	#    both nodes lose power simultaneously before the write is committed
	#    to disk on the remote node(s). Use with caution.
	# C;
	#    This is the slowest but safest option. It will not report a
	#    completed write until the data has reached both the local and
	#    remote disk(s). This is required for Primary/Primary mode and for
	#    cluster aware file systems like cluster-enabled LVM. Strongly
	#    suggested.
	protocol C;
	
	# 
	syncer {
		rate 33M;
	}
}

# This is an example of a resource directive. There will be a named resource
# directive for each DRBD device you want to create. Options set in the
# 'common' directive are inherited here. Each resource must have at least two
# 'on' directives which indicate what device on each node that this resource
# will be created on. This example shows a resource call 'r0'. You can name a
# resource pretty much anything you want.
resource r0 {
	# This is the name of the device that will be created for this
	# resource. You will use this device to access the DRBD partition,
	# NOT the underlying block devices specified in the 'disk' arguments
	# below.
	device    /dev/drbd0;
	
	# 
	net {
		allow-two-primaries;
	}
	
	# See 'man 8 drbdsetup'.
	startup { 
		become-primary-on both;
	}
	
	# This tells DRBD where to store the meta-disk data for the DRBD array.
	# This is usually set to 'internal' which means that some space is
	# set aside at the end of the device. However, if you have multiple
	# DRBD devices, you may with to set this to a specific partition. In
	# that case, the partition needs to be at least 256MB. Optionally, this
	# argument can be replaced by 'flexible-meta-disk', in which case you
	# will need to specify a specific partition and the size needed will be
	# ((36kb+(DRBD data size))/32kb), rounded up to the next even 4kb size.
	meta-disk	internal
	
	#######################################################################
	# The options below are used when you want to set the same values to  #
	# two or more 'on' subdirectives. Using these options enables the use #
	# of the 'floating' subdirective in the place of 'on' subdirectives.  #
	#######################################################################
	
	# This defines a common block device to use on nodes without an
	# explicitely defined 'disk' argument.
	#disk		/dev/an_lvm01/lv02
	
	# The 'floating' argument can be a simple argument style or a
	# subdirective defining different configuration options from the above
	# shared values. When used, it replaces the corresponding 'on'
	# subdirective. Here are two examples showing both methods of using it:
	#floating 10.0.0.72:7789;
	# and/or:
	#floating 10.0.0.72:7789 {
	#	disk		/dev/an_lvm02/lv02;
	#}
	# As with 'on', two or more 'floating' and/or 'on' arguments must be
	# used.
	
	#######################################################################
	# The 'on' subdirectives tell DRBD which nodes have which devices to  #
	# use in the DRBD array.                                              #
	#######################################################################
	
	# This is the first 'on' subdirective. The name after the 'on' syntax
	# MUST be the name returned by 'uname -r' on the given node.
	on an_node01.alteeve.com {
		# This is the IP address that the name above resolves to. Be
		# sure that this IP is to one on your DRBD subnet and
		# corresponds to your desired ethernet device.
		address		10.0.0.71:7789;
		
		# Note that if you are not using IPv4, you will need to specify
		# the address type between the 'address' argument and the value
		# like so:
		#address ipv6	[::f38a]:7789;
		# Valid types are:
		# ipv4		Default, not required
		# ipv6		Address must be in square-brackets
		# ssocks	<example>
		# sci		This is depracated and aliases to ssocks
		# sdp		<example>
		
		# This is the raw block device that will be used on this node.
		# If a common 'disk' is defined above and it matches the disk
		# to use on this node, this can be left out.
		disk		/dev/an_lvm01/lv02;
	}
	
	# This is the second node's 'on' subdirective. As with above, the name
	# given MUST match the name returned by 'uname -n' on this node.
	on an_node02.alteeve.com {
		address		10.0.0.72:7789;
		disk		/dev/an_lvm02/lv02;
	}
}

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.