10.4. Migrating Volumes

You can redistribute the data across bricks while the trusted storage pool is online and available.

Note

Before you perform replace-brick operation, review the known issues related to replace-brick operation in the Red Hat Storage 2.0 Update 4 Release Notes.
To migrate a volume
  1. Make sure the new brick, server5 in this example, is successfully added to the trusted storage pool.
  2. Migrate the data from one brick to another using the following command:
    # gluster volume replace-brick VOLNAME BRICK NEW-BRICK start
    For example, to migrate the data in server3:/exp3 to server5:/exp5 in test-volume:
    # gluster volume replace-brick test-volume server3:/exp3  server5:exp5 start
    Replace brick start operation successful

    Note

    You need to have the FUSE package installed on the server on which you are running the replace-brick command for the command to work.
  3. To pause the migration operation, if needed, use the following command:
    # gluster volume replace-brick VOLNAME BRICK NEW-BRICK pause
    For example, to pause the data migration from server3:/exp3 to server5:/exp5 in test-volume:
    # gluster volume replace-brick test-volume server3:/exp3 server5:exp5 pause
    Replace brick pause operation successful
  4. To abort the migration operation, if needed, use the following command:
    # gluster volume replace-brick VOLNAME BRICK NEW-BRICK abort
    For example, to abort the data migration from server3:/exp3 to server5:/exp5 in test-volume:
    # gluster volume replace-brick test-volume server3:/exp3 server5:exp5 abort
    Replace brick abort operation successful
  5. Check the status of the migration operation using the following command:
    # gluster volume replace-brick VOLNAME BRICK NEW-BRICK status
    For example, to check the data migration status from server3:/exp3 to server5:/exp5 in test-volume:
    # gluster volume replace-brick test-volume server3:/exp3 server5:/exp5 status
    Current File = /usr/src/linux-headers-2.6.31-14/block/Makefile 
    Number of files migrated = 10567
    Migration complete
    The status command shows the current file being migrated along with the current total number of files migrated. After completion of migration, it displays Migration complete.
  6. Commit the migration of data from one brick to another using the following command:
    # gluster volume replace-brick VOLNAME BRICK NEW-BRICK commit
    For example, to commit the data migration from server3:/exp3 to server5:/exp5 in test-volume:
    # gluster volume replace-brick test-volume server3:/exp3 server5:/exp5 commit
    replace-brick commit successful
  7. Verify the migration of brick by viewing the volume info using the following command:
    # gluster volume info VOLNAME
    For example, to check the volume information of new brick server5:/exp5 in test-volume:
    # gluster volume info test-volume
    Volume Name: testvolume
    Type: Replicate
    Status: Started
    Number of Bricks: 4
    Transport-type: tcp
    Bricks:
    Brick1: server1:/exp1
    Brick2: server2:/exp2
    Brick3: server4:/exp4
    Brick4: server5:/exp5
    
    The new volume details are displayed.
    
    The new volume details are displayed.
    In the above example, previously, there were bricks; 1,2,3, and 4 and now brick 3 is replaced by brick 5.