2

I created a 2TB volume to increase space on home directory.

I created the partition:

$ parted /dev/xvdb mklabel gpt
$ parted -s /dev/xvdb mkpart primary ext4 1 100%

Formatted the partition:

$ mkfs.ext4 -I 512 /dev/xvdb1

Added the entry to /etc/fstab

/dev/xvdb /export/home/brick3 ext4 defaults 0 0

Created the mountpoint:

$ mkdir -p /export/home/brick3
$ chmod 0755 /export/home/brick3

Mounted the partition:

$ mount /export/home/brick3
$ mkdir /export/home/brick3/home
$ chmod 0775 /export/home/brick3/home

once I tried to add the new brick to volume thats where I get an error.

$ gluster volume add-brick home <hostname>:/export/home/brick3/home
volume add-brick: failed Incorrect number of bricks supplied 1 with count 2
slm
  • 363,520
  • 117
  • 767
  • 871
Mervyn Clarke
  • 43
  • 1
  • 5

1 Answers1

0

You need to include the replica $COUNT. This is a known issue when you have replicas enabled:

Current design constraints in replicate module doesn't allow for us to add individual bricks into an existing topology.

Scenario

You tried something like this:

$ 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

Your scenario is likely one where you have a number of replicas configured for your gluster volume because it was built like this originally:

$ 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

And currently its topology is now like this:

$ 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

So to get your command to run you have to tell gluster your replica count when adding another brick:

$ 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

References

slm
  • 363,520
  • 117
  • 767
  • 871