Gluster - Changing peer's hostnames
TAGS:Changing of gluster peers hostnames
Simple tutorial - how to change peer’s hostnames in gluster cluster without destroing anything
Run on all gluster nodes
- Stop glusterd processes
sudo systemctl stop glusterd
- Change hostnames
sudo hostnamectl set-hostname $hostname
- Remove cloud-init hostname* modules from cloud_init_modules list if you are using cloud vm’s
sudo vi /etc/cloud-init/cloud.cfg
- Change hosts file
sudo vi /etc/hosts
- Recursively change all old hostnames with new one’s in /var/lib/glusterd directory
sudo find ./ -type f -exec sed -i 's/$OLD/$NEW/g' {} \;
- Move brick folders to new destination based on new hostnames
##EXAMPLE sudo cd /var/lib/glusted/vols/gluster_shared_storage/ sudo mv test-nfs-rk-2\:-var-lib-glusterd-ss_brick gluster-nfs-1\:-var-lib-glusterd-ss_brick
- Start glusterd process
sudo systemctl start glusterd
Written on November 14, 2017