{"id":2595,"date":"2016-08-30T12:14:08","date_gmt":"2016-08-30T16:14:08","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2595"},"modified":"2017-04-19T15:58:28","modified_gmt":"2017-04-19T19:58:28","slug":"setup-galera-arbitrator-ubuntu-16","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/","title":{"rendered":"How to setup a Galera Arbitrator on Ubuntu 16"},"content":{"rendered":"<p>For best results, your Galera cluster should have three nodes, preferably in three distinct data centers. But sometimes this isn&#8217;t practical or possible. Maybe you simply can&#8217;t afford the server capacity to acquire an odd number of nodes, but still want to enjoy the benefits gained from clustering across two or four separate Galera servers.<\/p>\n<p>But due to how Galera&#8217;s clustering algorithm operates, it is strongly recommended that you have an odd number of nodes. Even numbers may result in split-brain situations, where cluster members cannot vote effectively due to ties. You may also want a consistent application state for backups, which an arbitrator can help with. This guide sets up an Ubuntu 14.04 LTS server as a Galera arbitrator. It will not replicate data, but will resolve ties and help enforce application consistency.<\/p>\n<h2>Getting Started<\/h2>\n<p>You&#8217;ll need the following in place before getting started with this guide:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) running Ubuntu 16.<br \/>\n\u2022 Root access<\/p>\n<h2>Tutorial<\/h2>\n<p>This example will add a Galera arbitrator to an existing two-node cluster, thus making the total node count an odd number and immune to deadlocks.<\/p>\n<p>Start by installing the software-properties package. This provides you with the add-apt-repository command, a convenient helper for quickly integrading Ubuntu PPAs into your system.<\/p>\n<p><code>apt-get install software-properties-common -y<\/code><\/p>\n<p>Next we&#8217;ll install the packages necessary to run the Galera arbitrator.<\/p>\n<p><code>apt-get install galera-3 galera-arbitrator-3 -y<\/code><\/p>\n<p>With that complete, we&#8217;ll now configure the arbitrator node to connect to your existing cluster. Begin by editing the configuration file.<\/p>\n<p><code>nano \/etc\/default\/garb<\/code><\/p>\n<p>Uncomment the following line:<\/p>\n<p><code class=\"gris\"># Copyright (C) 2012 Codership Oy<br \/>\n# This config file is to be sourced by garb service script.<br \/>\n# A comma-separated list of node addresses (address[:port]) in the cluster<br \/>\nGALERA_NODES=\"10.0.0.119:4567\"<br \/>\n# Galera cluster name, should be the same as on the rest of the nodes.<br \/>\nGALERA_GROUP=\"test_cluster\"<br \/>\n# Optional Galera internal options string (e.g. SSL settings)<br \/>\n# see http:\/\/galeracluster.com\/documentation-webpages\/galeraparameters.html<br \/>\n# GALERA_OPTIONS=\"\"<br \/>\n# Log file for garbd. Optional, by default logs to syslog<br \/>\n# LOG_FILE=\"\"<\/code><\/p>\n<p>Next, start the arbitrator you&#8217;ve just configured.<\/p>\n<p><code>service garb start<\/code><\/p>\n<p>The arbitrator should have joined your existing Galera cluster. To confirm this, log into any of the two other nodes in your current cluster and execute the following command:<\/p>\n<p><code>mysql -u root -p -e \"show status like 'wsrep_cluster_size'\"<\/code><\/p>\n<p>Assuming the arbitrator is correctly configured and has joined, you&#8217;ll have output indicating that there are two cluster nodes and one arbitrator. It should look as follows:<\/p>\n<p><code class=\"gris\">+--------------------+-------+<br \/>\n| Variable_name      | Value |<br \/>\n+--------------------+-------+<br \/>\n| wsrep_cluster_size | 3    |<br \/>\n+--------------------+-------+<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Your Galera cluster is now immune to deadlocks, and other conditions that arise with an odd number of members. Share this article with anyone wishing to set up a highly available Galera cluster, but for whom a full three-node setup might be impractical.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>For best results, your Galera cluster should have three nodes, preferably in three distinct data centers. But sometimes this isn&#8217;t practical or possible. Maybe you simply can&#8217;t afford the server capacity to acquire an odd number of nodes, but still want to enjoy the benefits gained from clustering across two or four separate Galera servers.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75],"tags":[],"class_list":["post-2595","post","type-post","status-publish","format-standard","hentry","category-ha-clustering","operating_system-ubuntu-14-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to setup a Galera Arbitrator on Ubuntu 16 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This Tutorial will show you how to setup a Galera Arbitrator on your Ubuntu 16 Server. It will resolve ties and help enforce application consistency.\" \/>\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.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to setup a Galera Arbitrator on Ubuntu 16 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This Tutorial will show you how to setup a Galera Arbitrator on your Ubuntu 16 Server. It will resolve ties and help enforce application consistency.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-30T16:14:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-19T19:58:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/\"},\"author\":{\"name\":\"GloboTech Communications\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"headline\":\"How to setup a Galera Arbitrator on Ubuntu 16\",\"datePublished\":\"2016-08-30T16:14:08+00:00\",\"dateModified\":\"2017-04-19T19:58:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/\"},\"wordCount\":366,\"commentCount\":0,\"articleSection\":[\"HA &amp; Clustering\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/\",\"name\":\"How to setup a Galera Arbitrator on Ubuntu 16 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\"},\"datePublished\":\"2016-08-30T16:14:08+00:00\",\"dateModified\":\"2017-04-19T19:58:28+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This Tutorial will show you how to setup a Galera Arbitrator on your Ubuntu 16 Server. It will resolve ties and help enforce application consistency.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-galera-arbitrator-ubuntu-16\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to setup a Galera Arbitrator on Ubuntu 16\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\\\/\\\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to setup a Galera Arbitrator on Ubuntu 16 - Globo.Tech","description":"This Tutorial will show you how to setup a Galera Arbitrator on your Ubuntu 16 Server. It will resolve ties and help enforce application consistency.","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.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/","og_locale":"en_US","og_type":"article","og_title":"How to setup a Galera Arbitrator on Ubuntu 16 - Globo.Tech","og_description":"This Tutorial will show you how to setup a Galera Arbitrator on your Ubuntu 16 Server. It will resolve ties and help enforce application consistency.","og_url":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/","og_site_name":"Globo.Tech","article_published_time":"2016-08-30T16:14:08+00:00","article_modified_time":"2017-04-19T19:58:28+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/#article","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/"},"author":{"name":"GloboTech Communications","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"headline":"How to setup a Galera Arbitrator on Ubuntu 16","datePublished":"2016-08-30T16:14:08+00:00","dateModified":"2017-04-19T19:58:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/"},"wordCount":366,"commentCount":0,"articleSection":["HA &amp; Clustering"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/","url":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/","name":"How to setup a Galera Arbitrator on Ubuntu 16 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-08-30T16:14:08+00:00","dateModified":"2017-04-19T19:58:28+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This Tutorial will show you how to setup a Galera Arbitrator on your Ubuntu 16 Server. It will resolve ties and help enforce application consistency.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/setup-galera-arbitrator-ubuntu-16\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to setup a Galera Arbitrator on Ubuntu 16"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2595"}],"version-history":[{"count":4,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2595\/revisions"}],"predecessor-version":[{"id":3078,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2595\/revisions\/3078"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}