Sabtu, 11 Juli 2020

How to remove brick from replication gluster and add the brick for distributed type

  Tidak ada komentar
Check gluster volume info
[[email protected] ~]# gluster volume info

Volume Name: hubla-dev
Type: Replicate
Volume ID: 4d3c0286-1689-469d-8d67-5af4bd440b84
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: doksvrdc-dev:/data/brick1/h0
Brick2: doksvrdrc-dev:/data/brick1/h0
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off
[[email protected] ~]#

Remove brick from volume
[[email protected] ~]# gluster volume remove-brick hubla-dev replica 1 doksvrdc-dev:/data/brick1/h0 start
volume remove-brick start: failed: Migration of data is not needed when reducing replica count. Use the 'force' option
[[email protected] ~]# gluster volume remove-brick hubla-dev replica 1 doksvrdc-dev:/data/brick1/h0 force
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
volume remove-brick commit force: success
[[email protected] ~]#

Check the gluster volume again
[[email protected] ~]# gluster volume info

Volume Name: hubla-dev
Type: Distribute
Volume ID: 4d3c0286-1689-469d-8d67-5af4bd440b84
Status: Started
Snapshot Count: 0
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: doksvrdrc-dev:/data/brick1/h0
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: on
[[email protected] ~]#

Check gluster volume info
[[email protected] ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0               2:0    1    4K  0 disk
sda               8:0    0   16G  0 disk
├─sda1            8:1    0    1G  0 part /boot
└─sda2            8:2    0   14G  0 part
  ├─centos-root 253:0    0   10G  0 lvm  /
  └─centos-swap 253:1    0    4G  0 lvm  [SWAP]
sdb               8:16   0  100G  0 disk
└─sdb1            8:17   0  100G  0 part /data/brick1
sdc               8:32   0  100G  0 disk
sr0              11:0    1    4G  0 rom
[[email protected] ~]#
[[email protected] ~]# cfdisk /dev/sdc

Disk has been changed.

WARNING: If you have created or modified any
DOS 6.x partitions, please see the cfdisk manual
page for additional information.
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0               2:0    1    4K  0 disk
sda               8:0    0   16G  0 disk
├─sda1            8:1    0    1G  0 part /boot
└─sda2            8:2    0   14G  0 part
  ├─centos-root 253:0    0   10G  0 lvm  /
  └─centos-swap 253:1    0    4G  0 lvm  [SWAP]
sdb               8:16   0  100G  0 disk
└─sdb1            8:17   0  100G  0 part /data/brick1
sdc               8:32   0  100G  0 disk
└─sdc1            8:33   0  100G  0 part
sr0              11:0    1    4G  0 rom
[[email protected] ~]#


Create the directory and filesystem
[[email protected] ~]# mkdir -p /data/brick2
[[email protected] ~]#
[[email protected] ~]# mkfs.xfs /dev/sdc
sdc   sdc1
[[email protected] ~]# mkfs.xfs /dev/sdc1
meta-data=/dev/sdc1              isize=256    agcount=4, agsize=6553598 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=26214392, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=12799, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[[email protected] ~]# mount /dev/sdc1 /data/brick2
[[email protected] ~]#
[[email protected] ~]# df -h
df: ‘/gclient’: Transport endpoint is not connected
Filesystem                Size  Used Avail Use% Mounted on
/dev/mapper/centos-root    10G  884M  9.2G   9% /
devtmpfs                  3.9G     0  3.9G   0% /dev
tmpfs                     3.9G     0  3.9G   0% /dev/shm
tmpfs                     3.9G  8.6M  3.9G   1% /run
tmpfs                     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sdb1                 100G   33M  100G   1% /data/brick1
/dev/sda1                1014M  129M  886M  13% /boot
tmpfs                     783M     0  783M   0% /run/user/0
doksvrdrc-dev:/hubla-dev  100G   33M  100G   1% /data/test
/dev/sdc1                 100G   33M  100G   1% /data/brick2
[[email protected] ~]#

Check gluster volume info
[[email protected] ~]# gluster volume add-brick hubla-dev doksvrdrc-dev:/data/brick2/h0
volume add-brick: success
[[email protected] ~]#
[[email protected] ~]# gluster volume info

Volume Name: hubla-dev
Type: Distribute
Volume ID: 4d3c0286-1689-469d-8d67-5af4bd440b84
Status: Started
Snapshot Count: 0
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: doksvrdrc-dev:/data/brick1/h0
Brick2: doksvrdrc-dev:/data/brick2/h0
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: on
[[email protected] ~]#


Reballance the volume
[[email protected] h0]# gluster volume rebalance hubla-dev start
volume rebalance: hubla-dev: success: Rebalance on hubla-dev has been started successfully. Use rebalance status command to check status of the rebalance process.
ID: b406fbef-4022-445d-be6f-6158bcb96159
[[email protected] h0]# ls
test100.txt  test15.txt  test25.txt  test39.txt  test45.txt  test51.txt  test59.txt  test66.txt  test77.txt  test87.txt  test98.txt
test11.txt   test19.txt  test28.txt  test40.txt  test47.txt  test54.txt  test5.txt   test67.txt  test78.txt  test8.txt   test9.txt
test12.txt   test20.txt  test2.txt   test41.txt  test48.txt  test55.txt  test60.txt  test68.txt  test82.txt  test92.txt  testting1.txt
test13.txt   test21.txt  test33.txt  test42.txt  test49.txt  test56.txt  test62.txt  test6.txt   test84.txt  test93.txt
test14.txt   test23.txt  test36.txt  test44.txt  test50.txt  test57.txt  test65.txt  test76.txt  test86.txt  test95.txt
[[email protected] h0]# pwd
/data/brick2/h0
[[email protected] h0]# ls ../../brick1/h0/
test10.txt  test1.txt   test27.txt  test32.txt  test38.txt  test4.txt   test61.txt  test70.txt  test74.txt  test80.txt  test88.txt  test94.txt  testting2.txt
test16.txt  test22.txt  test29.txt  test34.txt  test3.txt   test52.txt  test63.txt  test71.txt  test75.txt  test81.txt  test89.txt  test96.txt
test17.txt  test24.txt  test30.txt  test35.txt  test43.txt  test53.txt  test64.txt  test72.txt  test79.txt  test83.txt  test90.txt  test97.txt
test18.txt  test26.txt  test31.txt  test37.txt  test46.txt  test58.txt  test69.txt  test73.txt  test7.txt   test85.txt  test91.txt  test99.txt
[[email protected] h0]#


Tidak ada komentar :

Posting Komentar