<div dir="ltr"><div><div>Hello Niels,<br><br></div>Thanks for your explanation. I&#39;m happy you consider my proposal doable and that many ideas came to your mind. I would like to contribute to it, but I really don&#39;t know anything about the GlusterFS code and APIs, so I don&#39;t know where to start and, in this condition, I think it is not an easy job to do. I had a rapid look at the functions already existent in the APIs, thinking that perhaps a low level copy function was already present and I could use it (I saw that, for example, the rename function uses this approach), but could not find anything. <br>
Therefore I hope someone has the time and feels like implementing this idea, I agree it would be a good improvement, not just for me.<br><br></div>Giacomo<br>
</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div style="font-family:Arial,Helvetica,sans-serif;font-size:11px;color:rgb(96,96,96);line-height:14px" align="left"><div align="left"><div align="left">
<div align="left"><b style="font-size:12px">Giacomo Fazio</b><br>IT Engineer<br><br>Tel. +41 91 910 7690<br>E-mail: <a href="mailto:giacomo.fazio@wcpmediaservices.com" style="color:rgb(227,6,19);text-decoration:none" target="_blank">giacomo.fazio@wcpmediaservices.com</a>  |  Web: <a href="http://www.wcpmediaservices.com" style="color:rgb(227,6,19);text-decoration:none" target="_blank">www.wcpmediaservices.com</a><br>
<br><span style="color:rgb(227,6,19)">Europe Office:</span> Via Zurigo 35, 6900 Lugano, Switzerland<br><span style="color:rgb(227,6,19)">USA Office:</span> 7083 Hollywood Boulevard Los Angeles, CA 90028</div><div style="color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size:medium;line-height:normal;margin-top:10px">
<img src="http://wcpapp.wcpmediaservices.net/images/firma-wcpmediaservices.png" alt="" height="130" width="380"></div></div></div></div></div></div>
<br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 3:27 PM, Niels de Vos <span dir="ltr">&lt;<a href="mailto:ndevos@redhat.com" target="_blank">ndevos@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On Fri, Aug 22, 2014 at 01:26:02PM +0200, Giacomo Fazio wrote:<br>
&gt; Hi there,<br>
&gt;<br>
&gt; Thanks to both Soumya and Prashanth. Actually you are both right. With the<br>
&gt; approach proposed by Soumya I would avoid the FUSE overhead but, as<br>
&gt; Prashanth says, the network transfer overhead would be always present. This<br>
&gt; is particularly important for me because I deal with very big files<br>
&gt; (usually around 100 GB and even more), so that network transfer have a big<br>
&gt; impact, while I don&#39;t think the impact of the FUSE overhead is that big.<br>
&gt; That&#39;s why what I would like to get is a &quot;brick to brick&quot; copy (just server<br>
&gt; side), so I would like to use the APIs to order the server to make a copy,<br>
&gt; so that the network transfer can be avoided.<br>
&gt;<br>
&gt; As far as I understood, it is not currently possible with libgfapi. Do you<br>
&gt; think it would be difficult to implement? Are there any other ways?<br>
&gt; Thank you and best regards,<br>
<br>
</div>&quot;Difficult&quot; is always relative, it depends on many factors :) But<br>
I think implementing server-side copy is quite doable. You should start<br>
with thinking of, and proposing a design. Some ideas that would work:<br>
<br>
a.<br>
    Have a server-side daemon (maybe glusterd) handle the copy. Some new<br>
    libgfapi or gluster-cli function can then connect to the daemon and<br>
    pass the instruction on (src brick + dst volume + src+dst filename).<br>
    This daemon can then connect to it&#39;s instance on the server hosting<br>
    the source-brick, and initiate the copy.<br>
<br>
b.<br>
    Add a new file operation to the GlusterFS protocol, something like<br>
    copy-to-brick. This operation would receive the request from the<br>
    client (the client talks to the src-brick hosting the src-file as<br>
    usual), and the brick process needs to learn how to connect to an<br>
    other brick (from a different volume) and create/write the file<br>
    there. The client application should be smart enough to pass the<br>
    path to the dst-brick that should contain the dst-file.<br>
<br>
While writing this, I have convinced myself that (a) would surely be<br>
easier to do.  GlusterD could spawn a special copy process (like<br>
a libgfapi client) that connects to the source and destination volumes,<br>
do the copy, and exit.<br>
<br>
This also makes it much easier to start contributing!<br>
<br>
1.<br>
    A relatively simple libgfapi binary that implements &quot;cp&quot; with<br>
    volume:/path/to/file as parameters should not be too difficult. Of<br>
    course, you may need to mkdir the (parent) structure on the<br>
    destination too, possibly adding a &quot;-r&quot; option for recursive<br>
    copying.<br>
<br>
2.<br>
    A second step could then integrate this cp/libgfapi implementation<br>
    in some gluster-cli/glusterd procedures.<br>
<br>
3.<br>
    Making it smarter and initiate the copy from one of the source<br>
    bricks, can then be an other step.<br>
<br>
<br>
For (1), it could be easier to extend some available copy-tool.<br>
Something like rsync already supports different protocols. Maybe it is<br>
possible to teach rsync how and what functions to call from libgfapi.<br>
rsync supports many useful options already, writing a new cp/libgfapi<br>
from scratch that matches only a subset from the features that rsync<br>
has, will be a major project.<br>
<br>
The above are just some ideas, thinking out loud... But, starting with<br>
integrating libgfapi in rsync or similar sounds like a major usability<br>
improvement for many Gluster users.<br>
<br>
Niels<br>
<div class=""><br>
<br>
&gt;<br>
&gt; *Giacomo Fazio*<br>
&gt; IT Engineer<br>
&gt;<br>
&gt; Tel. <a href="tel:%2B41%2091%20910%207690" value="+41919107690">+41 91 910 7690</a><br>
</div>&gt; E-mail: <a href="mailto:giacomo.fazio@wcpmediaservices.com">giacomo.fazio@wcpmediaservices.com</a>  |  Web: <a href="http://www.wcpmediaservices.com" target="_blank">www.wcpmediaservices.com</a><br>
<div class="im HOEnZb">&gt;<br>
&gt; Europe Office: Via Zurigo 35, 6900 Lugano, Switzerland<br>
&gt; USA Office: 7083 Hollywood Boulevard Los Angeles, CA 90028<br>
&gt;<br>
&gt;<br>
</div><div class="HOEnZb"><div class="h5">&gt; On Fri, Aug 22, 2014 at 9:36 AM, Prashanth Pai &lt;<a href="mailto:ppai@redhat.com">ppai@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; Even with that approach, data would still be read (over the n/w) at the<br>
&gt; &gt; client (the app using libgfapi). I think what he is looking for is a server<br>
&gt; &gt; side copy (brick to brick) or within same brick _without_ the need for data<br>
&gt; &gt; to go through client.<br>
&gt; &gt;<br>
&gt; &gt; Swift has this feature[1] and it would be really cool for glusterfs to<br>
&gt; &gt; have it (may be as an external tool or as a API in libgfapi) :)<br>
&gt; &gt;<br>
&gt; &gt; # gluster-copy &lt;src&gt; &lt;dest&gt;<br>
&gt; &gt; or<br>
&gt; &gt; glfs_copy(src,dest)<br>
&gt; &gt;<br>
&gt; &gt; [1]<br>
&gt; &gt; <a href="http://programmerthoughts.com/openstack/server-side-object-copy-in-openstack-storage/" target="_blank">http://programmerthoughts.com/openstack/server-side-object-copy-in-openstack-storage/</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt;  -Prashanth Pai<br>
&gt; &gt;<br>
&gt; &gt; ----- Original Message -----<br>
&gt; &gt; From: &quot;Soumya Koduri&quot; &lt;<a href="mailto:skoduri@redhat.com">skoduri@redhat.com</a>&gt;<br>
&gt; &gt; To: &quot;Giacomo Fazio&quot; &lt;<a href="mailto:giacomo.fazio@wcpmediaservices.com">giacomo.fazio@wcpmediaservices.com</a>&gt;, &quot;John Mark<br>
&gt; &gt; Walker&quot; &lt;<a href="mailto:johnmark@gluster.org">johnmark@gluster.org</a>&gt;<br>
&gt; &gt; Cc: <a href="mailto:gluster-devel@gluster.org">gluster-devel@gluster.org</a>, &quot;Giovanni Contri&quot; &lt;<br>
&gt; &gt; <a href="mailto:giovanni.contri@wcpmediaservices.com">giovanni.contri@wcpmediaservices.com</a>&gt;, <a href="mailto:forge-admin@gluster.org">forge-admin@gluster.org</a><br>
&gt; &gt; Sent: Friday, August 22, 2014 12:40:01 PM<br>
&gt; &gt; Subject: Re: [Gluster-devel] Question about file copy through libgfapi<br>
&gt; &gt;<br>
&gt; &gt; Hi Giacomo,<br>
&gt; &gt;<br>
&gt; &gt; If your requirement is to get away with fuse/protocol clients and do<br>
&gt; &gt; server-side operations, I think its doable by writing a simple libgfapi<br>
&gt; &gt; application. But since there is no libgfapi API equivalent to &quot;cp&quot;<br>
&gt; &gt; command, you may need to implement that functionality using &quot;glfs_open,<br>
&gt; &gt; glfs_read &amp; glfs_write&quot; APIs.<br>
&gt; &gt;<br>
&gt; &gt; Here are the few links which Humble has documented on how to use<br>
&gt; &gt; libgfapi and different APIs supported by it-<br>
&gt; &gt;<br>
&gt; &gt; <a href="http://humblec.com/libgfapi-interface-glusterfs/" target="_blank">http://humblec.com/libgfapi-interface-glusterfs/</a><br>
&gt; &gt; <a href="https://github.com/gluster/glusterfs/blob/master/doc/features/libgfapi.md" target="_blank">https://github.com/gluster/glusterfs/blob/master/doc/features/libgfapi.md</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Few sample examples (written in &#39;C&#39; and &#39;python&#39;) are copied to -<br>
&gt; &gt; <a href="https://github.com/gluster/glusterfs/tree/master/api/examples" target="_blank">https://github.com/gluster/glusterfs/tree/master/api/examples</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt; Soumya<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On 08/21/2014 08:45 PM, Giacomo Fazio wrote:<br>
&gt; &gt; &gt; Hi John,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks for your quick answer. Do you mean that my question can be<br>
&gt; &gt; &gt; summarized in &quot;can we do server-only operations?&quot;? Yes, I think so.<br>
&gt; &gt; &gt; Please let me know as soon as you receive any answer or provide me a<br>
&gt; &gt; &gt; link where I can follow directly this case.<br>
&gt; &gt; &gt; Thanks in advance and best regards,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; *Giacomo Fazio*<br>
&gt; &gt; &gt; IT Engineer<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Tel. <a href="tel:%2B41%2091%20910%207690" value="+41919107690">+41 91 910 7690</a><br>
&gt; &gt; &gt; E-mail: <a href="mailto:giacomo.fazio@wcpmediaservices.com">giacomo.fazio@wcpmediaservices.com</a><br>
&gt; &gt; &gt; &lt;mailto:<a href="mailto:giacomo.fazio@wcpmediaservices.com">giacomo.fazio@wcpmediaservices.com</a>&gt;  |  Web:Â<br>
&gt; &gt; &gt; <a href="http://www.wcpmediaservices.com" target="_blank">www.wcpmediaservices.com</a> &lt;<a href="http://www.wcpmediaservices.com" target="_blank">http://www.wcpmediaservices.com</a>&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Europe Office: Via Zurigo 35, 6900 Lugano, Switzerland<br>
&gt; &gt; &gt; USA Office: 7083 Hollywood Boulevard Los Angeles, CA 90028<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Thu, Aug 21, 2014 at 5:04 PM, John Mark Walker &lt;<a href="mailto:johnmark@gluster.org">johnmark@gluster.org</a><br>
&gt; &gt; &gt; &lt;mailto:<a href="mailto:johnmark@gluster.org">johnmark@gluster.org</a>&gt;&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;     Thanks, Giacomo. I&#39;m sending this to the gluster-devel list - it&#39;s<br>
&gt; &gt; &gt;     an interesting question. Basically, can we do server-only operations?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;     -JM<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt;  ------------------------------------------------------------------------<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;         Hello,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;         I am currently using GlusterFS version 3.5 with two bricks. What<br>
&gt; &gt; &gt;         I currently do is mounting the whole storage in some Linux<br>
&gt; &gt; &gt;         clients (RedHat) through fuse.glusterfs that (I think) uses NFS<br>
&gt; &gt; &gt;         in the background.<br>
&gt; &gt; &gt;         What I would like to do is copying a file from a directory to<br>
&gt; &gt; &gt;         another one in the storage in the quickest way. Using a &quot;cp<br>
&gt; &gt; &gt;         file1 file2&quot; from my RedHat client is not the best option<br>
&gt; &gt; &gt;         because the data flows from the storage to my RedHat client<br>
&gt; &gt; &gt;         through the network and then back to the storage. I would like<br>
&gt; &gt; &gt;         instead to avoid this waste of time and copy the file directly<br>
&gt; &gt; &gt;         from the 1st directory to the 2nd one. So, in a nutshell, I<br>
&gt; &gt; &gt;         would like to have file1 -&gt; file2  , instead of file1 -&gt;<br>
&gt; &gt; &gt;         RedHatclient -&gt; file2<br>
&gt; &gt; &gt;         Do you think is it possible, for example using libgfapi? Any<br>
&gt; &gt; &gt;         example to show me?<br>
&gt; &gt; &gt;         Thank you in advance and best regards,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;         *Giacomo Fazio*<br>
&gt; &gt; &gt;         IT Engineer<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;         Tel. +41 91 910 7690 &lt;tel:%2B41%2091%20910%207690&gt;<br>
&gt; &gt; &gt;         E-mail: <a href="mailto:giacomo.fazio@wcpmediaservices.com">giacomo.fazio@wcpmediaservices.com</a><br>
&gt; &gt; &gt;         &lt;mailto:<a href="mailto:giacomo.fazio@wcpmediaservices.com">giacomo.fazio@wcpmediaservices.com</a>&gt;  |  Web:Â<br>
&gt; &gt; &gt;         <a href="http://www.wcpmediaservices.com" target="_blank">www.wcpmediaservices.com</a> &lt;<a href="http://www.wcpmediaservices.com" target="_blank">http://www.wcpmediaservices.com</a>&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;         Europe Office: Via Zurigo 35, 6900 Lugano, Switzerland<br>
&gt; &gt; &gt;         USA Office: 7083 Hollywood Boulevard Los Angeles, CA 90028<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; Gluster-devel mailing list<br>
&gt; &gt; &gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
&gt; &gt; &gt; <a href="http://supercolony.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://supercolony.gluster.org/mailman/listinfo/gluster-devel</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Gluster-devel mailing list<br>
&gt; &gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
&gt; &gt; <a href="http://supercolony.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://supercolony.gluster.org/mailman/listinfo/gluster-devel</a><br>
&gt; &gt;<br>
<br>
&gt; _______________________________________________<br>
&gt; Gluster-devel mailing list<br>
&gt; <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
&gt; <a href="http://supercolony.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://supercolony.gluster.org/mailman/listinfo/gluster-devel</a><br>
<br>
</div></div></blockquote></div><br></div>