<?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>glusterfs Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/glusterfs/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 19:55:06 +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>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>
		<item>
		<title>How to install and configure GlusterFS on CentOS 7?</title>
		<link>https://www.osradar.com/how-to-install-and-configure-glusterfs-on-centos-7/</link>
					<comments>https://www.osradar.com/how-to-install-and-configure-glusterfs-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 29 Aug 2018 05:13:41 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[glusterfs]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=5455</guid>

					<description><![CDATA[<p>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 of the GlusterFS functionalities are implemented as translators, including: Mirroring and file replication. Fragmentation of the files or Data striping. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-and-configure-glusterfs-on-centos-7/">How to install and configure GlusterFS on 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>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.</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>In this tutorial, we will cluster using GlusterFS between two server machines that are using CentOS 7</p>
<h3>0.- Requeriments</h3>
<p>To make this turtorial we will use three computers with GNU/LINUX systems, must have at least 1gb of ram and use 64bits systems, also a separate hard disk in /dev/sdb.</p>
<p>Server 1:</p>
<ul>
<li>Hostname: gluster1.osradar.local</li>
<li>O.S:  CentOS 7</li>
<li>Memory: 1gb</li>
<li>Ip Address: 192.168.1.9</li>
<li>Disk: 8gb /dev/sdb</li>
</ul>
<p>Server 2:</p>
<ul>
<li>Hostname: gluster2.osradar.local</li>
<li>O.S:  CentOS 7</li>
<li>Memory: 1gb</li>
<li>Ip Address: 192.168.1.10</li>
<li>Disk: 8gb /dev/sdb</li>
</ul>
<h3>1.- Configuring DNS (both nodes)</h3>
<p>This first step is vital because GlusterFS uses name resolution to communicate between servers and clients. As root user you write to a terminal:</p>
<pre class="">:~# nano /etc/hosts</pre>
<p>And in the file it places the information of the nodes in the following way:</p>
<pre class="">192.168.1.9 gluster1.osradar.local gluster1
192.168.1.10 gluster2.osradar.local gluster2</pre>
<figure id="attachment_5456" aria-describedby="caption-attachment-5456" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5456" src="https://www.osradar.com/wp-content/uploads/2018/08/1-6.png" alt="1.- DNS config on servers" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/1-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/1-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/1-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/1-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/1-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/1-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/1-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5456" class="wp-caption-text">1.- DNS config on servers</figcaption></figure>
<h3>2.- Installing GlusterFS (both nodes)</h3>
<p>To install Gluster we need to add its repository first, to do this, in a terminal we must write:</p>
<pre class="">:~# yum install centos-release-gluster</pre>
<figure id="attachment_5457" aria-describedby="caption-attachment-5457" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5457" src="https://www.osradar.com/wp-content/uploads/2018/08/2-7.png" alt="2.- installing gluster repo package" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/2-7.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/2-7-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/2-7-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/2-7-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/2-7-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/2-7-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/2-7-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5457" class="wp-caption-text">2.- installing gluster repo package</figcaption></figure>
<p>When the package installation is complete, the repository will be added and we can now install GlusterFS.</p>
<pre class="">:~# yum install glusterfs-server</pre>
<figure id="attachment_5458" aria-describedby="caption-attachment-5458" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5458" src="https://www.osradar.com/wp-content/uploads/2018/08/3-7.png" alt="3.- Installing GlusterFS" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/3-7.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/3-7-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/3-7-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/3-7-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/3-7-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/3-7-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/3-7-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5458" class="wp-caption-text">3.- Installing GlusterFS</figcaption></figure>
<p>Once the installation is complete, we can start the service:</p>
<pre class="">:~# systemctl start glusterd
:~# systemctl enable glusterd</pre>
<figure id="attachment_5459" aria-describedby="caption-attachment-5459" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5459" src="https://www.osradar.com/wp-content/uploads/2018/08/4-6.png" alt="4.- Enabling and starting service" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/4-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/4-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/4-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/4-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/4-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/4-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/4-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5459" class="wp-caption-text">4.- Enabling and starting service</figcaption></figure>
<p>The next thing to do is to modify the firewall settings:</p>
<pre class="">:~# firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="IP_ADDRESS_HERE" accept'
:~# firewall-cmd --reload</pre>
<figure id="attachment_5460" aria-describedby="caption-attachment-5460" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5460" src="https://www.osradar.com/wp-content/uploads/2018/08/5-7.png" alt="5.- Setting firewall rule" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/5-7.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/5-7-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/5-7-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/5-7-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/5-7-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/5-7-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/5-7-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5460" class="wp-caption-text">5.- Setting firewall rule</figcaption></figure>
<h3>3.-Add a storage (both nodes)</h3>
<p>Now we must prepare the second hard disk (/dev/sdb) to be used as a brick (basic storage unit in Gluster). We&#8217;ll do a partition there.</p>
<pre class="">:~# fdisk /dev/sdb</pre>
<p>To perform the process properly, write the options in this order</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>
<figure id="attachment_5461" aria-describedby="caption-attachment-5461" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5461" src="https://www.osradar.com/wp-content/uploads/2018/08/6-6.png" alt="6.- Creating a new partition" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/6-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/6-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/6-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/6-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/6-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/6-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/6-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5461" class="wp-caption-text">6.- Creating a new partition</figcaption></figure>
<p>now we proceed to format the partition:</p>
<pre class="">:~# mkfs.ext4 /dev/sdb1</pre>
<figure id="attachment_5463" aria-describedby="caption-attachment-5463" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5463" src="https://www.osradar.com/wp-content/uploads/2018/08/7-7.png" alt="7.- Formating the partition" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/7-7.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/7-7-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/7-7-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/7-7-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/7-7-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/7-7-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/7-7-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5463" class="wp-caption-text">7.- Formating the partition</figcaption></figure>
<p>Then we create a folder and mount the partition on it.</p>
<pre class="">:~# mkdir -p /data/glusterfs
:~# mount /dev/sdb1 /data/glusterfs</pre>
<figure id="attachment_5464" aria-describedby="caption-attachment-5464" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5464" src="https://www.osradar.com/wp-content/uploads/2018/08/8-5.png" alt="8.- Mounting the partition" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/8-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/8-5-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/8-5-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/8-5-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/8-5-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/8-5-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/8-5-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5464" class="wp-caption-text">8.- Mounting the partition</figcaption></figure>
<p>We make sure that the partition is automatically mounted at system boot:</p>
<pre class="">:~# echo "/dev/sdb1 /data/glusterfs ext4 defaults 0 0" | tee --append /etc/fstab</pre>
<figure id="attachment_5465" aria-describedby="caption-attachment-5465" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5465" src="https://www.osradar.com/wp-content/uploads/2018/08/9-7.png" alt="9.- editing fstab " width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/9-7.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/9-7-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/9-7-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/9-7-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/9-7-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/9-7-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/9-7-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5465" class="wp-caption-text">9.- editing fstab</figcaption></figure>
<h3>4.-Configuring GlusterFS</h3>
<p>The next step will be on node 1. tell Gluster that node 2 is trustworthy to build the cluster itself. To do this we must execute the following command:</p>
<pre class="">:~# gluster peer probe gluster2.osradar.local</pre>
<figure id="attachment_5470" aria-describedby="caption-attachment-5470" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5470" src="https://www.osradar.com/wp-content/uploads/2018/08/10-5.png" alt="10.- Setup gluster peer" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/10-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/10-5-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/10-5-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/10-5-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/10-5-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/10-5-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/10-5-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5470" class="wp-caption-text">10.- Setup gluster peer</figcaption></figure>
<p>And then we verify that the other node has been added correctly with these commands:</p>
<pre class="">:~# gluster peer status
:~# gluster pool list</pre>
<figure id="attachment_5471" aria-describedby="caption-attachment-5471" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5471" src="https://www.osradar.com/wp-content/uploads/2018/08/11-4.png" alt="11.- Checking the node added" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/11-4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/11-4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/11-4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/11-4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/11-4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/11-4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/11-4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5471" class="wp-caption-text">11.- Checking the node added</figcaption></figure>
<h3>5.- Creating GlusterFS Volume</h3>
<p>We create a folder on both nodes that will serve as the volume folder:</p>
<pre class="">:~# mkdir -p /data/glusterfs/glustervolume</pre>
<figure id="attachment_5472" aria-describedby="caption-attachment-5472" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5472" src="https://www.osradar.com/wp-content/uploads/2018/08/12-5.png" alt="12.- Creating a directory for new volume" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/12-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/12-5-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/12-5-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/12-5-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/12-5-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/12-5-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/12-5-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5472" class="wp-caption-text">12.- Creating a directory for new volume</figcaption></figure>
<p>We now proceed to create the volume by indicating that you will use two mirrors in this case:</p>
<pre class="">:~# gluster volume create glusterfsvolumne replica 2 gluster1.osradar.local:/data/glusterfs/glustervolume gluster2.osradar.local:/data/glusterfs/glustervolume</pre>
<figure id="attachment_5473" aria-describedby="caption-attachment-5473" style="width: 690px" class="wp-caption alignnone"><img loading="lazy" class=" wp-image-5473" src="https://www.osradar.com/wp-content/uploads/2018/08/13-3.png" alt="13.- Creating gluster volume" width="690" height="358" srcset="https://www.osradar.com/wp-content/uploads/2018/08/13-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/13-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/13-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/13-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/13-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/13-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/13-3-809x420.png 809w" sizes="(max-width: 690px) 100vw, 690px" /><figcaption id="caption-attachment-5473" class="wp-caption-text">13.- Creating gluster volume</figcaption></figure>
<p>We start the volume:</p>
<pre class="">:~# gluster volume start glusterfsvolumne</pre>
<figure id="attachment_5474" aria-describedby="caption-attachment-5474" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5474" src="https://www.osradar.com/wp-content/uploads/2018/08/14-2.png" alt="14.- Starting the volume" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/14-2.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/14-2-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/14-2-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/14-2-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/14-2-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/14-2-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/14-2-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5474" class="wp-caption-text">14.- Starting the volume</figcaption></figure>
<p>The installation and configuration of glusterfs on a server is now complete. We proceed to install the client on another machine.</p>
<h3>GlusterFS client</h3>
<p>Now it is the customer&#8217;s turn to use another CentOS 7 device with an IP address of 192.168.1.7. The other features of the device do not influence the use of the device.</p>
<p>We proceed to install the glusterfs-client package:</p>
<pre class="">:~# yum install glusterfs-client</pre>
<p>Once the installation is finished, we will create a folder to mount the volume.</p>
<pre class="">:~# mkdir -p /mnt/glusterfsvolumne</pre>
<p>we set up the firewall:</p>
<pre class="">:~# firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="192.168.1.7" accept'
:~# ffirewall-cmd --reload</pre>
<p>And we mount the previously created glusterFs volume.</p>
<pre class="">:~# mount -t glusterfs gluster1.osradar.local:/glusterfsvolumne /mnt/glusterfsvolumne</pre>
<figure id="attachment_5475" aria-describedby="caption-attachment-5475" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5475" src="https://www.osradar.com/wp-content/uploads/2018/08/15-1.png" alt="15.- Mounting gluster volume on client node" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/15-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/15-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/15-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/15-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/15-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/15-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/15-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5475" class="wp-caption-text">15.- Mounting gluster volume on client node</figcaption></figure>
<p>We checked the mounting:</p>
<pre class="">df -hP /mnt/glusterfsvolumne/</pre>
<figure id="attachment_5476" aria-describedby="caption-attachment-5476" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5476" src="https://www.osradar.com/wp-content/uploads/2018/08/16-1.png" alt="16.- checking the mounting" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/16-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/16-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/16-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/16-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/16-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/16-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/16-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5476" class="wp-caption-text">16.- checking the mounting</figcaption></figure>
<p>we add the entry in fstab so that it is automatically mounted:</p>
<pre class="">:~# echo "gluster1.osradar.local:/glusterfsvolumne /mnt/glusterfsvolumne/ glusterfs  defaults,_netdev 0 0" | tee --append /etc/fstab</pre>
<figure id="attachment_5477" aria-describedby="caption-attachment-5477" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5477" src="https://www.osradar.com/wp-content/uploads/2018/08/17-1.png" alt="17.- editing fstab" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/17-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/17-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/17-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/17-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/17-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/17-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/17-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5477" class="wp-caption-text">17.- editing fstab</figcaption></figure>
<h3>Testing the replication</h3>
<p>First of all, in the server nodes, we execute the following commands:</p>
<p>On the first node (gluster1.osradar.local):</p>
<pre class="">:~# mount -t glusterfs gluster2.osradar.local:/glusterfsvolumne /mnt</pre>
<p>On second node (gluster2.osradar.local):</p>
<pre class="">:~# mount -t glusterfs gluster1.osradar.local:/glusterfsvolumne /mnt</pre>
<figure id="attachment_5478" aria-describedby="caption-attachment-5478" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5478" src="https://www.osradar.com/wp-content/uploads/2018/08/18-1.png" alt="18.- Mounting the volumes" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/18-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/18-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/18-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/18-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/18-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/18-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/18-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5478" class="wp-caption-text">18.- Mounting the volumes</figcaption></figure>
<p>On client machine:</p>
<p>First we create the files, and verify</p>
<pre class="">:~# touch /mnt/glusterfsvolumne/filetest{1..4}
:~# ls /mnt/glusterfsvolumne</pre>
<figure id="attachment_5479" aria-describedby="caption-attachment-5479" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5479" src="https://www.osradar.com/wp-content/uploads/2018/08/19-1.png" alt="19.- Creating example files" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/19-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/19-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/19-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/19-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/19-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/19-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/19-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5479" class="wp-caption-text">19.- Creating example files</figcaption></figure>
<p>Now from node 1 we show the files created from the client.</p>
<pre class="">:~# ls -l /mnt/</pre>
<figure id="attachment_5480" aria-describedby="caption-attachment-5480" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5480" src="https://www.osradar.com/wp-content/uploads/2018/08/20-1.png" alt="20.- Testing the replication" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/20-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/20-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/20-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/20-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/20-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/20-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/20-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5480" class="wp-caption-text">20.- Testing the replication</figcaption></figure>
<p>That concludes the article and I hope it has served you well. Remember that for everything to work, you have to be careful with the firewall and define its rules correctly.</p>
<p>Please share this article through your social networks-</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-and-configure-glusterfs-on-centos-7/">How to install and configure GlusterFS on 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/how-to-install-and-configure-glusterfs-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
