Skip to content

Instantly share code, notes, and snippets.

@epcim
Forked from LotharKAtt/Galera.md
Created July 18, 2018 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epcim/e47a163e14cd2abdb66ebb5c89c3ac82 to your computer and use it in GitHub Desktop.
Save epcim/e47a163e14cd2abdb66ebb5c89c3ac82 to your computer and use it in GitHub Desktop.
Restoring, Migration, Detach

Galera

Restore MYSQL cluster

  1. Kill all mysql process on whole cluster (check via ps aux| grep mysql)
  2. Remove grastate.data and ib_logfiles
    • rm /var/lib/mysql/grastate.data
    • rm /var/lib/mysql/ib_logfile*
  3. Edit this row in /etc/mysql/my.cnf on `"wsrep_cluster_address="gcomm://""``
  4. Start MySql on this node
    • validate status of MySql cluster salt-call mysql.status | grep -A1 wsrep_cluster_size
  5. Start MySql on another one node
  6. Wait when second rejoin cluster, when is cluster = 2 start MySql process on last node
  7. salt-call mysql.status | grep -A1 wsrep_cluster_size cluster size should be equal to 3
    • re-run galera state on first

Offline migration between two compute nodes

  1. Stop the instance
  2. Rsync qcow image to right destination rsync -Pa /var/lib/nova/instances/instance-000004f2 destination_hostname:/var/lib/nova/instances/
  3. Update record in MySql database UPDATE instances SET node='os-kvm-prod-dmz-self014.mgm.avg.com',host='os-kvm-prod-dmz-self014' WHERE uuid ='9f2d63b5-122c-47b1-812a-1bec3d40fbb9';

More Details

Detach Volume

  1. Log in to database
  2. use cinder table
  3. Update correct record
    • UPDATE cinder.volumesSETstatus='available', attach_status='detached' WHERE id`='2d66d83b-a644-480a-a457-56075838612b';``

cinder service-disable cpt06@EasyTier cinder-volume a delete from db: mysql -uroot -pcloudlab -e "update services set deleted = 1 where host like 'cpt06@EasyTier' and disabled = 1 " cinder

MySql Commands

show processlist - It shows on witch node is active connections show status - In this table is lot of interesting informations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment