{"id":990,"date":"2016-04-21T02:39:03","date_gmt":"2016-04-21T07:39:03","guid":{"rendered":"https:\/\/www.softwareab.net\/wordpress\/?p=990"},"modified":"2016-04-21T02:40:57","modified_gmt":"2016-04-21T07:40:57","slug":"openstack-recover-galera-cluster","status":"publish","type":"post","link":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/","title":{"rendered":"OpenStack: Recover Galera Cluster"},"content":{"rendered":"<h3>OpenStack MySQL (MariaDB Galera Cluster) Recovery<\/h3>\n<p>Problem: Your MySQL Secondary Database will not start because of disk space, InnoDB problems, etc.<\/p>\n<p>This hit me when the Keystone token cleanup got fouled up and I ended up with 900K expired token records. At that point the database was hosed and would not recover because transaction logs were greater than 1GB (default max replication size).<\/p>\n<p>Helpful links on MySQL recovery:<\/p>\n<ul>\n<li><a href=\"http:\/\/blackbird.si\/mysql-corrupted-innodb-tables-recovery-step-by-step-guide\/\">http:\/\/blackbird.si\/mysql-corrupted-innodb-tables-recovery-step-by-step-guide\/<\/a><\/li>\n<li><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/forcing-innodb-recovery.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/forcing-innodb-recovery.html<\/a><\/li>\n<li><a href=\"https:\/\/www.percona.com\/blog\/2015\/10\/26\/how-big-can-your-galera-transactions-be\/\">https:\/\/www.percona.com\/blog\/2015\/10\/26\/how-big-can-your-galera-transactions-be\/<\/a> &#8211; the notes on <code>binlog_row_image=minimal<\/code> do not apply as we are running MariaDB 5.5&#8243;><\/li>\n<li><a href=\"https:\/\/www.percona.com\/forums\/questions-discussions\/percona-xtradb-cluster\/33907-got-error-5-during-commit-wsrep_max_ws_size-limit\">https:\/\/www.percona.com\/forums\/questions-discussions\/percona-xtradb-cluster\/33907-got-error-5-during-commit-wsrep_max_ws_size-limit<\/a><\/li>\n<li><a href=\"http:\/\/severalnines.com\/blog\/9-tips-going-production-galera-cluster-mysql\">http:\/\/severalnines.com\/blog\/9-tips-going-production-galera-cluster-mysql<\/a> &#8211; Great guide on going Production with Galera cluster&#8221;><\/li>\n<\/ul>\n<p>Solved this by doing the following:<\/p>\n<ul>\n<li>Stop the database on both primary (120) and secondary (220) lvosmysql database instances.<\/li>\n<li>On the primary, start the database manually:\n<pre>\r\nsudo su - mysql\r\n\/usr\/bin\/mysqld_safe --basedir=\/usr\r\n<\/pre>\n<p><strong>Wait<\/strong> for the database to come up cleanly (review <code>\/var\/log\/mariadb\/mariadb.log<\/code> and do a test connection to verify).<\/li>\n<li>On the secondary, because InnoDB was corrupted I had to add the following to <code>\/etc\/my.cnf<\/code>:\n<pre>\r\n# settings to recover in emergency\r\ninnodb_force_recovery=5\r\ninnodb_purge_threads=0\r\nport=8881\r\n<\/pre>\n<p>NB: The <code>port<\/code> changes to keep the database from being hammered during recovery.<br \/>\nThen run the database manually as with the master:<\/p>\n<pre>\r\nsudo su - mysql\r\n\/usr\/bin\/mysqld_safe --basedir=\/usr\r\n<\/pre>\n<p>This process works because the secondary will first detect that it needs the entire <code>\/var\/lib\/mysql\/ibdata1<\/code> file; this is a Good Thing because it (in effect) forces the secondary to rebuild itself from the master. You can verify this by checking for <code>rsync<\/code> in the process list (I used <code>lsof<\/code> for this:<\/p>\n<pre>\r\n[root@lvosmysql220 mariadb]# lsof | grep rsync\r\nwsrep_sst 6711           mysql  255r      REG              253,0        8771      45942 \/usr\/bin\/wsrep_sst_rsync\r\nrsync     6738           mysql  cwd       DIR              253,0        4096     814419 \/var\/lib\/mysql\r\n[...]\r\nrsync     6754           mysql   11r      REG              253,0 18733858816    1258906 \/var\/lib\/mysql\/ibdata1\r\n[...]\r\n<\/pre>\n<p>Once the <code>ibdata1<\/code> file is transferred, the database promptly halts because using <code>innodb_force_recovery=5<\/code> places the database in read-only recovery mode. Which &#8211; since the entire database has been rescanned from the master &#8211; is no longer necessary. So comment out the emergency settings in <code>\/etc\/my.cnf<\/code> and manually restart the database on the secondary.<\/li>\n<li>At this point, both primary and secondary database hosts should be synchronized and replication should report OK. The next step is to get the databases synchronized and committed with each other; in my case this meant a painful session of deleting 1000 Keystone token records at a time (to prevent the transaction log \/ replication processes from being overloaded). That took several hours.<br \/>\nIn your case, you will need to troubleshoot why your secondary database host failed to start and correct as needed.<\/li>\n<li>Once the databases are finally at a good point (in my case, when all 900K worth of expired Keystone token records were deleted and committed to primary \/ secondary), you can stop the database on each server (remember: they are running from a manual prompt):\n<pre>\r\nmysqladmin -u[user] -p[password] -h[host] shutdown\r\n<\/pre>\n<p>You run the above as <code>root<\/code> and you *wait for a clean shutdown* on each node. I recommend a full reboot of each server and careful verification that MySQL (MariaDB) starts up correctly after the reboot completes.<\/li>\n<\/ul>\n<p>That is all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenStack MySQL (MariaDB Galera Cluster) Recovery Problem: Your MySQL Secondary Database will not start because of disk space, InnoDB problems, etc. This hit me when the Keystone token cleanup got fouled up and I ended up with 900K expired token &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\"> <span class=\"screen-reader-text\">OpenStack: Recover Galera Cluster<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,81,1],"tags":[88,86,18],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OpenStack: Recover Galera Cluster - softwareab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpenStack: Recover Galera Cluster - softwareab\" \/>\n<meta property=\"og:description\" content=\"OpenStack MySQL (MariaDB Galera Cluster) Recovery Problem: Your MySQL Secondary Database will not start because of disk space, InnoDB problems, etc. This hit me when the Keystone token cleanup got fouled up and I ended up with 900K expired token &hellip; OpenStack: Recover Galera Cluster Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\" \/>\n<meta property=\"og:site_name\" content=\"softwareab\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cloudraticsolutions\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/cloudraticsolutions\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-21T07:39:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-04-21T07:40:57+00:00\" \/>\n<meta name=\"author\" content=\"Andrew Bruce\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@realcloudratics\" \/>\n<meta name=\"twitter:site\" content=\"@realcloudratics\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Bruce\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\"},\"author\":{\"name\":\"Andrew Bruce\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"headline\":\"OpenStack: Recover Galera Cluster\",\"datePublished\":\"2016-04-21T07:39:03+00:00\",\"dateModified\":\"2016-04-21T07:40:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\"},\"wordCount\":466,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"keywords\":[\"mysql\",\"OpenStack\",\"sysadmin\"],\"articleSection\":[\"OpenStack\",\"SysAdmin\",\"Teknocratica\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\",\"name\":\"OpenStack: Recover Galera Cluster - softwareab\",\"isPartOf\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#website\"},\"datePublished\":\"2016-04-21T07:39:03+00:00\",\"dateModified\":\"2016-04-21T07:40:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.softwareab.net\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mysql\",\"item\":\"https:\/\/www.softwareab.net\/wordpress\/tag\/mysql\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"OpenStack: Recover Galera Cluster\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#website\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/\",\"name\":\"softwareab\",\"description\":\"Technocratica, Technopolitik, Technophobia\",\"publisher\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.softwareab.net\/wordpress\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\",\"name\":\"Andrew Bruce\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg\",\"contentUrl\":\"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg\",\"width\":400,\"height\":330,\"caption\":\"Andrew Bruce\"},\"logo\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/\"},\"description\":\"Team-oriented systems mentor with deep knowledge of numerous software methodologies, technologies, languages, and operating systems. Excited about turning emerging technology into working production-ready systems. Focused on moving software teams to a higher level of world-class application development. Specialties:Software analysis and development...Product management through the entire lifecycle...Discrete product integration specialist!\",\"sameAs\":[\"http:\/\/cloudraticsolutions.net\/\",\"https:\/\/www.facebook.com\/cloudraticsolutions\/\",\"https:\/\/twitter.com\/realcloudratics\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OpenStack: Recover Galera Cluster - softwareab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/","og_locale":"en_US","og_type":"article","og_title":"OpenStack: Recover Galera Cluster - softwareab","og_description":"OpenStack MySQL (MariaDB Galera Cluster) Recovery Problem: Your MySQL Secondary Database will not start because of disk space, InnoDB problems, etc. This hit me when the Keystone token cleanup got fouled up and I ended up with 900K expired token &hellip; OpenStack: Recover Galera Cluster Read More &raquo;","og_url":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/","og_site_name":"softwareab","article_publisher":"https:\/\/www.facebook.com\/cloudraticsolutions\/","article_author":"https:\/\/www.facebook.com\/cloudraticsolutions\/","article_published_time":"2016-04-21T07:39:03+00:00","article_modified_time":"2016-04-21T07:40:57+00:00","author":"Andrew Bruce","twitter_card":"summary_large_image","twitter_creator":"@realcloudratics","twitter_site":"@realcloudratics","twitter_misc":{"Written by":"Andrew Bruce","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#article","isPartOf":{"@id":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/"},"author":{"name":"Andrew Bruce","@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"headline":"OpenStack: Recover Galera Cluster","datePublished":"2016-04-21T07:39:03+00:00","dateModified":"2016-04-21T07:40:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/"},"wordCount":466,"commentCount":0,"publisher":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"keywords":["mysql","OpenStack","sysadmin"],"articleSection":["OpenStack","SysAdmin","Teknocratica"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/","url":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/","name":"OpenStack: Recover Galera Cluster - softwareab","isPartOf":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#website"},"datePublished":"2016-04-21T07:39:03+00:00","dateModified":"2016-04-21T07:40:57+00:00","breadcrumb":{"@id":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.softwareab.net\/wordpress\/openstack-recover-galera-cluster\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.softwareab.net\/wordpress\/"},{"@type":"ListItem","position":2,"name":"mysql","item":"https:\/\/www.softwareab.net\/wordpress\/tag\/mysql\/"},{"@type":"ListItem","position":3,"name":"OpenStack: Recover Galera Cluster"}]},{"@type":"WebSite","@id":"https:\/\/www.softwareab.net\/wordpress\/#website","url":"https:\/\/www.softwareab.net\/wordpress\/","name":"softwareab","description":"Technocratica, Technopolitik, Technophobia","publisher":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.softwareab.net\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600","name":"Andrew Bruce","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg","contentUrl":"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg","width":400,"height":330,"caption":"Andrew Bruce"},"logo":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/"},"description":"Team-oriented systems mentor with deep knowledge of numerous software methodologies, technologies, languages, and operating systems. Excited about turning emerging technology into working production-ready systems. Focused on moving software teams to a higher level of world-class application development. Specialties:Software analysis and development...Product management through the entire lifecycle...Discrete product integration specialist!","sameAs":["http:\/\/cloudraticsolutions.net\/","https:\/\/www.facebook.com\/cloudraticsolutions\/","https:\/\/twitter.com\/realcloudratics"]}]}},"_links":{"self":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/990"}],"collection":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/comments?post=990"}],"version-history":[{"count":3,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/990\/revisions"}],"predecessor-version":[{"id":993,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/990\/revisions\/993"}],"wp:attachment":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/media?parent=990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/categories?post=990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/tags?post=990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}