{"id":5377,"date":"2015-10-21T10:27:44","date_gmt":"2015-10-21T02:27:44","guid":{"rendered":"http:\/\/rmohan.com\/?p=5377"},"modified":"2015-10-21T10:27:44","modified_gmt":"2015-10-21T02:27:44","slug":"yum-to-configure-multiple-master-cluster-mariadb-galera","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5377","title":{"rendered":"Yum to configure multiple master cluster MariaDB Galera"},"content":{"rendered":"<div>\nYum to configure multiple master cluster MariaDB Galera<\/div>\n<div><\/div>\n<div>Hereinafter, if the command is not preceded by PS1 is to represent the three nodes are required to perform the same action, if it means the implementation of the action on the specified node<\/p>\n<p>cluster1.rmohan.com\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Centos6.7\u00a0\u00a0 192.168.1.60\u00a0\u00a0\u00a0 MariaDB<br \/>\ncluster2.rmohan.com\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Centos6.7\u00a0\u00a0 192.168.1.62\u00a0\u00a0\u00a0 MariaDB<br \/>\ncluster3.rmohan.com\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Centos6.7\u00a0\u00a0 192.168.1.63\u00a0\u00a0\u00a0 MariaDB<\/p><\/div>\n<div><\/div>\n<div>Hereinafter, if the command is not preceded by PS1 is to represent the three nodes are required to perform the same action, if it means the implementation of the action on the specified node<\/div>\n<div><\/div>\n<div>1, install ntpdate to set timing on node cluster1 cluster2 cluster3 each other synchronization and ssh<\/div>\n<div><\/div>\n<div>yum install -y ntpdate\u00a0 openssh-askpass openssh-client* wget<\/div>\n<div><\/div>\n<div>\necho &#8220;*\/5 * * * * \/usr\/sbin\/ntpdate pool.ntp.org &gt;\/dev\/null 2&gt;&amp;1&#8221; &gt;&gt; \/var\/spool\/cron\/root<\/div>\n<div><\/div>\n<div>\/usr\/sbin\/ntpdate pool.ntp.org<\/div>\n<div><\/div>\n<div>cat &gt;&gt; \/etc\/hosts &lt;&lt; EOF<br \/>\n192.168.1.60\u00a0 cluster1.rmohan.com\u00a0 cluster1<br \/>\n192.168.1.62\u00a0 cluster2.rmohan.com\u00a0 cluster2<br \/>\n192.168.1.63\u00a0 cluster3.rmohan.com\u00a0 cluster3<br \/>\nEOF<\/div>\n<div><\/div>\n<div>Here is the production of a key ###<\/div>\n<div><\/div>\n<div>ssh-keygen\u00a0 -t rsa -f ~\/.ssh\/id_rsa\u00a0 -P &#8221;<br \/>\n### The following are performed on each node, so that the public key of the machine onto the other nodes<br \/>\nawk &#8216;{if ($0!~\/'&#8221;$(hostname)&#8221;&#8216;|localhost\/)print $NF}&#8217; \/etc\/hosts |xargs -i ssh-copy-id -i ~\/.ssh\/id_rsa.pub root@{}<\/div>\n<div><\/div>\n<div>\n2, installed base build environment<\/div>\n<div><\/div>\n<div>Add EPEL Repository which is provided from Fedora project.<br \/>\nyum -y install epel-release<br \/>\n# set [priority=5]<\/div>\n<div><\/div>\n<div>sed -i -e \u201cs\/\\]$\/\\]\\npriority=5\/g\u201d \/etc\/yum.repos.d\/epel.repo<br \/>\n# for another way, change to [enabled=0] and use it only when needed<br \/>\nsed -i -e \u201cs\/enabled=1\/enabled=0\/g\u201d \/etc\/yum.repos.d\/epel.repo<br \/>\n# if [enabled=0], input a command to use the repository<br \/>\nyum \u2013enablerepo=epel install [Package]<\/div>\n<div><\/div>\n<div>Add RPMforge Repository which provides many useful packages.<\/div>\n<div><\/div>\n<div>yum -y install http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm<br \/>\n# set [priority=10]<br \/>\nsed -i -e \u201cs\/\\]$\/\\]\\npriority=10\/g\u201d \/etc\/yum.repos.d\/rpmforge.repo<br \/>\n# for another way, change to [enabled=0] and use it only when needed<br \/>\nsed -i -e \u201cs\/enabled = 1\/enabled = 0\/g\u201d \/etc\/yum.repos.d\/rpmforge.repo<br \/>\n# if [enabled=0], input a command to use the repository<br \/>\nyum \u2013enablerepo=rpmforge install [Package]<\/div>\n<div><\/div>\n<div>rpm -ivh http:\/\/mirrors.aliyun.com\/epel\/epel-release-latest-6.noarch.rpm<br \/>\nrpm \u2013import http:\/\/mirrors.dwhd.org\/epel\/RPM-GPG-KEY-EPEL-6<br \/>\nrpm -ivh http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm<br \/>\nrpm \u2013import http:\/\/mirrors.dwhd.org\/repoforge\/RPM-GPG-KEY.dag.txt<\/div>\n<div><\/div>\n<div>yum clean all &amp;&amp; yum makecache<br \/>\nyum groupinstall \u201cDevelopment tools\u201d \u201cServer Platform Development\u201d -y<br \/>\nyum install libxml2-devel lz4 lz4-devel libpcap nmap lsof socat -y<\/div>\n<div><\/div>\n<div>\n[mariadb]<br \/>\nname = MariaDB<br \/>\nbaseurl = http:\/\/yum.mariadb.org\/5.5.46\/centos6-amd64<br \/>\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<br \/>\ngpgcheck=1<\/p>\n<p>[root@cluster1 ~]# cat \/etc\/yum.repos.d\/mariadb.repo<br \/>\n[mariadb]<br \/>\nname = MariaDB<br \/>\nbaseurl = http:\/\/yum.mariadb.org\/10.0\/centos6-amd64<br \/>\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<br \/>\ngpgcheck=1<br \/>\n[root@cluster1 ~]# scp \/etc\/yum.repos.d\/mariadb.repo root@cluster2:\/etc\/yum.repos.d\/<br \/>\nmariadb.repo\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 100%\u00a0 138\u00a0\u00a0\u00a0\u00a0 0.1KB\/s\u00a0\u00a0 00:00<br \/>\n[root@cluster1 ~]# scp \/etc\/yum.repos.d\/mariadb.repo root@cluster3:\/etc\/yum.repos.d\/<br \/>\nmariadb.repo\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 100%\u00a0 138\u00a0\u00a0\u00a0\u00a0 0.1KB\/s\u00a0\u00a0 00:00<\/p><\/div>\n<div><\/div>\n<div>[root@cluster1 ~]# yum install MariaDB-Galera-server MariaDB-client galera -y<br \/>\n[root@cluster2 ~]# yum install MariaDB-Galera-server MariaDB-client galera -y<br \/>\n[root@cluster3 ~]# yum install MariaDB-Galera-server MariaDB-client galera -y<\/p>\n<p>[root@cluster1 ~]# service mysql restart<br \/>\nERROR! MySQL server PID file could not be found!<br \/>\nStarting MySQL&#8230;.. SUCCESS!<\/p><\/div>\n<div><\/div>\n<div>\/usr\/bin\/mysqladmin -u root password &#8216;test123&#8217;<\/div>\n<div><\/div>\n<div>\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br \/>\nSERVERS IN PRODUCTION USE!\u00a0 PLEASE READ EACH STEP CAREFULLY!<\/div>\n<div><\/div>\n<div>In order to log into MariaDB to secure it, we&#8217;ll need the current<br \/>\npassword for the root user.\u00a0 If you&#8217;ve just installed MariaDB, and<br \/>\nyou haven&#8217;t set the root password yet, the password will be blank,<br \/>\nso you should just press enter here.<\/div>\n<div><\/div>\n<div>Enter current password for root (enter for none):<br \/>\nOK, successfully used password, moving on&#8230;<\/div>\n<div><\/div>\n<div>Setting the root password ensures that nobody can log into the MariaDB<br \/>\nroot user without the proper authorisation.<\/div>\n<div><\/div>\n<div>You already have a root password set, so you can safely answer &#8216;n&#8217;.<\/div>\n<div><\/div>\n<div>Change the root password? [Y\/n] n<br \/>\n&#8230; skipping.<\/div>\n<div><\/div>\n<div>By default, a MariaDB installation has an anonymous user, allowing anyone<br \/>\nto log into MariaDB without having to have a user account created for<br \/>\nthem.\u00a0 This is intended only for testing, and to make the installation<br \/>\ngo a bit smoother.\u00a0 You should remove them before moving into a<br \/>\nproduction environment.<\/div>\n<div><\/div>\n<div>Remove anonymous users? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Normally, root should only be allowed to connect from &#8216;localhost&#8217;.\u00a0 This<br \/>\nensures that someone cannot guess at the root password from the network.<\/div>\n<div><\/div>\n<div>Disallow root login remotely? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>By default, MariaDB comes with a database named &#8216;test&#8217; that anyone can<br \/>\naccess.\u00a0 This is also intended only for testing, and should be removed<br \/>\nbefore moving into a production environment.<\/div>\n<div><\/div>\n<div>Remove test database and access to it? [Y\/n] Y<br \/>\n&#8211; Dropping test database&#8230;<br \/>\n&#8230; Success!<br \/>\n&#8211; Removing privileges on test database&#8230;<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Reloading the privilege tables will ensure that all changes made so far<br \/>\nwill take effect immediately.<\/div>\n<div><\/div>\n<div>Reload privilege tables now? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Cleaning up&#8230;<\/div>\n<div><\/div>\n<div>All done!\u00a0 If you&#8217;ve completed all of the above steps, your MariaDB<br \/>\ninstallation should now be secure.<\/div>\n<div><\/div>\n<div>Thanks for using MariaDB!<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>\n[root@cluster2 ~]# service mysql restart<br \/>\nERROR! MySQL server PID file could not be found!<br \/>\nStarting MySQL&#8230;.. SUCCESS!<\/div>\n<div><\/div>\n<div>\/usr\/bin\/mysqladmin -u root password &#8216;test123&#8217;<\/div>\n<div><\/div>\n<div>\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br \/>\nSERVERS IN PRODUCTION USE!\u00a0 PLEASE READ EACH STEP CAREFULLY!<\/div>\n<div><\/div>\n<div>In order to log into MariaDB to secure it, we&#8217;ll need the current<br \/>\npassword for the root user.\u00a0 If you&#8217;ve just installed MariaDB, and<br \/>\nyou haven&#8217;t set the root password yet, the password will be blank,<br \/>\nso you should just press enter here.<\/div>\n<div><\/div>\n<div>Enter current password for root (enter for none):<br \/>\nOK, successfully used password, moving on&#8230;<\/div>\n<div><\/div>\n<div>Setting the root password ensures that nobody can log into the MariaDB<br \/>\nroot user without the proper authorisation.<\/div>\n<div><\/div>\n<div>You already have a root password set, so you can safely answer &#8216;n&#8217;.<\/div>\n<div><\/div>\n<div>Change the root password? [Y\/n] n<br \/>\n&#8230; skipping.<\/div>\n<div><\/div>\n<div>By default, a MariaDB installation has an anonymous user, allowing anyone<br \/>\nto log into MariaDB without having to have a user account created for<br \/>\nthem.\u00a0 This is intended only for testing, and to make the installation<br \/>\ngo a bit smoother.\u00a0 You should remove them before moving into a<br \/>\nproduction environment.<\/div>\n<div><\/div>\n<div>Remove anonymous users? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Normally, root should only be allowed to connect from &#8216;localhost&#8217;.\u00a0 This<br \/>\nensures that someone cannot guess at the root password from the network.<\/div>\n<div><\/div>\n<div>Disallow root login remotely? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>By default, MariaDB comes with a database named &#8216;test&#8217; that anyone can<br \/>\naccess.\u00a0 This is also intended only for testing, and should be removed<br \/>\nbefore moving into a production environment.<\/div>\n<div><\/div>\n<div>Remove test database and access to it? [Y\/n] Y<br \/>\n&#8211; Dropping test database&#8230;<br \/>\n&#8230; Success!<br \/>\n&#8211; Removing privileges on test database&#8230;<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Reloading the privilege tables will ensure that all changes made so far<br \/>\nwill take effect immediately.<\/div>\n<div><\/div>\n<div>Reload privilege tables now? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Cleaning up&#8230;<\/div>\n<div><\/div>\n<div>All done!\u00a0 If you&#8217;ve completed all of the above steps, your MariaDB<br \/>\ninstallation should now be secure.<\/div>\n<div><\/div>\n<div>Thanks for using MariaDB!<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>[root@cluster3 ~]# service mysql restart<br \/>\nERROR! MySQL server PID file could not be found!<br \/>\nStarting MySQL&#8230;.. SUCCESS!<\/div>\n<div><\/div>\n<div>\/usr\/bin\/mysqladmin -u root password &#8216;test123&#8217;<\/div>\n<div><\/div>\n<div>\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br \/>\nSERVERS IN PRODUCTION USE!\u00a0 PLEASE READ EACH STEP CAREFULLY!<\/div>\n<div><\/div>\n<div>In order to log into MariaDB to secure it, we&#8217;ll need the current<br \/>\npassword for the root user.\u00a0 If you&#8217;ve just installed MariaDB, and<br \/>\nyou haven&#8217;t set the root password yet, the password will be blank,<br \/>\nso you should just press enter here.<\/div>\n<div><\/div>\n<div>Enter current password for root (enter for none):<br \/>\nOK, successfully used password, moving on&#8230;<\/div>\n<div><\/div>\n<div>Setting the root password ensures that nobody can log into the MariaDB<br \/>\nroot user without the proper authorisation.<\/div>\n<div><\/div>\n<div>You already have a root password set, so you can safely answer &#8216;n&#8217;.<\/div>\n<div><\/div>\n<div>Change the root password? [Y\/n] n<br \/>\n&#8230; skipping.<\/div>\n<div><\/div>\n<div>By default, a MariaDB installation has an anonymous user, allowing anyone<br \/>\nto log into MariaDB without having to have a user account created for<br \/>\nthem.\u00a0 This is intended only for testing, and to make the installation<br \/>\ngo a bit smoother.\u00a0 You should remove them before moving into a<br \/>\nproduction environment.<\/div>\n<div><\/div>\n<div>Remove anonymous users? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Normally, root should only be allowed to connect from &#8216;localhost&#8217;.\u00a0 This<br \/>\nensures that someone cannot guess at the root password from the network.<\/div>\n<div><\/div>\n<div>Disallow root login remotely? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>By default, MariaDB comes with a database named &#8216;test&#8217; that anyone can<br \/>\naccess.\u00a0 This is also intended only for testing, and should be removed<br \/>\nbefore moving into a production environment.<\/div>\n<div><\/div>\n<div>Remove test database and access to it? [Y\/n] Y<br \/>\n&#8211; Dropping test database&#8230;<br \/>\n&#8230; Success!<br \/>\n&#8211; Removing privileges on test database&#8230;<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Reloading the privilege tables will ensure that all changes made so far<br \/>\nwill take effect immediately.<\/div>\n<div><\/div>\n<div>Reload privilege tables now? [Y\/n] Y<br \/>\n&#8230; Success!<\/div>\n<div><\/div>\n<div>Cleaning up&#8230;<\/div>\n<div><\/div>\n<div>All done!\u00a0 If you&#8217;ve completed all of the above steps, your MariaDB<br \/>\ninstallation should now be secure.<\/div>\n<div><\/div>\n<div>Thanks for using MariaDB!<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>CLUSTER1<\/div>\n<div><\/div>\n<div>mysql -u root -ptest123 &lt;&lt;&lt; &#8220;USE mysql;<br \/>\nGRANT ALL PRIVILEGES ON *.* TO &#8216;cluster&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;test123&#8217; WITH GRANT OPTION;<br \/>\nFLUSH PRIVILEGES;&#8221;<\/div>\n<div><\/div>\n<div>mysql -u root -ptest123 &lt;&lt;&lt; &#8220;USE mysql;<br \/>\nSELECT USER,PASSWORD,HOST FROM user;&#8221;<\/div>\n<div><\/div>\n<div>\nCLUSTER2<\/div>\n<div><\/div>\n<div>mysql -u root -ptest123 &lt;&lt;&lt; &#8220;USE mysql;<br \/>\nGRANT ALL PRIVILEGES ON *.* TO &#8216;cluster&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;test123&#8217; WITH GRANT OPTION;<br \/>\nFLUSH PRIVILEGES;&#8221;<\/div>\n<div><\/div>\n<div>mysql -u root -ptest123 &lt;&lt;&lt; &#8220;USE mysql;<br \/>\nSELECT USER,PASSWORD,HOST FROM user;&#8221;<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>CLUSTER3<\/div>\n<div><\/div>\n<div>mysql -u root -ptest123 &lt;&lt;&lt; &#8220;USE mysql;<br \/>\nGRANT ALL PRIVILEGES ON *.* TO &#8216;cluster&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;test123&#8217; WITH GRANT OPTION;<br \/>\nFLUSH PRIVILEGES;&#8221;<\/div>\n<div><\/div>\n<div>mysql -u root -ptest123 &lt;&lt;&lt; &#8220;USE mysql;<br \/>\nSELECT USER,PASSWORD,HOST FROM user;&#8221;<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0modify the configuration of three nodes<\/div>\n<div><\/div>\n<div>####cluster1####<br \/>\n[root@cluster1 ~]# sed -ne &#8216;\/\\[mariadb-10.0\\]\/,\/\/p&#8217; \/etc\/my.cnf.d\/server.cnf<br \/>\n[mariadb-10.0]<br \/>\nquery_cache_size=0<br \/>\nbinlog_format=ROW<br \/>\ndefault_storage_engine=innodb<br \/>\ninnodb_autoinc_lock_mode=2<br \/>\nwsrep_provider=\/usr\/lib64\/galera\/libgalera_smm.so<br \/>\nwsrep_cluster_address=gcomm:\/\/192.168.1.62,192.168.1.63<br \/>\nwsrep_cluster_name=&#8217;cluster1&#8242;<br \/>\nwsrep_node_address=&#8217;192.168.1.60&#8242;<br \/>\nwsrep_node_name=&#8217;cluster1&#8242;<br \/>\nwsrep_sst_method=rsync<br \/>\nwsrep_sst_auth=root:password<br \/>\n[root@cluster1 my.cnf.d]# ls<br \/>\nmysql-clients.cnf\u00a0 server.cnf\u00a0 tokudb.cnf<br \/>\n[root@cluster1 my.cnf.d]# cat^C<br \/>\n[root@cluster1 my.cnf.d]# \/etc\/init.d\/mysql bootstrap<br \/>\nBootstrapping the cluster.. Starting MySQL&#8230;. SUCCESS!<\/div>\n<div><\/div>\n<div>\n####cluster2####<br \/>\n[root@cluster2 ~]# sed -ne &#8216;\/\\[mariadb-10.0\\]\/,\/\/p&#8217; \/etc\/my.cnf.d\/server.cnf<br \/>\n[mariadb-10.0]<br \/>\nquery_cache_size=0<br \/>\nbinlog_format=ROW<br \/>\ndefault_storage_engine=innodb<br \/>\ninnodb_autoinc_lock_mode=2<br \/>\nwsrep_provider=\/usr\/lib64\/galera\/libgalera_smm.so<br \/>\nwsrep_cluster_address=gcomm:\/\/192.168.1.60,192.168.1.63<br \/>\nwsrep_cluster_name=&#8217;cluster1&#8242;<br \/>\nwsrep_node_address=&#8217;192.168.1.62&#8242;<br \/>\nwsrep_node_name=&#8217;cluster2&#8242;<br \/>\nwsrep_sst_method=rsync<br \/>\nwsrep_sst_auth=root:password<\/div>\n<div><\/div>\n<div>\n####cluster3####<br \/>\n[root@cluster3\u00a0 ~]# sed -ne &#8216;\/\\[mariadb-10.0\\]\/,\/\/p&#8217; \/etc\/my.cnf.d\/server.cnf<br \/>\n[mariadb-10.0]<br \/>\nquery_cache_size=0<br \/>\nbinlog_format=ROW<br \/>\ndefault_storage_engine=innodb<br \/>\ninnodb_autoinc_lock_mode=2<br \/>\nwsrep_provider=\/usr\/lib64\/galera\/libgalera_smm.so<br \/>\nwsrep_cluster_address=gcomm:\/\/192.168.1.60,192.168.1.62<br \/>\nwsrep_cluster_name=&#8217;cluster1&#8242;<br \/>\nwsrep_node_address=&#8217;192.168.1.63&#8242;<br \/>\nwsrep_node_name=&#8217;cluster3&#8242;<br \/>\nwsrep_sst_method=rsync<br \/>\nwsrep_sst_auth=root:password<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>[root@cluster1 my.cnf.d]# mysql -u root -p<br \/>\nEnter password:<br \/>\nWelcome to the MariaDB monitor.\u00a0 Commands end with ; or \\g.<br \/>\nYour MariaDB connection id is 4<br \/>\nServer version: 5.5.46-MariaDB-wsrep MariaDB Server, wsrep_25.12.r4f81026<\/div>\n<div><\/div>\n<div>Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.<\/div>\n<div><\/div>\n<div>Type &#8216;help;&#8217; or &#8216;\\h&#8217; for help. Type &#8216;\\c&#8217; to clear the current input statement.<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; create database mohan;<br \/>\nQuery OK, 1 row affected (0.02 sec)<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; show databases;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| Database\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| information_schema |<br \/>\n| mohan\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| mysql\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| performance_schema |<br \/>\n| test\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n5 rows in set (0.00 sec)<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; drop databases test;<br \/>\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near &#8216;databases test&#8217; at line 1<br \/>\nMariaDB [(none)]&gt; drop database test;<br \/>\nQuery OK, 0 rows affected (0.01 sec)<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt;<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>\nroot@cluster2 my.cnf.d]# mysql -u root -p<br \/>\nEnter password:<br \/>\nWelcome to the MariaDB monitor.\u00a0 Commands end with ; or \\g.<br \/>\nYour MariaDB connection id is 4<br \/>\nServer version: 5.5.46-MariaDB-wsrep MariaDB Server, wsrep_25.12.r4f81026<\/div>\n<div><\/div>\n<div>Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.<\/div>\n<div><\/div>\n<div>Type &#8216;help;&#8217; or &#8216;\\h&#8217; for help. Type &#8216;\\c&#8217; to clear the current input statement.<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; show databases;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| Database\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| information_schema |<br \/>\n| mohan\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| mysql\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| performance_schema |<br \/>\n| test\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n5 rows in set (0.00 sec)<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; show databases;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| Database\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| information_schema |<br \/>\n| mohan\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| mysql\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| performance_schema |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n4 rows in set (0.00 sec)<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; quit<br \/>\nBye<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>[root@cluster3 my.cnf.d]# mysql -u root -p<br \/>\nEnter password:<br \/>\nWelcome to the MariaDB monitor.\u00a0 Commands end with ; or \\g.<br \/>\nYour MariaDB connection id is 4<br \/>\nServer version: 5.5.46-MariaDB-wsrep MariaDB Server, wsrep_25.12.r4f81026<\/div>\n<div><\/div>\n<div>Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.<\/div>\n<div><\/div>\n<div>Type &#8216;help;&#8217; or &#8216;\\h&#8217; for help. Type &#8216;\\c&#8217; to clear the current input statement.<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; show databases;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| Database\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| information_schema |<br \/>\n| mohan\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| mysql\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| performance_schema |<br \/>\n| test\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n5 rows in set (0.00 sec)<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; show databases;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| Database\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| information_schema |<br \/>\n| mohan\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| mysql\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| performance_schema |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n4 rows in set (0.00 sec)<\/div>\n<div><\/div>\n<div>MariaDB [(none)]&gt; quit<br \/>\nBye<\/div>\n","protected":false},"excerpt":{"rendered":"<p> Yum to configure multiple master cluster MariaDB Galera Hereinafter, if the command is not preceded by PS1 is to represent the three nodes are required to perform the same action, if it means the implementation of the action on the specified node<\/p>\n<p>cluster1.rmohan.com Centos6.7 192.168.1.60 MariaDB cluster2.rmohan.com Centos6.7 192.168.1.62 MariaDB cluster3.rmohan.com Centos6.7 192.168.1.63 MariaDB<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,16],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5377"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5377"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5377\/revisions"}],"predecessor-version":[{"id":5378,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5377\/revisions\/5378"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}