<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">For removing the bricks from the
      replica , we can just execute the command "replace-brick" with
      "commit force" option <br>
      <br>
      Following is the procedure to replace the brick in the replicated
      volume.<br>
      <br>
      ##Replacing brick in Replicate/Distributed Replicate volumes<br>
      <br>
      This section of the document contains how brick:
      `pranithk-laptop:/home/gfs/r2_0` is replaced with brick:
      `pranithk-laptop:/home/gfs/r2_5` in volume `r2` with replica count
      `2`.<br>
      <br>
      Steps:<br>
      0. Make sure there is no data in the new brick
      pranithk-laptop:/home/gfs/r2_5<br>
      1. Check that all the bricks are running. It is okay if the brick
      that is going to be replaced is down.<br>
      2. Bring the brick that is going to be replaced down if not
      already.<br>
      <br>
      &nbsp; 1. Get the pid of the brick by executing 'gluster volume
      &lt;volname&gt; status'<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; 12:37:49 &#9889; gluster volume status<br>
      &nbsp;&nbsp;&nbsp; Status of volume: r2<br>
      &nbsp;&nbsp;&nbsp; Gluster process&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Port&nbsp;&nbsp;&nbsp; Online&nbsp;&nbsp;&nbsp; Pid<br>
      &nbsp;&nbsp;&nbsp;
------------------------------------------------------------------------------<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49152&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5342<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49153&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5354<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49154&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5365<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49155&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5376<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      &nbsp; 2. Login to the machine where the brick is running and kill the
      brick.<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; 12:38:33 &#9889; kill -9 5342<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      &nbsp; 3. Confirm that the brick is not running anymore and the other
      bricks are running fine.<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; 12:38:38 &#9889; gluster volume status<br>
      &nbsp;&nbsp;&nbsp; Status of volume: r2<br>
      &nbsp;&nbsp;&nbsp; Gluster process&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Port&nbsp;&nbsp;&nbsp; Online&nbsp;&nbsp;&nbsp; Pid<br>
      &nbsp;&nbsp;&nbsp;
------------------------------------------------------------------------------<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N/A&nbsp;&nbsp;&nbsp; N&nbsp;&nbsp;&nbsp;
      5342 &lt;&lt;---- brick&nbsp;&nbsp;&nbsp;&nbsp; is not running, others are running
      fine.<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49153&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5354<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49154&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5365<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49155&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5376<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      3. Using the gluster volume fuse mount (In this example:
      `/mnt/r2`) set up metadata so that data will be synced to new
      brick (In this case it is from `pranithk-laptop:/home/gfs/r2_1` to
      `pranithk-laptop:/home/gfs/r2_5`)<br>
      &nbsp; 1. Create a directory on the mount point that doesn't already
      exist. Then delete that directory, do the same for metadata
      changelog by doing setfattr. This operation marks the pending
      changelog which will tell self-heal damon/mounts to perform
      self-heal from /home/gfs/r2_1 to /home/gfs/r2_5.<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; mkdir /mnt/r2/&lt;name-of-nonexistent-dir&gt;<br>
      &nbsp;&nbsp;&nbsp; rmdir /mnt/r2/&lt;name-of-nonexistent-dir&gt;<br>
      &nbsp;&nbsp;&nbsp; setfattr -n trusted.non-existent-key -v abc /mnt/r2<br>
      &nbsp;&nbsp;&nbsp; setfattr -x trusted.non-existent-key&nbsp; /mnt/r2<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      &nbsp; 2. Check that there are pending xattrs:<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; getfattr -d -m. -e hex /home/gfs/r2_1<br>
      &nbsp;&nbsp;&nbsp; # file: home/gfs/r2_1<br>
      &nbsp;&nbsp;&nbsp;
security.selinux=0x756e636f6e66696e65645f753a6f626a6563745f723a66696c655f743a733000<br>
      &nbsp;&nbsp;&nbsp; trusted.afr.r2-client-0=0x000000000000000300000002
      &lt;&lt;---- xattrs are marked&nbsp;&nbsp;&nbsp;&nbsp; from source brick
      pranithk-laptop:/home/gfs/r2_1<br>
      &nbsp;&nbsp;&nbsp; trusted.afr.r2-client-1=0x000000000000000000000000<br>
      &nbsp;&nbsp;&nbsp; trusted.gfid=0x00000000000000000000000000000001<br>
      &nbsp;&nbsp;&nbsp; trusted.glusterfs.dht=0x0000000100000000000000007ffffffe<br>
      &nbsp;&nbsp;&nbsp; trusted.glusterfs.volume-id=0xde822e25ebd049ea83bfaa3c4be2b440<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      4. Replace the brick with 'commit force' option. Please note that
      other variants of replace-brick command are not supported.<br>
      <br>
      &nbsp; 1. Execute replace-brick command<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; 12:58:46 &#9889; gluster volume replace-brick r2
      `hostname`:/home/gfs/r2_0 `hostname`:/home/gfs/r2_5 commit force<br>
      &nbsp;&nbsp;&nbsp; volume replace-brick: success: replace-brick commit successful<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      &nbsp; 2. Check that the new brick is now online<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; 12:59:21 &#9889; gluster volume status<br>
      &nbsp;&nbsp;&nbsp; Status of volume: r2<br>
      &nbsp;&nbsp;&nbsp; Gluster process&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Port&nbsp;&nbsp;&nbsp; Online&nbsp;&nbsp;&nbsp; Pid<br>
      &nbsp;&nbsp;&nbsp;
------------------------------------------------------------------------------<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49156&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5731 &lt;&lt;&lt;---- new&nbsp;&nbsp;&nbsp;&nbsp; brick is online<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49153&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5354<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49154&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5365<br>
      &nbsp;&nbsp;&nbsp; Brick pranithk-laptop:/home/gfs/r2_3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49155&nbsp;&nbsp;&nbsp; Y&nbsp;&nbsp;&nbsp;
      5376<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      &nbsp; 3. Once self-heal completes the changelogs will be removed.<br>
      <br>
      &nbsp;&nbsp;&nbsp; ```<br>
      &nbsp;&nbsp;&nbsp; 12:59:27 &#9889; getfattr -d -m. -e hex /home/gfs/r2_1<br>
      &nbsp;&nbsp;&nbsp; getfattr: Removing leading '/' from absolute path names<br>
      &nbsp;&nbsp;&nbsp; # file: home/gfs/r2_1<br>
      &nbsp;&nbsp;&nbsp;
security.selinux=0x756e636f6e66696e65645f753a6f626a6563745f723a66696c655f743a733000<br>
      &nbsp;&nbsp;&nbsp; trusted.afr.r2-client-0=0x000000000000000000000000
      &lt;&lt;---- Pending changelogs are cleared.<br>
      &nbsp;&nbsp;&nbsp; trusted.afr.r2-client-1=0x000000000000000000000000<br>
      &nbsp;&nbsp;&nbsp; trusted.gfid=0x00000000000000000000000000000001<br>
      &nbsp;&nbsp;&nbsp; trusted.glusterfs.dht=0x0000000100000000000000007ffffffe<br>
      &nbsp;&nbsp;&nbsp; trusted.glusterfs.volume-id=0xde822e25ebd049ea83bfaa3c4be2b440<br>
      &nbsp;&nbsp;&nbsp; ```<br>
      <br>
      <br>
      On 08/27/2014 02:59 AM, Joseph Jozwik wrote:<br>
    </div>
    <blockquote
cite="mid:CAL2VQWUJ6MndgTv2gVBMabbNEH75i8MENCTMV8ErLAA+anauCw@mail.gmail.com"
      type="cite">
      <div dir="ltr">To add to this it appears that replace brick is in
        a broken state. &nbsp;I can't abort it, or commit it. And I can run
        any other commands until it thinks the replace-brick is
        complete.
        <div><br>
        </div>
        <div>Is there a way to manually remove the task since it failed?</div>
        <div><br>
          <div><br>
          </div>
          <div>
            <div>root@pixel-glusterfs1:/# gluster volume status gdata2tb</div>
            <div>Status of volume: gdata2tb</div>
            <div>Gluster process &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              Port &nbsp; &nbsp;Online &nbsp;Pid</div>
            <div>
------------------------------------------------------------------------------</div>
            <div>Brick 10.0.1.31:/mnt/data2tb/gbrick3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;49157 &nbsp; Y &nbsp; &nbsp; &nbsp; 14783</div>
            <div>Brick 10.0.1.152:/mnt/raid10/gbrick3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;49158 &nbsp; Y &nbsp; &nbsp; &nbsp; 2622</div>
            <div>Brick 10.0.1.153:/mnt/raid10/gbrick3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;49153 &nbsp; Y &nbsp; &nbsp; &nbsp; 3034</div>
            <div>NFS Server on localhost &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              2049 &nbsp; &nbsp;Y &nbsp; &nbsp; &nbsp; 14790</div>
            <div>Self-heal Daemon on localhost &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              N/A &nbsp; &nbsp; Y &nbsp; &nbsp; &nbsp; 14794</div>
            <div>NFS Server on 10.0.0.205 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;N/A &nbsp; &nbsp; N &nbsp; &nbsp; &nbsp; N/A</div>
            <div>Self-heal Daemon on 10.0.0.205 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;N/A &nbsp; &nbsp; Y &nbsp; &nbsp; &nbsp; 10323</div>
            <div>NFS Server on 10.0.1.153 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;2049 &nbsp; &nbsp;Y &nbsp; &nbsp; &nbsp; 12735</div>
            <div>Self-heal Daemon on 10.0.1.153 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;N/A &nbsp; &nbsp; Y &nbsp; &nbsp; &nbsp; 12742</div>
            <div>NFS Server on 10.0.1.152 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;2049 &nbsp; &nbsp;Y &nbsp; &nbsp; &nbsp; 2629</div>
            <div>Self-heal Daemon on 10.0.1.152 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
              &nbsp;N/A &nbsp; &nbsp; Y &nbsp; &nbsp; &nbsp; 2636</div>
            <div><br>
            </div>
            <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Task &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ID
              &nbsp; &nbsp; &nbsp; &nbsp; Status</div>
            <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--
              &nbsp; &nbsp; &nbsp; &nbsp; ------</div>
            <div>&nbsp; Replace brick &nbsp; &nbsp;1dace9f0-ba98-4db9-9124-c962e74cce07
              &nbsp; &nbsp; &nbsp;completed</div>
            <div><br>
            </div>
            <br>
            <div class="gmail_quote">---------- Forwarded message
              ----------<br>
              From: <b class="gmail_sendername">Joseph Jozwik</b> <span
                dir="ltr">&lt;<a moz-do-not-send="true"
                  href="mailto:jjozwik@printsites.com">jjozwik@printsites.com</a>&gt;</span><br>
              Date: Tue, Aug 26, 2014 at 3:42 PM<br>
              Subject: Moving brick of replica volume to new mount on
              filesystem.<br>
              To: <a moz-do-not-send="true"
                href="mailto:gluster-users@gluster.org">gluster-users@gluster.org</a><br>
              <br>
              <br>
              <div dir="ltr"><br clear="all">
                <div>
                  <div>Hello,</div>
                  <div><br>
                  </div>
                  <div>I need to move a brick to another location on the
                    filesystem. &nbsp;</div>
                  <div>My initial plan was to stop the gluster server
                    with&nbsp;</div>
                  <div>1. service glusterfs-server stop&nbsp;</div>
                  <div>2. rsync -ap brick3 folder to new volume on
                    server&nbsp;</div>
                  <div>3. umount old volume and bind mount the new to
                    the same location.</div>
                  <div><br>
                  </div>
                  <div>However I stopped the glusterfs-server on the
                    node and there was still background processes
                    running glusterd. So I was not sure how to safely
                    stop them.</div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div>I also attempted to replace-brick to a new
                    location on the server but that did not work with
                    "volume replace-brick: failed: Commit failed on
                    localhost. Please check the log file for more
                    details."</div>
                  <div><br>
                  </div>
                  <div>Then attempted remove brick with&nbsp;</div>
                  <div><br>
                  </div>
                  <div>"volume remove-brick gdata2tb replica 2
                    10.0.1.31:/mnt/data2tb/gbrick3 start"</div>
                  <div>gluster&gt; volume remove-brick gdata2tb
                    10.0.1.31:/mnt/data2tb/gbrick3 status</div>
                  <div>volume remove-brick: failed: Volume gdata2tb is
                    not a distribute volume or contains only 1 brick.</div>
                  <div>Not performing rebalance</div>
                  <div>gluster&gt;</div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div>Volume Name: gdata2tb</div>
                  <div>Type: Replicate</div>
                  <div>Volume ID: 6cbcb2fc-9fd7-467e-9561-bff1937e8492</div>
                  <div>Status: Started</div>
                  <div>Number of Bricks: 1 x 3 = 3</div>
                  <div>Transport-type: tcp</div>
                  <div>Bricks:</div>
                  <div>Brick1: 10.0.1.31:/mnt/data2tb/gbrick3</div>
                  <div>Brick2: 10.0.1.152:/mnt/raid10/gbrick3</div>
                  <div>Brick3: 10.0.1.153:/mnt/raid10/gbrick3</div>
                </div>
              </div>
            </div>
            <br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Gluster-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a>
<a class="moz-txt-link-freetext" href="http://supercolony.gluster.org/mailman/listinfo/gluster-users">http://supercolony.gluster.org/mailman/listinfo/gluster-users</a></pre>
    </blockquote>
    <br>
    <br>
  </body>
</html>