<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[iRedMail — High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
		<link>http://www.iredmail.org/forum/topic2147-highavailability-maildir-storage-with-glusterfs-centos-5x.html</link>
		<atom:link href="http://www.iredmail.org/forum/feed-rss-topic2147.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in High-Availability Maildir Storage With GlusterFS + CentOS 5.x.]]></description>
		<lastBuildDate>Thu, 30 Aug 2012 16:07:35 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post17980.html#p17980</link>
			<description><![CDATA[<p>If anyone is interested heres a comparison:</p><p>/usr/filebench is on the normal disks<br />/home/filebench is on a gluster mount</p><br /><p>Direct HD:</p><p>[root@storage-br1 ~]# filebench-1.4.9.1/filebench <br />Filebench Version 1.4.9.1<br />IMPORTANT: Virtual address space randomization is enabled on this machine!<br />It is highly recommended to disable randomization to provide stable Filebench runs.<br />Echo 0 to /proc/sys/kernel/randomize_va_space file to disable the randomization.<br />16298: 0.000: Allocated 170MB of shared memory<br />filebench&gt; load varmail<br />16298: 3.984: Varmail Version 3.0 personality successfully loaded<br />16298: 3.984: Usage: set $dir=&lt;dir&gt;<br />16298: 3.984:&nbsp; &nbsp; &nbsp; &nbsp; set $meanfilesize=&lt;size&gt;&nbsp; &nbsp; defaults to 16384<br />16298: 3.984:&nbsp; &nbsp; &nbsp; &nbsp; set $nfiles=&lt;value&gt;&nbsp; &nbsp; &nbsp;defaults to 1000<br />16298: 3.984:&nbsp; &nbsp; &nbsp; &nbsp; set $nthreads=&lt;value&gt;&nbsp; &nbsp;defaults to 16<br />16298: 3.984:&nbsp; &nbsp; &nbsp; &nbsp; set $meanappendsize=&lt;value&gt; defaults to 16384<br />16298: 3.984:&nbsp; &nbsp; &nbsp; &nbsp; set $iosize=&lt;size&gt;&nbsp; defaults to 1048576<br />16298: 3.984:&nbsp; &nbsp; &nbsp; &nbsp; set $meandirwidth=&lt;size&gt; defaults to 1000000<br />16298: 3.984:&nbsp; &nbsp; &nbsp; &nbsp; run runtime (e.g. run 60)<br />filebench&gt; set $dir=/usr/filebench<br />filebench&gt; run 60<br />16298: 16.235: Creating/pre-allocating files and filesets<br />16298: 16.237: Fileset bigfileset: 1000 files, 0 leafdirs, avg dir width = 1000000, avg dir depth = 0.5, 14.959MB<br />16298: 16.240: Removed any existing fileset bigfileset in 1 seconds<br />16298: 16.240: making tree for filset /usr/filebench/bigfileset<br />16298: 16.240: Creating fileset bigfileset...<br />16298: 16.290: Preallocated 805 of 1000 of fileset bigfileset in 1 seconds<br />16298: 16.290: waiting for fileset pre-allocation to finish<br />16301: 16.298: Starting 1 filereader instances<br />16302: 16.320: Starting 16 filereaderthread threads<br />16298: 17.339: Running...<br />16298: 77.343: Run took 60 seconds...<br />16298: 77.344: Per-Operation Breakdown<br />closefile4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2619ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 0.0ms/op&nbsp; &nbsp; &nbsp; 164us/op-cpu [0ms - 0ms]<br />readfile4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2619ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.6mb/s&nbsp; &nbsp; &nbsp;11.7ms/op&nbsp; &nbsp; &nbsp; 561us/op-cpu [0ms - 219ms]<br />openfile4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2620ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 1.1ms/op&nbsp; &nbsp; &nbsp; 153us/op-cpu [0ms - 2391ms]<br />closefile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2620ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 0.0ms/op&nbsp; &nbsp; &nbsp; &nbsp;46us/op-cpu [0ms - 0ms]<br />fsyncfile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2620ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; 147.4ms/op&nbsp; &nbsp; &nbsp;7183us/op-cpu [10ms - 3289ms]<br />appendfilerand3&nbsp; &nbsp; &nbsp; 2625ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.3mb/s&nbsp; &nbsp; &nbsp; 2.9ms/op&nbsp; &nbsp; &nbsp; 408us/op-cpu [0ms - 164ms]<br />readfile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2625ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.7mb/s&nbsp; &nbsp; &nbsp; 7.2ms/op&nbsp; &nbsp; &nbsp; 423us/op-cpu [0ms - 187ms]<br />openfile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2625ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 0.1ms/op&nbsp; &nbsp; &nbsp; 122us/op-cpu [0ms - 85ms]<br />closefile2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2625ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 0.0ms/op&nbsp; &nbsp; &nbsp; 107us/op-cpu [0ms - 0ms]<br />fsyncfile2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2625ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; 131.8ms/op&nbsp; &nbsp; &nbsp;4895us/op-cpu [20ms - 441ms]<br />appendfilerand2&nbsp; &nbsp; &nbsp; 2628ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.3mb/s&nbsp; &nbsp; &nbsp; 0.2ms/op&nbsp; &nbsp; &nbsp; 312us/op-cpu [0ms - 187ms]<br />createfile2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2628ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 1.2ms/op&nbsp; &nbsp; &nbsp; 502us/op-cpu [0ms - 854ms]<br />deletefile1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2628ops&nbsp; &nbsp; &nbsp; &nbsp;44ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp;48.7ms/op&nbsp; &nbsp; &nbsp;2002us/op-cpu [0ms - 270ms]<br />16298: 77.344: IO Summary: 34107 ops, 568.414 ops/s, (87/88 r/w),&nbsp; &nbsp;2.0mb/s,&nbsp; &nbsp; 760us cpu/op,&nbsp; 88.0ms latency<br />16298: 77.344: Shutting down processes</p><br /><br /><br /><p>Gluster:</p><br /><p>closefile4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 0.2ms/op&nbsp; &nbsp; &nbsp; &nbsp;81us/op-cpu [0ms - 3ms]<br />readfile4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;1.0mb/s&nbsp; &nbsp; &nbsp; 0.8ms/op&nbsp; &nbsp; &nbsp; 132us/op-cpu [0ms - 18ms]<br />openfile4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 2.5ms/op&nbsp; &nbsp; &nbsp; 217us/op-cpu [0ms - 393ms]<br />closefile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 0.1ms/op&nbsp; &nbsp; &nbsp; &nbsp;61us/op-cpu [0ms - 2ms]<br />fsyncfile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 6.6ms/op&nbsp; &nbsp; &nbsp; 256us/op-cpu [0ms - 1463ms]<br />appendfilerand3&nbsp; &nbsp; &nbsp; 4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.5mb/s&nbsp; &nbsp; &nbsp; 0.2ms/op&nbsp; &nbsp; &nbsp; &nbsp;88us/op-cpu [0ms - 1ms]<br />readfile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;1.0mb/s&nbsp; &nbsp; &nbsp; 0.7ms/op&nbsp; &nbsp; &nbsp; 134us/op-cpu [0ms - 15ms]<br />openfile3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 4.2ms/op&nbsp; &nbsp; &nbsp; 215us/op-cpu [0ms - 1612ms]<br />closefile2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 0.2ms/op&nbsp; &nbsp; &nbsp; &nbsp;46us/op-cpu [0ms - 2ms]<br />fsyncfile2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; &nbsp; 5.8ms/op&nbsp; &nbsp; &nbsp; 320us/op-cpu [1ms - 758ms]<br />appendfilerand2&nbsp; &nbsp; &nbsp; 4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.5mb/s&nbsp; &nbsp; &nbsp; 0.3ms/op&nbsp; &nbsp; &nbsp; &nbsp;44us/op-cpu [0ms - 2ms]<br />createfile2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4094ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; 105.3ms/op&nbsp; &nbsp; &nbsp;7684us/op-cpu [2ms - 2279ms]<br />deletefile1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4100ops&nbsp; &nbsp; &nbsp; &nbsp;68ops/s&nbsp; &nbsp;0.0mb/s&nbsp; &nbsp; 105.6ms/op&nbsp; &nbsp; &nbsp;7712us/op-cpu [1ms - 2194ms]<br />16418: 81.919: IO Summary: 53228 ops, 887.076 ops/s, (136/136 r/w),&nbsp; &nbsp;3.1mb/s,&nbsp; &nbsp;1332us cpu/op,&nbsp; 58.2ms latency</p><br /><p>Much to my suprise gluster overall is a bit faster&nbsp; - but the key things with mail are creating/deleting files and if you look at these (createfile2 / deletefile1) its a HUGE amount slower than the normal filesystem.</p>]]></description>
			<author><![CDATA[null@example.com (imknight)]]></author>
			<pubDate>Thu, 30 Aug 2012 16:07:35 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post17980.html#p17980</guid>
		</item>
		<item>
			<title><![CDATA[Re: High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post17978.html#p17978</link>
			<description><![CDATA[<p>All write operations as it waits for it to write to all servers before returning the ok signal, so if you visited a mailbox that had 100 new emails and then these obviously get marked as current it has to update them 100 files .</p><p>Gluster and small file performance is just not upto the job im afraid.</p><p>Theres a number of posts around relating to gluster and small file performance </p><p><a href="http://comments.gmane.org/gmane.comp.file-systems.gluster.user/8593">http://comments.gmane.org/gmane.comp.fi … .user/8593</a></p><p>Hence my original post a while back about iredmail using the mdbox format (cross between MailDir and mbox) to try to solve some of this small file issues.</p><p>Im using gluster just to backup a mailserver atm - and its absolutly awful - i am backing up around 2TB of data but it takes days (yes days) to do it as opposed to a few hours on a normal server.</p><p>I would not recommend gluster for any serious mail platform, your liable to get timeouts on your mailclient and such as soon as you have more than a few emails in your mailbox.</p><p>Im looking at a ZFS filesystem at present to mount over nfs for mails using nexentastor - they do have a OS version as well</p>]]></description>
			<author><![CDATA[null@example.com (imknight)]]></author>
			<pubDate>Thu, 30 Aug 2012 15:23:28 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post17978.html#p17978</guid>
		</item>
		<item>
			<title><![CDATA[Re: High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post17971.html#p17971</link>
			<description><![CDATA[<p>All read/write operations are slow, or just mail related operations?</p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Thu, 30 Aug 2012 12:40:06 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post17971.html#p17971</guid>
		</item>
		<item>
			<title><![CDATA[Re: High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post17966.html#p17966</link>
			<description><![CDATA[<p>Just one thing here - ive played with glusterfs for a while and one of my main reasons at the time was for an easily expandable file storage system, sadly however theres a downside - ITS REALLY SLOW - mail behaviour is lots of random read/writes and its also of tiny files - this is not suited for glusterfs at all im afraid, maybe fine if your only running a few mailboxes but its not really scalable (In my Opinion at least)</p>]]></description>
			<author><![CDATA[null@example.com (imknight)]]></author>
			<pubDate>Thu, 30 Aug 2012 08:38:30 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post17966.html#p17966</guid>
		</item>
		<item>
			<title><![CDATA[Re: High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post16199.html#p16199</link>
			<description><![CDATA[<div class="quotebox"><cite>Basem wrote:</cite><blockquote><p>thanks for your efforts, I didn&#039;t have a try to build the Glusterfs rpm before but I will, but this would work fine too, however compiling the Glusterfs takes no time, I prefer to compile the source code instead.</p></blockquote></div><p>Hi, great guide. i have few questions:</p><p>1. seems you are installing iRedMail on the client only, what happens if that goes down. this seems providing redundancy to data and maybe config files (if that is mirrored across to the other 2 server)</p><p>2. how would you enable iredmail redundancy if above is &quot;1&quot; is correct because in certain environments the servers need to be up esp the MTA ?</p>]]></description>
			<author><![CDATA[null@example.com (rein)]]></author>
			<pubDate>Wed, 30 May 2012 13:31:52 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post16199.html#p16199</guid>
		</item>
		<item>
			<title><![CDATA[Re: High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post10184.html#p10184</link>
			<description><![CDATA[<p>thanks for your efforts, I didn&#039;t have a try to build the Glusterfs rpm before but I will, but this would work fine too, however compiling the Glusterfs takes no time, I prefer to compile the source code instead.</p>]]></description>
			<author><![CDATA[null@example.com (Basem)]]></author>
			<pubDate>Mon, 27 Jun 2011 08:26:33 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post10184.html#p10184</guid>
		</item>
		<item>
			<title><![CDATA[Re: High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post10170.html#p10170</link>
			<description><![CDATA[<p>hi, <br />my 2cents : <br />instead of compiling on centos : use Epel repository and :</p><p>yum install glusterfs-* -y</p><p>if you are in 64bits os , use rpm from <br /><a href="http://download.gluster.com/pub/gluster/glusterfs/LATEST/CentOS/">http://download.gluster.com/pub/gluster … ST/CentOS/</a></p><p>or rebuild via the following :</p><p>yum install python-ctypes bison flex&nbsp; libibverbs-devel rpm-build -y<br />wget <a href="http://download.gluster.com/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-3.2.1-1.src.rpm">http://download.gluster.com/pub/gluster … -1.src.rpm</a><br />rpm --rebuild glusterfs-3.2.1-1.src.rpm</p><p>then you&#039;ll get a hot ready rpm in <br />/usr/src/redhat/RPMS/i386/</p>]]></description>
			<author><![CDATA[null@example.com (saidmsl)]]></author>
			<pubDate>Sun, 26 Jun 2011 15:51:39 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post10170.html#p10170</guid>
		</item>
		<item>
			<title><![CDATA[High-Availability Maildir Storage With GlusterFS + CentOS 5.x]]></title>
			<link>http://www.iredmail.org/forum/post10163.html#p10163</link>
			<description><![CDATA[<p>Hi everyone this is my first contribution here and I wanted to produce something and I hope to be worthy</p><p>By: Basem Hegazy (Linux System Administrator)</p><p>This tutorial shows how to set up high-availability storage with two storage servers (CentOS 5.4) that use GlusterFS. Each storage server will be a mirror of the other storage server, and files in <em>/var/vmail</em> directory will be replicated automatically across both storage servers. The client (iRedMail) system (CentOS 5.4 as well) will be able to access the storage as if it was a local filesystem. </p><p>I prefer to start by this tutorial first before installing the (iRedMail) system then install the iRedMail before mounting the share folder.</p><p>I do not issue any guarantee that this will work for you!</p><p>In this tutorial I use three systems, two servers and a client:</p><div class="quotebox"><blockquote><p>• server1.example.com: IP address 192.168.0.100 (server) <br />• server2.example.com: IP address 192.168.0.101 (server) <br />• client1.example.com: IP address 192.168.0.102 (client), the Client in our case is the iRedMail server also.</p></blockquote></div><p>All three systems should be able to resolve the other systems&#039; hostnames. If this cannot be done through DNS, you should edit the <em>/etc/hosts</em> file so that it contains the following lines on all three systems:</p><div class="quotebox"><blockquote><p><em>vi /etc/hosts</em></p></blockquote></div><div class="quotebox"><blockquote><p>[...]<br />192.168.0.100 server1.example.com server1<br />192.168.0.101 server2.example.com server2<br />192.168.0.102 client1.example.com client1<br />[...]</p></blockquote></div><p>(It is also possible to use IP addresses instead of hostnames in the following setup. If you prefer to use IP addresses, you don&#039;t have to care about whether the hostnames can be resolved or not.) </p><p><strong>2)</strong> Setting Up the GlusterFS Servers for both <strong>server1.example.com</strong> and <strong>server2.example.com</strong>:</p><p>GlusterFS my not be available as a package (RPM) some CentOS 5.x distribution, therefore I will build it myself. </p><p>First I install the prerequisites:</p><div class="quotebox"><blockquote><p><em>yum groupinstall &#039;Development Tools&#039;<br />yum groupinstall &#039;Development Libraries&#039;<br />yum install libibverbs-devel fuse-devel</em></p></blockquote></div><br /><p>Then we download the latest GlusterFS release from <a href="http://www.gluster.org/download.php">http://www.gluster.org/download.php</a> and build it as follows:</p><div class="quotebox"><blockquote><p><em>cd /tmp<br />wget <a href="http://ftp.gluster.com/pub/gluster/glusterfs/2.0/LATEST/glusterfs-2.0.9.tar.gz">http://ftp.gluster.com/pub/gluster/glus … 0.9.tar.gz</a><br />tar xvfz glusterfs-2.0.9.tar.gz<br />cd glusterfs-2.0.9<br />./configure</em></p></blockquote></div><p>At the end of the ./configure command, you should see something like this:</p><div class="quotebox"><blockquote><p>[...]<br />GlusterFS configure summary<br />===========================<br />FUSE client : yes<br />Infiniband verbs : yes<br />epoll IO multiplex : yes<br />Berkeley-DB : yes<br />libglusterfsclient : yes<br />argp-standalone : no<br />[root@server1 glusterfs-2.0.9]#</p></blockquote></div><p>Then run the make command:</p><div class="quotebox"><blockquote><p><em>make &amp;&amp; make install<br />ldconfig</em></p></blockquote></div><p>Check the GlusterFS version afterwards (should be 2.0.9):</p><div class="quotebox"><blockquote><p><em>[root@server1 glusterfs-2.0.9]# glusterfs --version</em></p></blockquote></div><p>you should see something like:</p><div class="quotebox"><blockquote><p>glusterfs 2.0.9 built on Mar 1 2010 15:34:50<br />Repository revision: v2.0.9<br />Copyright (c) 2006-2009 Gluster Inc. &lt;<a href="http://www.gluster.com">http://www.gluster.com</a>&gt;<br />GlusterFS comes with ABSOLUTELY NO WARRANTY.<br />You may redistribute copies of GlusterFS under the terms of the GNU General Public License.</p><p>[root@server1 glusterfs-2.0.9]#</p></blockquote></div><p>Next we create a few directories:</p><div class="quotebox"><blockquote><p><em><br />mkdir /data/<br />mkdir /data/export<br />mkdir /data/export-ns<br />mkdir /etc/glusterfs<br /></em></p></blockquote></div><p>Now we create the GlusterFS server configuration file <em>/etc/glusterfs/glusterfsd.vol</em> which defines which directory will be exported <em>/data/export</em> and what client is allowed to connect (192.168.0.102 = client1.example.com):</p><div class="quotebox"><blockquote><p><em>vi /etc/glusterfs/glusterfsd.vol</em></p></blockquote></div><p>enter the following data:</p><div class="quotebox"><blockquote><p><em>volume posix<br />type storage/posix<br />option directory /data/export<br />end-volume</em></p><p><em>volume locks<br />type features/locks<br />subvolumes posix<br />end-volume</em></p><p><em>volume brick<br />type performance/io-threads<br />option thread-count 8<br />subvolumes locks<br />end-volume</em></p><p><em>volume server<br />type protocol/server<br />option transport-type tcp<br />option auth.addr.brick.allow 192.168.0.102<br />subvolumes brick<br />end-volume<br /></em></p></blockquote></div><p>Please note that it is possible to use wildcards for the IP addresses (like 192.168.*) and that you can specify multiple IP addresses separated by comma (e.g. 192.168.0.102,192.168.0.103). </p><p>Afterwards we create the following symlink&quot;</p><div class="quotebox"><blockquote><p><em><br />ln -s /usr/local/sbin/glusterfsd /sbin/glusterfsd<br /></em></p></blockquote></div><p>... and then the system startup links for the GlusterFS server and start it:</p><div class="quotebox"><blockquote><p><em><br />chkconfig --levels 35 glusterfsd on<br />/etc/init.d/glusterfsd start<br /></em></p></blockquote></div><p><strong>3) Setting Up the GlusterFS Client:</strong><br />client1.example.com:</p><p>GlusterFS my not be available as a package (RPM) some CentOS 5.x distribution, therefore I will build it myself. </p><p>First I install the prerequisites:</p><div class="quotebox"><blockquote><p><em><br />yum groupinstall &#039;Development Tools&#039;<br />yum groupinstall &#039;Development Libraries&#039;<br />yum install libibverbs-devel fuse-devel<br /></em></p></blockquote></div><p>Then we load the fuse kernel module...</p><div class="quotebox"><blockquote><p><em>modprobe fuse</em></p></blockquote></div><p>... And create the file <em>/etc/rc.modules</em> with the following contents so that the fuse kernel module will be loaded automatically whenever the system boots: </p><div class="quotebox"><blockquote><p><em><br />vi /etc/rc.modules<br />modprobe fuse<br /></em></p></blockquote></div><p>Then Make the file executable:</p><div class="quotebox"><blockquote><p><em>chmod +x /etc/rc.modules</em></p></blockquote></div><p>Then we download the GlusterFS 2.0.9 sources (please note that this should be the same version as that installed on the server!) and build GlusterFS as follows:</p><div class="quotebox"><blockquote><p><em><br />cd /tmp<br />wget <a href="http://ftp.gluster.com/pub/gluster/glusterfs/2.0/LATEST/glusterfs-2.0.9.tar.gz">http://ftp.gluster.com/pub/gluster/glus … 0.9.tar.gz</a><br />tar xvfz glusterfs-2.0.9.tar.gz<br />cd glusterfs-2.0.9<br />./configure<br /></em></p></blockquote></div><p>At the end of the <em>./configure</em> command, you should see something like this:</p><div class="quotebox"><blockquote><p>[...]</p><p>GlusterFS configure summary<br />===========================<br />FUSE client : yes<br />Infiniband verbs : yes<br />epoll IO multiplex : yes<br />Berkeley-DB : yes<br />libglusterfsclient : yes<br />argp-standalone : no</p></blockquote></div><p>then run the <em>make</em> command:</p><div class="quotebox"><blockquote><p><em><br />make &amp;&amp; make install<br />ldconfig<br /></em></p></blockquote></div><p>Check the GlusterFS version afterwards (should be 2.0.9):</p><div class="quotebox"><blockquote><p><em>[root@client1 glusterfs-2.0.9]# glusterfs --version</em></p></blockquote></div><p>you should see something like:</p><div class="quotebox"><blockquote><p>glusterfs 2.0.9 built on Mar 1 2010 15:58:06<br />Repository revision: v2.0.9<br />Copyright (c) 2006-2009 Gluster Inc. &lt;<a href="http://www.gluster.com">http://www.gluster.com</a>&gt;<br />GlusterFS comes with ABSOLUTELY NO WARRANTY.<br />You may redistribute copies of GlusterFS under the terms of the GNU General Public License.</p><p>[root@client1 glusterfs-2.0.9]#</p></blockquote></div><p>Then we create the following two directories:</p><div class="quotebox"><blockquote><p><em><br />mkdir /etc/glusterfs<br /></em></p></blockquote></div><p>Next we create the file <em>/etc/glusterfs/glusterfs.vol</em>:</p><div class="quotebox"><blockquote><p><em><br />vi /etc/glusterfs/glusterfs.vol<br /></em></p></blockquote></div><div class="quotebox"><blockquote><p>volume remote1<br />type protocol/client<br />option transport-type tcp<br />option remote-host server1.example.com<br />option remote-subvolume brick<br />end-volume</p><p>volume remote2<br />type protocol/client<br />option transport-type tcp<br />option remote-host server2.example.com<br />option remote-subvolume brick<br />end-volume</p><p>volume replicate<br />type cluster/replicate<br />subvolumes remote1 remote2<br />end-volume</p><p>volume writebehind<br />type performance/write-behind<br />option window-size 1MB<br />subvolumes replicate<br />end-volume</p><p>volume cache<br />type performance/io-cache<br />option cache-size 512MB<br />subvolumes writebehind<br />end-volume</p></blockquote></div><p>Make sure you use the correct server hostnames or IP addresses in the option remote-host lines!<br />That&#039;s it! Now we can Install the (iRedMail ) system before we mount the GlusterFS filesystem to <em>/var/vmail</em> with one of the following two commands:</p><div class="quotebox"><blockquote><p><em><br />glusterfs -f /etc/glusterfs/glusterfs.vol /var/vmail </em></p></blockquote></div><p>Or:</p><div class="quotebox"><blockquote><p><em><br />mount -t glusterfs /etc/glusterfs/glusterfs.vol /var/vmail <br /></em></p></blockquote></div><br /><p>You should now see the new share in the outputs of <em>mount</em></p><div class="quotebox"><blockquote><p><em>[root@client1 ~]# mount</em></p></blockquote></div><p>you will see:</p><div class="quotebox"><blockquote><p>/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)<br />proc on /proc type proc (rw)<br />sysfs on /sys type sysfs (rw)<br />devpts on /dev/pts type devpts (rw,gid=5,mode=620)<br />/dev/sda1 on /boot type ext3 (rw)<br />tmpfs on /dev/shm type tmpfs (rw)<br />none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)<br />sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)<br />glusterfs#/etc/glusterfs/glusterfs.vol on /var/vmail type fuse (rw,allow_other,default_permissions,max_read=131072)</p><p>[root@client1 ~]#</p></blockquote></div><p>... And ...</p><div class="quotebox"><blockquote><p><em>[root@client1 ~]# df –h</em></p></blockquote></div><p>you will see:</p><div class="quotebox"><blockquote><p>Filesystem Size Used Avail Use% Mounted on<br />/dev/mapper/VolGroup00-LogVol00<br />29G 2.2G 25G 9% /<br />/dev/sda1 99M 13M 82M 14% /boot<br />tmpfs 187M 0 187M 0% /dev/shm<br />glusterfs#/etc/glusterfs/glusterfs.vol<br />28G 2.3G 25G 9% /var/vmail<br />[root@client1 ~]#</p></blockquote></div><p>(server1.example.com and server2.example.com each have 28GB of space for the GlusterFS filesystem, but because the data is mirrored, the client doesn&#039;t see 56GB (2 x 28GB), but only 28GB.) <br />Instead of mounting the GlusterFS share manually on the client, you could modify <em>/etc/fstab</em> so that the share gets mounted automatically when the client boots. </p><p>Open <em>/etc/fstab</em> and append the following line: </p><div class="quotebox"><blockquote><p><em>vi /etc/fstab </em></p></blockquote></div><p>and append/add the following line:</p><div class="quotebox"><blockquote><p>[...]<br />/etc/glusterfs/glusterfs.vol /var/vmail glusterfs defaults 0 0</p></blockquote></div><p>To test if your modified <em>/etc/fstab</em> is working, reboot the client: </p><div class="quotebox"><blockquote><p><em>reboot</em></p></blockquote></div><p> </p><p>After the reboot, you should find the share in the outputs of:</p><div class="quotebox"><blockquote><p><em><br />df -h <br /></em></p></blockquote></div><p>... and...</p><div class="quotebox"><blockquote><p><em><br />mount<br /></em></p></blockquote></div><p><strong>4) Testing</strong></p><p>Now let&#039;s create some test files on the GlusterFS share:<br /><strong>client1.example.com:</strong></p><div class="quotebox"><blockquote><p><em><br />touch /var/vmail/test1<br />touch /var/vmail/test2<br /></em></p></blockquote></div><p>Now let&#039;s check the <em>/data/export</em> directory on server1.example.com and server2.example.com. The <em>test1</em> and <em>test2</em> files should be present on each node:</p><p>server1.example.com and server2.example.com:</p><div class="quotebox"><blockquote><p><em>[root@server1 ~]# ls -l /data/export</em></p></blockquote></div><p>the result is:</p><div class="quotebox"><blockquote><p><em>total 0<br />-rw-r--r-- 1 root root 0 2010-02-22 16:50 test1<br />-rw-r--r-- 1 root root 0 2010-02-22 16:50 test2<br />[root@server1 ~]#<br /></em></p></blockquote></div><p>Now we shut down server1.example.com and add/delete some files on the GlusterFS share on client1.example.com.<br />server1.example.com:</p><div class="quotebox"><blockquote><p><em><br />shutdown -h now<br /></em></p></blockquote></div><p>client1.example.com:</p><div class="quotebox"><blockquote><p><em><br />touch /var/vmail/test3<br />touch /var/vmail/test4<br />rm -f /var/vmail/test2<br /></em></p></blockquote></div><p>The changes should be visible in the <em>/data/export</em> directory on server2.example.com:<br />server2.example.com:</p><div class="quotebox"><blockquote><p><em>[root@server2 ~]# ls -l /data/export</em></p></blockquote></div><p>the result is:</p><div class="quotebox"><blockquote><p><em><br />total 0<br />-rw-r--r-- 1 root root 0 2010-02-22 16:50 test1<br />-rw-r--r-- 1 root root 0 2010-02-22 16:53 test3<br />-rw-r--r-- 1 root root 0 2010-02-22 16:53 test4<br />[root@server2 ~]#<br /></em></p></blockquote></div><p>Let&#039;s boot server1.example.com again and take a look at the <em>/data/export</em> directory:<br />server1.example.com:</p><div class="quotebox"><blockquote><p><em>[root@server1 ~]# ls -l /data/export</em></p></blockquote></div><p>the result is:</p><div class="quotebox"><blockquote><p><em><br />total 0<br />-rw-r--r-- 1 root root 0 2010-02-22 16:50 test1<br />-rw-r--r-- 1 root root 0 2010-02-22 16:50 test2<br />[root@server1 ~]#<br /></em></p></blockquote></div><p>As you see, server1.example.com hasn&#039;t noticed the changes that happened while it was down. This is easy to fix, all we need to do is invoke a read command on the GlusterFS share on client1.example.com, e.g.:<br />client1.example.com:</p><div class="quotebox"><blockquote><p><em><br />ls -l /var/vmail<br /></em></p></blockquote></div><p>However the read command happened automatically each time a user trying to access his mailbox using RoundCube webmail, even you may notice that the mailbox wasn&#039;t replicated once you create it, don&#039;t bother it does when a user access his webmail.</p><div class="quotebox"><blockquote><p><em><br />[root@client1 ~]# ls -l /var/vmail/<br /></em></p></blockquote></div><p>.. and the result is:</p><div class="quotebox"><blockquote><p><em><br />total 0<br />-rw-r--r-- 1 root root 0 2010-02-22 16:50 test1<br />-rw-r--r-- 1 root root 0 2010-02-22 16:53 test3<br />-rw-r--r-- 1 root root 0 2010-02-22 16:53 test4<br />[root@client1 ~]#<br /></em></p></blockquote></div><p>Now take a look at the <em>/data/export</em> directory on server1.example.com again, and you should see that the changes have been replicated to that node:<br />server1.example.com:</p><div class="quotebox"><blockquote><p><em>[root@server1 ~]# ls -l /data/export</em></p></blockquote></div><p>the result is:</p><div class="quotebox"><blockquote><p><em><br />total 0<br />-rw-r--r-- 1 root root 0 2010-02-22 16:50 test1<br />-rw-r--r-- 1 root root 0 2010-02-22 16:53 test3<br />-rw-r--r-- 1 root root 0 2010-02-22 16:53 test4<br />[root@server1 ~]#<br /></em></p></blockquote></div><p>Thanks and welcome for comments.</p>]]></description>
			<author><![CDATA[null@example.com (Basem)]]></author>
			<pubDate>Sun, 26 Jun 2011 11:02:38 +0000</pubDate>
			<guid>http://www.iredmail.org/forum/post10163.html#p10163</guid>
		</item>
	</channel>
</rss>
