이 콘텐츠는 선택한 언어로 제공되지 않습니다.

8.4. Shrinking Volumes


You can shrink volumes while the trusted storage pool is online and available. For example, you may need to remove a brick that has become inaccessible in a distributed volume because of a hardware or network failure.

Note

When shrinking distributed replicated or distributed striped volumes, the number of bricks being removed must be a multiple of the replica or stripe count. For example, to shrink a distributed striped volume with a stripe count of 2, you need to remove bricks in multiples of 2 (such as 4, 6, 8, etc.). In addition, the bricks you are removing must be from the same sub-volume (the same replica or stripe set). In a non-replicated volume, all bricks must be available in order to migrate data and perform the remove brick operation. In a replicated volume, at least one of the bricks in the replica must be available.

Shrinking a Volume

  1. Remove a brick using the following command:
    # gluster volume remove-brick VOLNAME BRICK start# gluster volume remove-brick VOLNAME BRICK start# gluster volume remove-brick VOLNAME BRICK start# gluster volume remove-brick VOLNAME BRICK start
    Copy to Clipboard Toggle word wrap
    For example:
    # gluster volume remove-brick test-volume server2:/exp2 start
    Remove Brick start successful
    Copy to Clipboard Toggle word wrap

    Note

    If the remove-brick command is run with force or without any option, the data on the brick that you are removing will no longer be accessible at the glusterFS mount point. When using the start option, the data is migrated to other bricks, and on a successful commit the removed brick's information is deleted from the volume configuration. Data can still be accessed directly on the brick.
  2. You can view the status of the remove brick operation using the following command:
    # gluster volume remove-brick VOLNAME BRICK status# gluster volume remove-brick VOLNAME BRICK status# gluster volume remove-brick VOLNAME BRICK status# gluster volume remove-brick VOLNAME BRICK status
    Copy to Clipboard Toggle word wrap
    For example:
    # gluster volume remove-brick test-volume server2:/exp2 status
          Node    Rebalanced-files          size       scanned      failures         status
     ---------         -----------   -----------   -----------   -----------   ------------
     localhost                  16      16777216            52             0    in progress
    192.168.1.1                 13      16723211            47             0    in progress
    Copy to Clipboard Toggle word wrap
  3. When the data migration shown in the previous status command is complete, run the following command to commit the brick removal:
    # gluster volume remove-brick VOLNAME BRICK commit# gluster volume remove-brick VOLNAME BRICK commit# gluster volume remove-brick VOLNAME BRICK commit# gluster volume remove-brick VOLNAME BRICK commit
    Copy to Clipboard Toggle word wrap
    For example,
    # gluster volume remove-brick test-volume server2:/exp2 commit
    Copy to Clipboard Toggle word wrap
  4. After the brick removal, you can check the volume information using the following command:
    # gluster volume info 
    Copy to Clipboard Toggle word wrap
    The command displays information similar to the following:
    # gluster volume info
    Volume Name: test-volume
    Type: Distribute
    Status: Started
    Number of Bricks: 3
    Bricks:
    Brick1: server1:/exp1
    Brick3: server3:/exp3
    Brick4: server4:/exp4
    Copy to Clipboard Toggle word wrap

Shrinking a Geo-replicated Volume

  1. Remove a brick using the following command:
    # gluster volume remove-brick VOLNAME BRICK start# gluster volume remove-brick VOLNAME BRICK start# gluster volume remove-brick VOLNAME BRICK start# gluster volume remove-brick VOLNAME BRICK start
    Copy to Clipboard Toggle word wrap
    For example:
    # gluster volume remove-brick MASTER_VOL MASTER_HOST:/exp2 start
    Remove Brick start successful
    Copy to Clipboard Toggle word wrap

    Note

    If the remove-brick command is run with force or without any option, the data on the brick that you are removing will no longer be accessible at the glusterFS mount point. When using the start option, the data is migrated to other bricks, and on a successful commit the removed brick's information is deleted from the volume configuration. Data can still be accessed directly on the brick.
  2. Use geo-replication config checkpoint to ensure that all the data in that brick is synced to the slave.
    1. Set a checkpoint to help verify the status of the data synchronization.
      # gluster volume geo-replication MASTER_VOL SLAVE_HOST::SLAVE_VOL config checkpoint now
      Copy to Clipboard Toggle word wrap
    2. Monitor the checkpoint output using the following command, until the status displays: checkpoint as of checkpoint as of <time of checkpoint creation> is completed at <time of completion>.
      # gluster volume geo-replication MASTER_VOL SLAVE_HOST::SLAVE_VOL status
      Copy to Clipboard Toggle word wrap
  3. You can view the status of the remove brick operation using the following command:
    # gluster volume remove-brick VOLNAME BRICK status# gluster volume remove-brick VOLNAME BRICK status# gluster volume remove-brick VOLNAME BRICK status# gluster volume remove-brick VOLNAME BRICK status
    Copy to Clipboard Toggle word wrap
    For example:
    # gluster volume remove-brick  MASTER_VOL MASTER_HOST:/exp2 status
    Copy to Clipboard Toggle word wrap
  4. Stop the geo-replication session between the master and the slave:
    # gluster volume geo-replication MASTER_VOL SLAVE_HOST::SLAVE_VOL stop
    Copy to Clipboard Toggle word wrap
  5. When the data migration shown in the previous status command is complete, run the following command to commit the brick removal:
    # gluster volume remove-brick VOLNAME BRICK commit# gluster volume remove-brick VOLNAME BRICK commit# gluster volume remove-brick VOLNAME BRICK commit# gluster volume remove-brick VOLNAME BRICK commit
    Copy to Clipboard Toggle word wrap
    For example,
    # gluster volume remove-brick  MASTER_VOL MASTER_HOST:/exp2 commit
    Copy to Clipboard Toggle word wrap
  6. After the brick removal, you can check the volume information using the following command:
    # gluster volume info 
    Copy to Clipboard Toggle word wrap
  7. Start the geo-replication session between the hosts:
    # gluster volume geo-replication MASTER_VOL SLAVE_HOST::SLAVE_VOL start
    Copy to Clipboard Toggle word wrap

8.4.1. Stopping a remove-brick Operation

Important

Stopping a remove-brick operation is a technology preview feature. Technology Preview features are not fully supported under Red Hat subscription level agreements (SLAs), may not be functionally complete, and are not intended for production use. However, these features provide early access to upcoming product innovations, enabling customers to test functionality and provide feedback during the development process. As Red Hat considers making future iterations of Technology Preview features generally available, we will provide commercially reasonable efforts to resolve any reported issues that customers experience when using these features.
A remove-brick operation that is in progress can be stopped by using the stop command.

Note

Files that were already migrated during remove-brick operation will not be migrated back to the same brick when the operation is stopped.
To stop remove brick operation, use the following command:
# gluster volume remove-brick VOLNAME BRICK stop# gluster volume remove-brick VOLNAME BRICK stop# gluster volume remove-brick VOLNAME BRICK stop# gluster volume remove-brick VOLNAME BRICK stop
Copy to Clipboard Toggle word wrap
For example:
gluster volume remove-brick di rhs1:/brick1/di21 rhs1:/brick1/di21 stop

Node   Rebalanced-files   size     scanned  failures   skipped   status  run-time in secs
----      -------         ----       ----     ------    -----     -----    ------   
localhost     23          376Bytes    34        0        0      stopped      2.00
rhs1          0           0Bytes      88        0        0      stopped      2.00  
rhs2          0           0Bytes       0        0        0      not started  0.00
'remove-brick' process may be in the middle of a file migration.
The process will be fully stopped once the migration of the file is complete.
Please check remove-brick process for completion before doing any further brick related tasks on the volume.
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat