{"id":189,"date":"2013-04-22T17:21:03","date_gmt":"2013-04-22T21:21:03","guid":{"rendered":"http:\/\/www.scalemysql.com\/blog\/?p=189"},"modified":"2013-04-22T17:27:56","modified_gmt":"2013-04-22T21:27:56","slug":"galera-troubleshooting","status":"publish","type":"post","link":"https:\/\/www.scalemysql.com\/?p=189","title":{"rendered":"Galera set up troubleshooting"},"content":{"rendered":"<p>In a previous post on galera, I mentioned it&#8217;s important to look at both the joiner and donor logs to get a full picture of what problems you may be running into. Sometimes even that is not enough and you&#8217;ll need to spend time narrowing down the issue. It&#8217;s important to keep in mind that Galera is relatively young and so the documentation, error messages and online help is not comparable to mysql.<\/p>\n<p>We had a situation where we were building a staging environment, duplicating our production run of Galera, yet we were running into problems not previously encountered. Two nodes, (one an arbitrator) were online and we were attempting to join a third node and have xtrabackup transfer over the data. The node would initiate xtrabackup, appear to be in operation as both nodes participated in the operation, but then quit after a few moments. Typically you might run into permissions issues, file locations, etc.. with either xtrabackup and the logs, either \/varlog\/mysqld.log on the donor, or the accompanying \/var\/lib\/mysql\/innobackup.backup.log will let you know what the problem is. In this case however, we were getting no obvious error,<\/p>\n<p>the joiner log simply quit with,<\/p>\n<pre>\r\n<p style=\"padding-left: 30px;\">SST failed: 32 (Broken pipe)<\/p><\/pre>\n<p>and the donor had a little more information,<\/p>\n<pre><p style=\"padding-left: 30px;\">WSREP_SST: [ERROR] innobackupex finished with error: 2.\u00a0 Check \/var\/lib\/mysql\/\/innobackup.backup.log (20130422 11:23:08.361)<\/p>\r\n<p style=\"padding-left: 30px;\">[ERROR] WSREP: Failed to read from: Process completed with error: wsrep_sst_xtrabackup --role 'donor' --address 'xx.xx.xxx.xxx:4444\/xtrabackup_sst' --auth 'xxxxx:xxxxxxxx' --socket '\/var\/lib\/mysql\/mysql.sock' --datadir '\/var\/lib\/mysql\/' --defaults-file '\/etc\/my.cnf' --gtid 'a77b0b24-ab77-11e2-0800-f92413e82717:0'<\/p>\r\n<p style=\"padding-left: 30px;\">Process completed with error: wsrep_sst_xtrabackup --role 'donor' --address 'xx.xx.xxx.xxx:4444\/xtrabackup_sst' --auth 'xxxxx:xxxxxxxx' --socket '\/var\/lib\/mysql\/mysql.sock' --datadir '\/var\/lib\/mysql\/' --defaults-file '\/etc\/my.cnf' --gtid 'a77b0b24-ab77-11e2-0800-f92413e82717:0': 22 (Invalid argument)<\/pre>\n<p>which in retrospect did subtly point out the issue, but the pointer to innobackup.backup.log distracted from the real issue. Looking at that log, again a broken pipe error 32 was noted,<br \/>\nwhich doesn&#8217;t really tell you anything.<\/p>\n<p>And so commencing with the testing of port\/db\/file permissions, switching which was a donor vs. joiner to see if the issue was two ways, comparisons to our production environment, etc.. mysql seemed to be fine, xtrabackup seemed to work correctly, etc..<\/p>\n<p>The test that made is obvious was switching the SST type, to mysqldump, which then proceeded to behave the same way, but with some much more obvious error messages,<\/p>\n<pre><p style=\"padding-left: 30px;\">ERROR 2003 (HY000): Can't connect to MySQL server on 'xx.xx.xxx.xxx' (4)\r\n130422 11:24:11 [ERROR] WSREP: Process completed with error: wsrep_sst_mysqldump --user 'root' --password 'xxxxxxxx' --host 'xx.xx.xxx.xxx' --port '3306' --local-port '3306' --socket '\/var\/lib\/mysql\/mysql.sock' --gtid 'a77b0b24-ab77-11e2-0800-f92413e82717:0': 1 (Operation not permitted)\r\n130422 11:24:11 [ERROR] WSREP: Try 1\/3: 'wsrep_sst_mysqldump --user 'root' --password 'xxxxxxx' --host 'xx.xx.xxx.xxx' --port '3306' --local-port '3306' --socket '\/var\/lib\/mysql\/mysql.sock' --gtid 'a77b0b24-ab77-11e2-0800-f92413e82717:0'' failed: 1 (Operation not permitted)\r\nhostname: Unknown host\r\nhostname: Unknown host<\/pre>\n<\/p>\n<p>the &#8216;invalid argument&#8217; in the first set of errors was referencing an unrecognized host. The staging servers were using internal ips, which work fine as far as Galera was concerned, except SST (xtrabackup\/mysqldump) does not use the Galera node ips specified in &#8216;wsrep_cluster_address&#8217;\u00a0 directly, a lookup is done and SST subsquently used the public ips, which were not open.<\/p>\n<p>the solution is simple, you can use the variable,<\/p>\n<pre>wsrep_sst_receive_address=xx.xx.xxx.xxx<\/pre>\n<p>in your my.cnf to explicitly specify what SST should use as the ip.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous post on galera, I mentioned it&#8217;s important to look at both the joiner and donor logs to get a full picture of what problems you may be running into. Sometimes even that is not enough and you&#8217;ll need to spend time narrowing down the issue. It&#8217;s important to keep in mind that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=189"}],"version-history":[{"count":7,"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":196,"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions\/196"}],"wp:attachment":[{"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalemysql.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}