[root@wallet01 ~]# rpm -ivh epel-release-6-8.noarch.rpm [root@wallet01 ~]# yum install -y bison bison-devel check check-devel boost boost-devel \ cmake readline readline-devel scons socat perl-DBD-MySQL [root@wallet01 ~]# rpm -ivh libev-4.15-1.el6.rf.x86_64.rpm [root@wallet01 ~]# rpm -ivh percona-xtrabackup-24-2.4.9-1.el6.x86_64.rpm [root@wallet01 ~]# [root@amb01 ~]# tar zxvf mariadb-10.3.10.tar.gz [root@wallet01 ~]# cd mariadb-10.3.10 [root@wallet01 mariadb-10.3.10]# cmake . \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -DSYSCONFDIR=/etc \ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \ -DWITHOUT_TOKUDB_STORAGE_ENGINE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_EMBEDDED_SERVER=0 \ -DWITH_WSREP=1 \ -DWITH_INNODB_DISALLOW_WRITES=1 [root@wallet01 mariadb-10.3.10]# make && make install [root@wallet01 mariadb-10.3.10]# cd support-files/ [root@wallet01 support-files]# cp mysql.server /etc/init.d/mysqld [root@wallet01 ~]# chmod a+x /etc/init.d/mysqld [root@wallet01 ~]# vi /etc/my.cnf [mysqld] bind-address = 0.0.0.0 default_storage_engine = innodb innodb_autoinc_lock_mode = 2 innodb_flush_log_at_trx_commit = 0 wsrep_on = 1 wsrep_provider = /usr/local/mysql/lib/libgalera_smm.so wsrep_provider_options="gcache.size=1024M; gcache.page_size=512M" wsrep_cluster_name = "MariaDB Galera Cluster" wsrep_cluster_address = "gcomm://192.168.1.201,192.168.1.202,192.168.1.203" wsrep_sst_method=xtrabackup-v2 wsrep_sst_auth=sst:sst wsrep_node_name = wallet01 wsrep_node_address="192.168.1.201" [root@wallet01 ~]# tar zxvf galera-3-25.3.23.tar.gz [root@wallet01 ~]# cd galera-3-25.3.23 [root@wallet01 galera-3-25.3.23]# scons [root@wallet01 galera-3-25.3.23]# cp libgalera_smm.so /usr/local/mysql/lib/ [root@wallet01 galera-3-25.3.23]# cp garb/garbd /usr/local/mysql/bin/ [root@wallet01 ~]# cd /usr/local/mysql/ [root@wallet01 mysql]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data [root@wallet01 ~]# /etc/init.d/mysqld bootstrap [root@wallet01 ~]# service mysqld status SUCCESS! MariaDB running (27944) [root@wallet01 ~]# mysql_secure_installation [root@wallet01 ~]# mysql -uroot -pabcd.1234 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 728 Server version: 10.3.10-MariaDB-log Source distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create user sst@'localhost' identified by 'sst'; Query OK, 0 rows affected (0.000 sec) MariaDB [(none)]> grant reload,lock tables,replication client,process on *.* to sst@'localhost'; Query OK, 0 rows affected (0.000 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.000 sec) [root@wallet01 ~]# netstat -tunlp | grep mysqld tcp 0 0 0.0.0.0:4567 0.0.0.0:* LISTEN 27944/mysqld tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 27944/mysqld
mysql database 高可用架构:MariaDB Galera Cluster
猜你喜欢
转载自blog.51cto.com/13598811/2326943
今日推荐
周排行