Gluster - Changing peer's hostnames

TAGS: gluster cloud-init sed

Changing of gluster peers hostnames

Simple tutorial - how to change peer’s hostnames in gluster cluster without destroing anything

Run on all gluster nodes

  1. Stop glusterd processes
    sudo systemctl stop glusterd
  2. Change hostnames
    sudo hostnamectl set-hostname $hostname
  3. Remove cloud-init hostname* modules from cloud_init_modules list if you are using cloud vm’s
    sudo vi /etc/cloud-init/cloud.cfg
  4. Change hosts file
    sudo vi /etc/hosts
  5. 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' {} \;
  6. 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
  7. Start glusterd process
    sudo systemctl start glusterd
Written on November 14, 2017

Archive

linux openstack kubernetes gluster ceph ansible docker systemctl python openshift log centos sed registry kolla kibana keepalived elasticsearch deploy cloud-init auth HA zabbix vsphere vmware venv tools swift ssl ssh scm ruby rsyslog rhel rbac rabbitmq prometheus postgres policy pgpool2 patrole pacemaker ntp nfs net mq monitoring mongo mbr lvm logstash kubespray kubeadm kolla-ansible jenkins jekyII java ironic helm heketi harbor grub github ganesha fluentd fluent-bit fio drbd diskimage-builder devstack debug deb db cisco cicd ceph-ansible calico build bitbucket benchmarking apparmor api NUMA Linux Golang Go ELK 3par