<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DRDB Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/drdb/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 18 Sep 2018 07:46:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Installing and configuring a DRBD cluster in CentOS 7</title>
		<link>https://www.osradar.com/installing-and-configuring-a-drbd-cluster-in-centos-7/</link>
					<comments>https://www.osradar.com/installing-and-configuring-a-drbd-cluster-in-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Tue, 14 Aug 2018 04:13:51 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[DRDB]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=5297</guid>

					<description><![CDATA[<p>The backup of information is vital within a computer network, which is why fast, efficient and scalable solutions are required to meet this objective. DRBD is a software that allows you to replicate the data of a partition between several machines. which is excellent for always having a backup of the information. Installing DRBD 1.-Installing DRBD [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/installing-and-configuring-a-drbd-cluster-in-centos-7/">Installing and configuring a DRBD cluster in CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The backup of information is vital within a computer network, which is why fast, efficient and scalable solutions are required to meet this objective.</p>
<p><strong>DRBD</strong> is a software that allows you to replicate the data of a partition between several machines. which is excellent for always having a backup of the information.</p>
<h2>Installing DRBD</h2>
<h3>1.-Installing DRBD packages on both server</h3>
<p>The first thing to do is to install DRDB on both nodes. To do this it is necessary to enable an external repository called ELRepo where we will download the necessary packages. We need to be root user, so open a terminal and type sudo -i, enter your password and we&#8217;ll have admin permissions.</p>
<pre class="">:~# sudo -i</pre>
<figure id="attachment_5298" aria-describedby="caption-attachment-5298" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5298" src="https://www.osradar.com/wp-content/uploads/2018/08/1-3.png" alt="1.- Getting root access" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/1-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/1-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/1-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/1-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/1-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/1-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/1-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5298" class="wp-caption-text">1.- Getting root access</figcaption></figure>
<p>Now we proceed to enable the repository:</p>
<pre class="">:~# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org</pre>
<figure id="attachment_5299" aria-describedby="caption-attachment-5299" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5299" src="https://www.osradar.com/wp-content/uploads/2018/08/2-4.png" alt="2.- Downloading repo package" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/2-4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/2-4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/2-4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/2-4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/2-4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/2-4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/2-4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5299" class="wp-caption-text">2.- Downloading repo package</figcaption></figure>
<p>We install it:</p>
<pre class="">:~# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm</pre>
<figure id="attachment_5300" aria-describedby="caption-attachment-5300" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5300" src="https://www.osradar.com/wp-content/uploads/2018/08/3-4.png" alt="3.- Enabling additional repo" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/3-4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/3-4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/3-4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/3-4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/3-4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/3-4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/3-4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5300" class="wp-caption-text">3.- Enabling additional repo</figcaption></figure>
<p>With the repository added, we can now install the DRBD packages.</p>
<pre class="">:~# yum install drbd90-utils kmod-drbd90</pre>
<figure id="attachment_5301" aria-describedby="caption-attachment-5301" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5301" src="https://www.osradar.com/wp-content/uploads/2018/08/4-3.png" alt="4.- Installing drbd packages" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/4-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/4-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/4-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/4-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/4-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/4-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/4-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5301" class="wp-caption-text">4.- Installing drbd packages</figcaption></figure>
<p>After the installation of the packages is finished, make sure that the drbd module is loaded to the kernel. We do it with the following command:</p>
<pre class="">:~# lsmod | grep -i drbd</pre>
<figure id="attachment_5302" aria-describedby="caption-attachment-5302" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5302" src="https://www.osradar.com/wp-content/uploads/2018/08/5-3.png" alt="5.- Checking the drbd installation" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/5-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/5-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/5-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/5-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/5-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/5-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/5-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5302" class="wp-caption-text">5.- Checking the drbd installation</figcaption></figure>
<p>In this case, we notice that it was not loaded, to solve this, we execute these two commands.</p>
<pre class="">:~# echo drbd &gt; /etc/modules-load.d/drbd.conf
:~# modprobe drbd</pre>
<figure id="attachment_5303" aria-describedby="caption-attachment-5303" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5303" src="https://www.osradar.com/wp-content/uploads/2018/08/6-3.png" alt="6.- enabling DRBD module " width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/6-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/6-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/6-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/6-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/6-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/6-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/6-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5303" class="wp-caption-text">6.- enabling DRBD module</figcaption></figure>
<p>The first one makes the module load at the beginning of the system and the second one enables it for the active session. We proceed to check again and we&#8217;ll get:</p>
<figure id="attachment_5304" aria-describedby="caption-attachment-5304" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5304" src="https://www.osradar.com/wp-content/uploads/2018/08/7-3.png" alt="7.- Module added" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/7-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/7-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/7-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/7-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/7-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/7-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/7-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5304" class="wp-caption-text">7.- Module added</figcaption></figure>
<h3>2.- Configure DRBD</h3>
<p>Once the packages are installed correctly, we must modify their configuration. First we&#8217;ll back up the original file. We will do this on both nodes:</p>
<pre class="">:~# mv /etc/drbd.d/global_common.conf /etc/drbd.d/global_common.conf.bak</pre>
<figure id="attachment_5305" aria-describedby="caption-attachment-5305" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5305" src="https://www.osradar.com/wp-content/uploads/2018/08/8-2.png" alt="8.- making a backup of config file" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/8-2.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/8-2-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/8-2-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/8-2-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/8-2-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/8-2-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/8-2-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5305" class="wp-caption-text">8.- making a backup of config file</figcaption></figure>
<p>Once the initial configuration file is backed up, we will create a new one:</p>
<pre class="">:~# nano /etc/drbd.d/global_common.conf</pre>
<p>And we&#8217;ll put the following in it:</p>
<pre class="">global {
 usage-count no;
}
common {
 net {
  protocol C;
 }
}</pre>
<figure id="attachment_5306" aria-describedby="caption-attachment-5306" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5306" src="https://www.osradar.com/wp-content/uploads/2018/08/9-4.png" alt="9.- Making a new conf file" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/9-4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/9-4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/9-4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/9-4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/9-4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/9-4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/9-4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5306" class="wp-caption-text">9.- Making a new conf file</figcaption></figure>
<p>Next we will create a new file for the new resource that will be drbd1 in this case. The file will be called drbd1.res.</p>
<pre class="">:~# nano /etc/drbd.d/drbd1.res</pre>
<p>We will add the following:</p>
<pre class="">resource drbd1 {
        disk /dev/sdb;
        device /dev/drbd1;
        meta-disk internal;
        on osradar {
                address 192.168.1.9:7789;
        }
	on osradar2 {
                address 192.168.1.12:7789;
        }
}</pre>
<p>We briefly explain: disk refers to the hard disk to be replicated, device to the partition inside the disk, in the <em>on</em> segment comes the hostname of the computers; address to the ip address of the node and 7789 is the port where they will communicate.</p>
<figure id="attachment_5308" aria-describedby="caption-attachment-5308" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5308" src="https://www.osradar.com/wp-content/uploads/2018/08/10-3.png" alt="10.- editing config file for the new resource" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/10-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/10-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/10-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/10-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/10-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/10-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/10-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5308" class="wp-caption-text">10.- editing config file for the new resource</figcaption></figure>
<p>The next step is to initialize and create the resource at each of the nodes.</p>
<pre class="">:~# drbdadm create-md drbd1</pre>
<figure id="attachment_5309" aria-describedby="caption-attachment-5309" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5309" src="https://www.osradar.com/wp-content/uploads/2018/08/11-2.png" alt="11.- Creating new resource" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/11-2.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/11-2-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/11-2-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/11-2-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/11-2-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/11-2-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/11-2-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5309" class="wp-caption-text">11.- Creating new resource</figcaption></figure>
<p>Later we enable the drbd daemon on both nodes:</p>
<pre class="">:~# systemctl start drbd
:~# systemctl enable drbd</pre>
<p>Now let&#8217;s define who the primary node will be, in our case it will be in &#8220;osradar&#8221;, that is, the first node.</p>
<pre class="">:~# drbdadm down drbd1
:~# drbdadm up drbd1
</pre>
<figure id="attachment_5310" aria-describedby="caption-attachment-5310" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5310" src="https://www.osradar.com/wp-content/uploads/2018/08/12-3.png" alt="12.- Setup primary node" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/12-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/12-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/12-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/12-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/12-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/12-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/12-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5310" class="wp-caption-text">12.- Setup primary node</figcaption></figure>
<p>On the second node:</p>
<pre class="">:~# drbdadm down drbd1
:~# drbdadm up drbd1</pre>
<p>In case an error occurs setting the primary node, you can use this command:</p>
<pre class="">:~# drbdadm primary drbd1 --force</pre>
<p>Next we must configure the firewall to accept connections through the drbd port.</p>
<pre class="">:~# firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.12" port port="7789" protocol="tcp" accept</pre>
<p>Remember to modify the address in each node: if you are in node1 then in the command you must put the ip of node2.</p>
<figure id="attachment_5343" aria-describedby="caption-attachment-5343" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5343" src="https://www.osradar.com/wp-content/uploads/2018/08/13-1.png" alt="13.- Applying firewall rules" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/13-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/13-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/13-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/13-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/13-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/13-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/13-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5343" class="wp-caption-text">13.- Applying firewall rules</figcaption></figure>
<p>and reboot the firewall:</p>
<pre class="">:~# firewall-cmd --reload</pre>
<figure id="attachment_5344" aria-describedby="caption-attachment-5344" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5344" src="https://www.osradar.com/wp-content/uploads/2018/08/14-1.png" alt="14.- Firewall reload" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/14-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/14-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/14-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/14-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/14-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/14-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/14-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5344" class="wp-caption-text">14.- Firewall reload</figcaption></figure>
<p>We&#8217;ll have a DRBD cluster up and running, and we&#8217;ll be able to make changes to the first node&#8217;s partition and replicate from the network to the second one.</p>
<p>Please share this article through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/installing-and-configuring-a-drbd-cluster-in-centos-7/">Installing and configuring a DRBD cluster in CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/installing-and-configuring-a-drbd-cluster-in-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
