<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>I recall a good bit of discussion about this a while back... There is a part of the wiki devoted to this topic:<br>http://www.gluster.org/docs/index.php/Setting_up_AFR_on_two_servers_with_pre-existing_data<br><br>Also I wrote a 'set-attrs' script for setting glusterfs attributes on existing data, essentially "converting" it to gluster format. Included below... It will ignore anything that already has glusterfs attributes, and will set them on anything that doesn't. <br><br>#!/bin/bash<br><br>DIR=$1<br><br>if [ -z $DIR ]<br>&nbsp;then<br>&nbsp;&nbsp;echo<br>&nbsp;&nbsp;echo "Error - no path was given."<br>&nbsp;&nbsp;echo<br>&nbsp;&nbsp;echo &nbsp;"USAGE: &nbsp;set-attrs /path/to/check"<br>&nbsp;&nbsp;echo<br>&nbsp;&nbsp;echo &nbsp;"Run set-attrs to check all files and directories in the"<br>&nbsp;&nbsp;echo &nbsp;"given path for glusterfs attributes. Any files without"<br>&nbsp;&nbsp;echo &nbsp;"a glusterfs version will be given a version attr of 2"<br>&nbsp;&nbsp;echo &nbsp;"and a createtime attr equal to the files last modified time."<br>&nbsp;&nbsp;echo<br>&nbsp;&nbsp;echo &nbsp;"Output information is logged to syslog (usually /var/log/messages)"<br>&nbsp;&nbsp;echo<br>&nbsp;&nbsp;exit 0<br>&nbsp;fi<br><br>set_attrs() &nbsp;{<br><br>get_ver="getfattr --absolute-names -n trusted.glusterfs.version"<br>set_ver="setfattr -n trusted.glusterfs.version"<br>set_ct="setfattr -n trusted.glusterfs.createtime"<br><br>if test "`$get_ver $i 2&gt;/dev/null | fgrep -c trusted.glusterfs.version=`" = "0"<br>&nbsp;then<br>&nbsp;&nbsp; mods=$((mods+1))<br>&nbsp;&nbsp; # comment out next line to turn off logging<br>&nbsp;&nbsp; initlog -n set-attrs -s "Setting attrs on $i"<br>&nbsp;&nbsp; CT=`stat -c %Y $i`<br>&nbsp;&nbsp; $set_ct -v $CT $i<br>&nbsp;&nbsp; $set_ver -v 2 $i<br>&nbsp;fi<br>}<br><br>mods=0<br>checks=0<br><br>initlog -n set-attrs -s "Starting a set-attrs run on path: $DIR"<br><br>for i in `find $DIR -print`<br>&nbsp;do<br>&nbsp;&nbsp; set_attrs $i<br>&nbsp;&nbsp; checks=$((checks+1))<br>&nbsp;done<br><br>initlog -n set-attrs -s "Completed. $checks checks and $mods mods in this run"<br><br>exit 0<br><br><br>----- Original Message -----<br>From: "Stas Oskin" &lt;stas.oskin@gmail.com&gt;<br>To: gluster-users@gluster.org<br>Sent: Wednesday, February 4, 2009 6:39:34 PM GMT -05:00 US/Canada Eastern<br>Subject: [Gluster-users] Transforming server with existing data into a GlusterFS node<br><br><div dir="rtl"><div dir="ltr">Hi.<br><br>I wonder, is it possible to transform a server with existing data into GlusterFS node?<br>Meaning, define a volume then gradually move all the files into it?<br><br>Or it's much better to start a new one from scratch?<br>
<br>Regards.<br></div></div>
<br>_______________________________________________
Gluster-users mailing list
Gluster-users@gluster.org
http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users
</div></body></html>