* Desactivar selinux = disabled
* firewalld stop
* Install repositorio EPEL para - centos 7
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
ls *.rpm
To install epel-release-7-1.noarch.rpm, type:
sudo yum install epel-release-7-1.noarch.rpm
$ sudo yum repolist
* Donwload 2 files e instalar.
http://rpm.pbone.net/index.php3/stat/4/idpl/26189186/dir/redhat_el_7/com/mariadb-galera-common-5.5.37-2.el7.x86_64.rpm
http://rpm.pbone.net/index.php3/stat/4/idpl/26189187/dir/redhat_el_7/com/mariadb-galera-server-5.5.37-2.el7.x86_64.rpm
Estos serian los pasos:
Mariadb  galera
cluster configuration.
·        
 Configurar nodos en /etc/Hosts
Nodo04 (principal).  10.1.1.12
Nodo05     10.1.1.13
Nodo06      10.1.1.14
·        
Instalar Mariadb and Galera  en todos los nodos.
#yum remove mysql-server
Instalar epel
#yum install mariadb mariadb-galera-server
mariadb-galera-common galera  –y
·        
 Agregar servicio al Firewall o pararlo
      
# firewall-cmd 
--add-service=mysql
#firewall-cmd 
--add-service=rsyncd
#systemctl stop firewalld.
·        
Start
 mariadb  service
#systemctl start mariadb
#systemctl enable mariadb
#mysql_secure_installation
·        
 Check first connection.
#mysql
 MariaDB>show databases ;
·        
Check
process and port.
#ps –ef | grep mysql
#netstat –nat | grep 3306
#systemctl stop mariadb
·        
Configuring
Galera.
·        
The following
configuration file has to be distributed on all nodes. We use a separate
configuration file /etc/my.cnf.d/galera.cnf with the following settings:
[mysqld]
#mysql settings
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
query_cache_size=0
query_cache_type=0
bind-address=0.0.0.0
#galera settings
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_name="my_wsrep_cluster"
wsrep_cluster_address=gcomm://10.1.1.12,10.1.1.13,10.1.1.14
wsrep_node_address=10.1.1.12
wsrep_node_name=node04
wsrep_sst_method=rsync
is sufficient you just change the IP’s 
[node04]#/usr/libexec/mysqld    -- wsrep-new-cluster   --user=root &
[node04]#mysql
–e “show status like ‘wsrep%’”
   ·        
Copiar
galera.cnf del nodo04  al  nodo05 y nodo06.
# scp galera.cnf root@nodo05   /etc/my.cnf.d
#scp galera.cnf 
root@nodo06  /etc/my.cnf.d
     ·        
Start
mariadb on nodo05
Nodo05# vi /etc/my.cnf.d/galera.cnf
 wsrep_node_address=’10.1.1.13’
wsrep_node_name=’node04’
nodo05#systemctl start mariadb
nodo05#mysql –e “show status like ‘wsrep’”
                                               wsrep_cluster_size    |2 
      ·        
Start
mariadb on nodo06
Nodo06#vi /etc/my.cnf.d/galera.cnf
wsrep_node_address=’10.1.1.14’
wsrep_node_name=’node06’
nodo06# systemctl start mariadb
nodo06#mysql –e “show status like ‘wsrep’”
                                               wsrep_cluster_size    |3 
Comentarios
Publicar un comentario