<?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>replication Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/replication/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Thu, 08 Aug 2019 20:09:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>Install and configure DRBD on Debian 10</title>
		<link>https://www.osradar.com/install-and-configure-drbd-on-debian-10/</link>
					<comments>https://www.osradar.com/install-and-configure-drbd-on-debian-10/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Sun, 11 Aug 2019 23:22:20 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Buster]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=12948</guid>

					<description><![CDATA[<p>Replicating partitions is a great way to back up data in real-time. This is one of the most useful operations we can do as sysadmin as it can save us a lot of time. Imagine that a server has a lot of information and suddenly stops working. It would be a problem. However, if we [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-and-configure-drbd-on-debian-10/">Install and configure DRBD on Debian 10</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Replicating partitions is a great way to back up data in real-time. This is one of the most useful operations we can do as sysadmin as it can save us a lot of time. Imagine that a server has a lot of information and suddenly stops working. It would be a problem. However, if we are replicating all its information through the network there would be no need to be alarmed. So, in this post, I will explain how to install and configure DRBD on Debian 10.</p>
<h2>0. What we need</h2>
<p>First of all, we need two Debian 10 teams. Both must have a static IP address and a defined hostname. Also, they have a partition defined for replication of the same size. Then, be connected to the same network and that the Firewall allows connections through the DRBD network port. In short, this will be our environment.</p>
<p>Node 1:</p>
<ul>
<li>IP address: 192.168.250.100</li>
<li>Hostname: osradar1</li>
<li>OS: Debian 10</li>
<li>Disk: /dev/sda</li>
<li>Partition to replicate: /dev/sda2</li>
</ul>
<p>Node 2:</p>
<ul>
<li>IP address: 192.168.250.110</li>
<li>Hostname: osradar2</li>
<li>OS: Debian 10</li>
<li>Disk: /dev/sda</li>
<li>Partition to replicate: /dev/sda2</li>
</ul>
<p>Each node must have a /dev/sda2/ partition of at least several GB in size.</p>
<h2>1) Install DRBD on Debian 10</h2>
<p>DRBD is available in the official repositories of the distribution. So the installation is not complicated.</p>
<p>On both nodes, run the following command:</p>
<pre>:~$ sudo apt install drbd-utils</pre>
<p>Of course, DRBD incorporates a module that has to be loaded into the kernel. In both nodes, it has to be loaded. To do this, run the following command:</p>
<pre>:~$ sudo modprobe drbd</pre>
<p>Then, check the module was added.</p>
<pre>:~$ lsmod | grep drbd</pre>
<figure id="attachment_12950" aria-describedby="caption-attachment-12950" style="width: 328px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12950" src="https://www.osradar.com/wp-content/uploads/2019/08/1-4.jpeg" alt="1.- check the drbd module" width="328" height="93" srcset="https://www.osradar.com/wp-content/uploads/2019/08/1-4.jpeg 328w, https://www.osradar.com/wp-content/uploads/2019/08/1-4-300x85.jpeg 300w, https://www.osradar.com/wp-content/uploads/2019/08/1-4-324x93.jpeg 324w" sizes="(max-width: 328px) 100vw, 328px" /><figcaption id="caption-attachment-12950" class="wp-caption-text">1.- check the drbd module</figcaption></figure>
<h2>2) Configure DRBD</h2>
<p>The package is already installed and the module loaded to the kernel. Now it remains to make the appropriate settings for the replication to be a success.</p>
<p>DRBD has the particularity of being flexible, that is, the configuration file has many options that we can manipulate and adapt to our needs.</p>
<p>However, it is recommended to make a backup of the configuration file before starting to work on it.</p>
<pre>:~$ sudo cp /etc/drbd.conf /etc/drbd.conf.bak</pre>
<p>Then, erase the entire file.</p>
<pre>:~$ sudo cat /dev/null &gt; /etc/drbd.conf</pre>
<p>Now, you need to edit the configuration file:</p>
<pre>:~$ sudo nano /etc/drbd.conf</pre>
<p>And add the following:</p>
<pre>global { usage-count no; }
common { syncer { rate 100M; } }
resource r0 {
        protocol C;
        startup {
                wfc-timeout  15;
                degr-wfc-timeout 60;
        }
        net {
                cram-hmac-alg sha1;
                shared-secret "secret";
        }
        on osradar1 {
                device /dev/drbd0;
                disk /dev/sda2;
                address 192.168.250.100:7788;
                meta-disk internal;
        }
        on osradar2 {
                device /dev/drbd0;
                disk /dev/sda2;
                address 192.168.0.110:7788;
                meta-disk internal;
        }
}</pre>
<figure id="attachment_12951" aria-describedby="caption-attachment-12951" style="width: 810px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-12951 size-full" src="https://www.osradar.com/wp-content/uploads/2019/08/2-4.jpeg" alt="2.- Install DRBD on Debian 10" width="810" height="495" srcset="https://www.osradar.com/wp-content/uploads/2019/08/2-4.jpeg 810w, https://www.osradar.com/wp-content/uploads/2019/08/2-4-300x183.jpeg 300w, https://www.osradar.com/wp-content/uploads/2019/08/2-4-768x469.jpeg 768w, https://www.osradar.com/wp-content/uploads/2019/08/2-4-696x425.jpeg 696w, https://www.osradar.com/wp-content/uploads/2019/08/2-4-687x420.jpeg 687w" sizes="(max-width: 810px) 100vw, 810px" /><figcaption id="caption-attachment-12951" class="wp-caption-text">2.- Install DRBD on Debian 10</figcaption></figure>
<p>The truth is that I think that many of the options are very explicit but I will briefly explain the most important ones.</p>
<p>In global and common some global configurations are defined to both nodes and resources.</p>
<p>Then, in the resource section, we define the name. In this case <code>r0</code>, of course, you can modify it. Next, in protocol, startup, and net, specific configurations to the resource.</p>
<p>Then, there is the configuration in each node identified by the hostname. In each of them, we define the DRBD device and the partition we are going to replicate (<code>disk</code>). Also, the IP address of the node as well as the communication port.</p>
<p>As you can see it is not very complex or long to understand.</p>
<h2>3) Start DRBD on Debian 10</h2>
<p>Remember this same file must be on both nodes. Then, in both nodes run the following commands to start the DRBD service.</p>
<pre>:~$ sudo systemctl stop drbd
:~$ sudo drbdadm create-md r0
:~$ sudo drbdadm attach r0</pre>
<p>Remember that is<code>r0</code> the name of the resource. You can change it in the configuration file.</p>
<p>After that, you can start the service.</p>
<pre>:~$ sudo systemctl start drbd</pre>
<p>And set which node will be the master. In this case, the node1 will be the master. So, in the node1 run this command:</p>
<pre>:~$ sudo drbdadm -- --overwrite-data-of-peer primary all</pre>
<p>With that, we should have an effective replication. It would be enough to create a new file system and mount it.</p>
<pre>:~$ sudo mkfs.ext4 /dev/drbd0
:~$ sudo mkdir /testdata
:~$ sudo mount /dev/drbd0 /testdata</pre>
<p>There, you can create new files. And that is it.</p>
<p>If you want more post about Debian 10, please click <a href="https://www.osradar.com/tag/buster/">here</a>.</p>
<p>Please share this post with your friends and join <a href="https://t.me/osradar">our Telegram Channel.</a></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-and-configure-drbd-on-debian-10/">Install and configure DRBD on Debian 10</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/install-and-configure-drbd-on-debian-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install and configure GlusterFS on Debian 10?</title>
		<link>https://www.osradar.com/install-and-configure-glusterfs-debian-10/</link>
					<comments>https://www.osradar.com/install-and-configure-glusterfs-debian-10/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Fri, 09 Aug 2019 23:02:53 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Buster]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[glusterfs]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=12931</guid>

					<description><![CDATA[<p>In this post, I will show you how to install and configure GlusterFS on a server machine running Debian 10. GlusterFS is a multi-scalable file system for NAS initially developed by Gluster Inc. A Gluster would allow us to connect two machines that will write simultaneously on the same disc, agreeing on the writer. Most [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-and-configure-glusterfs-debian-10/">How to install and configure GlusterFS on Debian 10?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this post, I will show you how to install and configure GlusterFS on a server machine running <a href="https://www.osradar.com/tag/buster/" target="_blank" rel="noopener noreferrer">Debian 10</a>.</p>
<p><a href="https://www.gluster.org/">GlusterFS</a> is a multi-scalable file system for NAS initially developed by Gluster Inc. A Gluster would allow us to connect two machines that will write simultaneously on the same disc, agreeing on the writer.</p>
<p>Most of the GlusterFS functionalities are implemented as translators, including:</p>
<ul>
<li>Mirroring and file replication.</li>
<li>Fragmentation of the files or Data striping.</li>
<li>Load balancing for reading and writing files.</li>
<li>Fault-tolerant volumes.</li>
<li>I/O planning and disk caching.</li>
<li>The storage quotas.</li>
</ul>
<p>So, in this post, we will use two nodes, one server, and one client.</p>
<h2>0. What do we need?</h2>
<p>For this tutorial, we will use two nodes. The first one will do the server functions. Here is the partition we want to replicate. The other will be the client and will contain the partition where the data will be replicated.</p>
<p>On Node 1 (Server):</p>
<ul>
<li>Hostname: gluster1.osradar.local</li>
<li>O.S:  Debian 10</li>
<li>Memory: 1gb</li>
<li>Ip Address: 192.168.250.200</li>
<li>Disk: 8gb /dev/sda</li>
</ul>
<p>On Node 2:</p>
<ul>
<li>Hostname: gluster2.osradar.local</li>
<li>O.S:  Debian 10</li>
<li>Memory: 1gb</li>
<li>Ip Address: 192.168.250.210</li>
<li>Disk: 8gb /dev/sda</li>
</ul>
<p>So, let us start.</p>
<h2>1) Configure DNS on both nodes</h2>
<p>In both nodes, it is necessary to edit the hosts file to indicate them that they will work with nodes in network communicated with an IP address and a hostname.</p>
<p>Open the terminal on both nodes and run the following:</p>
<pre>:~$ su
:~# nano /etc/hosts</pre>
<p>And add the following:</p>
<pre class="">192.168.250.200 gluster1.osradar.local gluster1
192.168.250.210 gluster2.osradar.local gluster2</pre>
<p>Save the changes and exit the text editor.</p>
<h2>2) Install GlusterFS on Debian (Both nodes)</h2>
<p>Then install GlusterFS on both nodes. The good thing is that it&#8217;s in the official Debian repositories, so it&#8217;s pretty easy to do.</p>
<p>On the terminal, run the following:</p>
<pre>:~# apt install glusterfs-server</pre>
<p>Then, start and check the service status.</p>
<pre>:~# systemctl start glusterd
:~# systemctl status glusterd
● glusterd.service - GlusterFS, a clustered file-system server
Loaded: loaded (/lib/systemd/system/glusterd.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2019-08-08 15:22:29 EDT; 27s ago
Docs: man:glusterd(8)
Process: 8708 ExecStart=/usr/sbin/glusterd -p /run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 8709 (glusterd)
Tasks: 8 (limit: 893)
Memory: 2.8M
CGroup: /system.slice/glusterd.service
└─8709 /usr/sbin/glusterd -p /run/glusterd.pid --log-level INFO

Aug 08 15:22:26 osradar systemd[1]: Starting GlusterFS, a clustered file-system server...
Aug 08 15:22:29 osradar systemd[1]: Started GlusterFS, a clustered file-system server.</pre>
<p>So, GLusterFS is running.</p>
<h2>3) Add storage on both nodes</h2>
<p>In this post, we are assuming that both nodes have a secondary hard disk in /dev/sdb of 8Gb. However, you have to create a partition and format it with a file system.</p>
<p>For this, I will use fdisk and its commands to make the partition.</p>
<pre>:~# exit
:~$ sudo fdisk /dev/sda</pre>
<p>Write these options to create the partition.</p>
<pre class="">Command (m for help): n
Select (default p): p
Partition number (1-4, default 1): 1
press enter
press enter
Command (m for help): p
Command (m for help): w</pre>
<p>Remember replace /dev/sdb by your disk.</p>
<figure id="attachment_12961" aria-describedby="caption-attachment-12961" style="width: 643px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12961" src="https://www.osradar.com/wp-content/uploads/2019/08/2-5.jpeg" alt="2.- Creating the new partition" width="643" height="585" srcset="https://www.osradar.com/wp-content/uploads/2019/08/2-5.jpeg 643w, https://www.osradar.com/wp-content/uploads/2019/08/2-5-300x273.jpeg 300w, https://www.osradar.com/wp-content/uploads/2019/08/2-5-462x420.jpeg 462w" sizes="(max-width: 643px) 100vw, 643px" /><figcaption id="caption-attachment-12961" class="wp-caption-text">2.- Creating the new partition</figcaption></figure>
<p>Then, format the partition. After that, create a folder and mount the partition on it.</p>
<pre class="">:~$ sudo mkfs.ext4 /dev/sda1
:~$ sudo mkdir -p /data/glusterfs
:~$ sudo mount /dev/sdb1 /data/glusterfs</pre>
<figure id="attachment_12962" aria-describedby="caption-attachment-12962" style="width: 610px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12962" src="https://www.osradar.com/wp-content/uploads/2019/08/3-4.jpeg" alt="3.- Format the new partition" width="610" height="267" srcset="https://www.osradar.com/wp-content/uploads/2019/08/3-4.jpeg 610w, https://www.osradar.com/wp-content/uploads/2019/08/3-4-300x131.jpeg 300w" sizes="(max-width: 610px) 100vw, 610px" /><figcaption id="caption-attachment-12962" class="wp-caption-text">3.- Format the new partition</figcaption></figure>
<p>It is recommended to make the partition automate at the beginning of the system. So for that, add this line to fstab.</p>
<p>&nbsp;</p>
<pre>:~$ echo "/dev/sdb1 /data/glusterfs ext4 defaults 0 0" | sudo tee --append /etc/fstab</pre>
<h2>4) Creating a GlusterFS volume on Debian 10</h2>
<p>Now it is necessary to create a new GlusterFS volume. But first, tell node 1 that node 2 is reliable. Simply put, add it to the cluster.</p>
<p>On node 1:</p>
<pre>:~$ sudo gluster peer probe gluster2.osradar.local
peer probe: success.</pre>
<p>Now check that it has been added correctly.</p>
<pre class="">:~$ sudo gluster peer status
:~$ sudo gluster pool list</pre>
<figure id="attachment_12963" aria-describedby="caption-attachment-12963" style="width: 647px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12963" src="https://www.osradar.com/wp-content/uploads/2019/08/4-3.jpeg" alt="4.- Configuring glusterfs on Debian 10" width="647" height="188" srcset="https://www.osradar.com/wp-content/uploads/2019/08/4-3.jpeg 647w, https://www.osradar.com/wp-content/uploads/2019/08/4-3-300x87.jpeg 300w" sizes="(max-width: 647px) 100vw, 647px" /><figcaption id="caption-attachment-12963" class="wp-caption-text">4.- Configuring glusterfs on Debian 10</figcaption></figure>
<p>Then on both node create the folder and the volume.</p>
<pre>:~$ sudo mkdir -p /data/glusterfs/glustervolume</pre>
<p>On Node 1 create the volume:</p>
<pre>:~$ sudo gluster volume create glusterfsvolume replica 2 gluster1.osradar.local:/data/glusterfs/glustervolume gluster2.osradar.local:/data/glusterfs/glustervolume
volume create: glusterfsvolume: success: please start the volume to access data</pre>
<p>Now start the new volume:</p>
<pre>:~$ sudo gluster volume start glusterfsvolume
volume start: glusterfsvolume: success</pre>
<p>The configuration on the server is ready.</p>
<h2>5) Install GlusterFS on Debian 10 (Client)</h2>
<p>On the server-side everything is done, just do a little configuration on the client.</p>
<p>First, install the glusterfs package.</p>
<pre>:~# apt install glusterfs-client</pre>
<p>Then, create a folder to locate the GlusterFS volume data. After this, mount the volume.</p>
<pre class="">:~# mkdir -p /mnt/glusterfsvolume
:~# mount -t glusterfs gluster1.osradar.local:/glusterfsvolume /mnt/glusterfsvolume</pre>
<p>Remember open the right ports and incoming host.</p>
<p>It is recommended to have it automatically mounted to have immediate availability. You can do it with the following command:</p>
<pre class="">:~# echo "gluster1.osradar.local:/glusterfsvolume /mnt/glusterfsvolume/ glusterfs  defaults,_netdev 0 0" | tee --append /etc/fstab</pre>
<p>And that is it. You can start to replicate. To test it, just create some files in the volume folders and see how they replicate on the other server and on the client.</p>
<p>Please share this post and join <a href="https://t.me/osradar" target="_blank" rel="noopener noreferrer">our Telegram Channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-and-configure-glusterfs-debian-10/">How to install and configure GlusterFS on Debian 10?</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/install-and-configure-glusterfs-debian-10/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
