我创建了一个 2TB 卷来增加主目录空间。
我创建了分区:
$ parted /dev/xvdb mklabel gpt
$ parted -s /dev/xvdb mkpart primary ext4 1 100%
格式化分区:
$ mkfs.ext4 -I 512 /dev/xvdb1
将条目添加到/etc/fstab
/dev/xvdb /export/home/brick3 ext4 defaults 0 0
创建挂载点:
$ mkdir -p /export/home/brick3
$ chmod 0755 /export/home/brick3
挂载分区:
$ mount /export/home/brick3
$ mkdir /export/home/brick3/home
$ chmod 0775 /export/home/brick3/home
一旦我尝试将新砖添加到卷中,就会出现错误。
$ gluster volume add-brick home <hostname>:/export/home/brick3/home
volume add-brick: failed Incorrect number of bricks supplied 1 with count 2
答案1
您需要包括replica $COUNT
.当您启用副本时,这是一个已知问题:
复制模块中当前的设计限制不允许我们将单个块添加到现有拓扑中。
设想
你尝试过这样的事情:
$ gluster vol add-brick test-volume-replicated3 \
host:/rhss/bricks/brick1/test-volume-replicated3
volume add-brick: failed: Incorrect number of bricks supplied 1 with count 2
您的场景可能是为 gluster 卷配置了多个副本,因为它最初是这样构建的:
$ gluster vol create test-volume-replicated3 replica 3 \
host1:/rhss/bricks/brick1/test-volume-replicated3 \
host2:/rhss/bricks/brick1/test-volume-replicated3 \
host3:/rhss/bricks/brick1/test-volume-replicated3
volume create: test-volume-replicated3: success: please start the volume to access data
目前它的拓扑结构是这样的:
$ gluster vol info test-volume-replicated3
Volume Name: test-volume-replicated3
Type: Replicate
Volume ID: 10b3d0e2-14a2-4ec3-a98c-9a3307f3fd8f
Status: Created
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: host1:/rhss/bricks/brick1/test-volume-replicated3
Brick2: host2:/rhss/bricks/brick1/test-volume-replicated3
Brick3: host3:/rhss/bricks/brick1/test-volume-replicated3
因此,为了让你的命令运行,你必须在添加另一个砖块时告诉 gluster 你的副本数量:
$ gluster vol add-brick test-volume-replicated3 replica 3 \
host:/rhss/bricks/brick1/test-volume-replicated3 \
host:/rhss/bricks/brick2/test-volume-replicated3 \
host:/rhss/bricks/brick3/test-volume-replicated3