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
- Make sure the new brick, server5 in this example, is successfully added to the trusted storage pool.For more information, see Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Migrate the data from one brick to another using the following command:
# gluster volume replace-brickVOLNAMEBRICKNEW-BRICKstartFor 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. - To pause the migration operation, if needed, use the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKpauseFor 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
- To abort the migration operation, if needed, use the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKabortFor 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
- Check the status of the migration operation using the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKstatusFor 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. - Commit the migration of data from one brick to another using the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKcommitFor 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
- Verify the migration of brick by viewing the volume info using the following command:
# gluster volume infoVOLNAMEFor 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.