Single-node cluster enlargement

{       
"autoDelete": true,
"boot": false,
"deviceName": "couchbase-node1-storage",
"diskSizeGb": "200",
"index": 1,
"interface": "SCSI",
"kind": "compute#attachedDisk",
"mode": "READ_WRITE",
"source": "projects/.../couchbase-node1-storage",
"type": "PERSISTENT"
}
$ fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors
...
Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
$ fdisk /dev/sdb
...
Command (m for help): n # means new
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Partition number (1-4, default 1):First sector (2048-419430399, default 2048):Last sector, +sectors or +size{K,M,G,T,P} (2048-419430399, default 419430399):
Created a new partition 1 of type 'Linux' and of size 200 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
$ fdisk -l
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 419430399 419428352 200G 83 Linux
$ mkfs.xfs 
/dev/sdb1meta-data=/dev/sdb1
...
$ mkdir /opt/couchbase
$ mount /dev/sdb1 /opt/couchbase
$ df -h
...
/dev/sdb1 200G 1.5G 199G 1% /opt/couchbase
$ cat /proc/mounts
...
/dev/sdb1 /opt/couchbase xfs rw,seclabel,relatime,attr2,inode64,noquota 0 0
$ wget https://packages.couchbase.com/releases/6.6.0/couchbase-server-community-6.6.0-centos8.x86_64.rpm
$ yum install -y couchbase-server-community-6.6.0-centos8.x86_64.rpm
$ systemctl start couchbase-server
$ systemctl status couchbase-server
couchbase-server.service - Couchbase Server
Loaded: loaded (/usr/lib/systemd/system/couchbase-server.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2020-11-26 10:29:06 UTC; 16s ago
Disk space on Couchbase node
$ watch df -h /dev/sdb1
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 200G 2.3G 198G 2% /opt/couchbase
Tmux session to watch the changes
fdisk /dev/sdb
d # delete the partitions on the disk
n # new partition
# defaults everywhere
Partition #1 contains a xfs signature. # WHO CARES!
w # write the changes
xfs_growfs /dev/sdb1
Disk space on Couchbase node after enlargement

Multi-node cluster enlargement

Second node connected to the cluster
$ fdisk /dev/sdb
...
Partition #1 contains a xfs signature. # WHO CARES
...
$ date
Thu Nov 26 11:37:02 UTC 2020
$ date
Thu Nov 26 11:39:05 UTC 2020
$ xfs_growfs /dev/sdb1
...
Process of the rebalance

Conclusion

Gopher, Rustacean, Hobby Hacker

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store