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
192.168.1.60 cluster1.rmohan.com cluster1
192.168.1.62 cluster2.rmohan.com cluster2
192.168.1.63 cluster3.rmohan.com cluster3
EOF
### The following are performed on each node, so that the public key of the machine onto the other nodes
awk ‘{if ($0!~/'”$(hostname)”‘|localhost/)print $NF}’ /etc/hosts |xargs -i ssh-copy-id -i ~/.ssh/id_rsa.pub root@{}
yum -y install epel-release
# set [priority=5]
# for another way, change to [enabled=0] and use it only when needed
sed -i -e “s/enabled=1/enabled=0/g” /etc/yum.repos.d/epel.repo
# if [enabled=0], input a command to use the repository
yum –enablerepo=epel install [Package]
# set [priority=10]
sed -i -e “s/\]$/\]\npriority=10/g” /etc/yum.repos.d/rpmforge.repo
# for another way, change to [enabled=0] and use it only when needed
sed -i -e “s/enabled = 1/enabled = 0/g” /etc/yum.repos.d/rpmforge.repo
# if [enabled=0], input a command to use the repository
yum –enablerepo=rpmforge install [Package]
rpm –import http://mirrors.dwhd.org/epel/RPM-GPG-KEY-EPEL-6
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm –import http://mirrors.dwhd.org/repoforge/RPM-GPG-KEY.dag.txt
yum groupinstall “Development tools” “Server Platform Development” -y
yum install libxml2-devel lz4 lz4-devel libpcap nmap lsof socat -y
name = MariaDB
baseurl = http://yum.mariadb.org/5.5.46/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
[root@cluster1 ~]# cat /etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
[root@cluster1 ~]# scp /etc/yum.repos.d/mariadb.repo root@cluster2:/etc/yum.repos.d/
mariadb.repo 100% 138 0.1KB/s 00:00
[root@cluster1 ~]# scp /etc/yum.repos.d/mariadb.repo root@cluster3:/etc/yum.repos.d/
mariadb.repo 100% 138 0.1KB/s 00:00
[root@cluster2 ~]# yum install MariaDB-Galera-server MariaDB-client galera -y
[root@cluster3 ~]# yum install MariaDB-Galera-server MariaDB-client galera -y
[root@cluster1 ~]# service mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL….. SUCCESS!
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
OK, successfully used password, moving on…
root user without the proper authorisation.
… skipping.
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
… Success!
ensures that someone cannot guess at the root password from the network.
… Success!
access. This is also intended only for testing, and should be removed
before moving into a production environment.
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
will take effect immediately.
… Success!
installation should now be secure.
ERROR! MySQL server PID file could not be found!
Starting MySQL….. SUCCESS!
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
OK, successfully used password, moving on…
root user without the proper authorisation.
… skipping.
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
… Success!
ensures that someone cannot guess at the root password from the network.
… Success!
access. This is also intended only for testing, and should be removed
before moving into a production environment.
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
will take effect immediately.
… Success!
installation should now be secure.
ERROR! MySQL server PID file could not be found!
Starting MySQL….. SUCCESS!
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
OK, successfully used password, moving on…
root user without the proper authorisation.
… skipping.
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
… Success!
ensures that someone cannot guess at the root password from the network.
… Success!
access. This is also intended only for testing, and should be removed
before moving into a production environment.
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
will take effect immediately.
… Success!
installation should now be secure.
GRANT ALL PRIVILEGES ON *.* TO ‘cluster’@’%’ IDENTIFIED BY ‘test123’ WITH GRANT OPTION;
FLUSH PRIVILEGES;”
SELECT USER,PASSWORD,HOST FROM user;”
GRANT ALL PRIVILEGES ON *.* TO ‘cluster’@’%’ IDENTIFIED BY ‘test123’ WITH GRANT OPTION;
FLUSH PRIVILEGES;”
SELECT USER,PASSWORD,HOST FROM user;”
GRANT ALL PRIVILEGES ON *.* TO ‘cluster’@’%’ IDENTIFIED BY ‘test123’ WITH GRANT OPTION;
FLUSH PRIVILEGES;”
SELECT USER,PASSWORD,HOST FROM user;”
[root@cluster1 ~]# sed -ne ‘/\[mariadb-10.0\]/,//p’ /etc/my.cnf.d/server.cnf
[mariadb-10.0]
query_cache_size=0
binlog_format=ROW
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://192.168.1.62,192.168.1.63
wsrep_cluster_name=’cluster1′
wsrep_node_address=’192.168.1.60′
wsrep_node_name=’cluster1′
wsrep_sst_method=rsync
wsrep_sst_auth=root:password
[root@cluster1 my.cnf.d]# ls
mysql-clients.cnf server.cnf tokudb.cnf
[root@cluster1 my.cnf.d]# cat^C
[root@cluster1 my.cnf.d]# /etc/init.d/mysql bootstrap
Bootstrapping the cluster.. Starting MySQL…. SUCCESS!
[root@cluster2 ~]# sed -ne ‘/\[mariadb-10.0\]/,//p’ /etc/my.cnf.d/server.cnf
[mariadb-10.0]
query_cache_size=0
binlog_format=ROW
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://192.168.1.60,192.168.1.63
wsrep_cluster_name=’cluster1′
wsrep_node_address=’192.168.1.62′
wsrep_node_name=’cluster2′
wsrep_sst_method=rsync
wsrep_sst_auth=root:password
[root@cluster3 ~]# sed -ne ‘/\[mariadb-10.0\]/,//p’ /etc/my.cnf.d/server.cnf
[mariadb-10.0]
query_cache_size=0
binlog_format=ROW
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://192.168.1.60,192.168.1.62
wsrep_cluster_name=’cluster1′
wsrep_node_address=’192.168.1.63′
wsrep_node_name=’cluster3′
wsrep_sst_method=rsync
wsrep_sst_auth=root:password
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.46-MariaDB-wsrep MariaDB Server, wsrep_25.12.r4f81026
Query OK, 1 row affected (0.02 sec)
+——————–+
| Database |
+——————–+
| information_schema |
| mohan |
| mysql |
| performance_schema |
| test |
+——————–+
5 rows in set (0.00 sec)
ERROR 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 ‘databases test’ at line 1
MariaDB [(none)]> drop database test;
Query OK, 0 rows affected (0.01 sec)
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.46-MariaDB-wsrep MariaDB Server, wsrep_25.12.r4f81026
+——————–+
| Database |
+——————–+
| information_schema |
| mohan |
| mysql |
| performance_schema |
| test |
+——————–+
5 rows in set (0.00 sec)
+——————–+
| Database |
+——————–+
| information_schema |
| mohan |
| mysql |
| performance_schema |
+——————–+
4 rows in set (0.00 sec)
Bye
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.46-MariaDB-wsrep MariaDB Server, wsrep_25.12.r4f81026
+——————–+
| Database |
+——————–+
| information_schema |
| mohan |
| mysql |
| performance_schema |
| test |
+——————–+
5 rows in set (0.00 sec)
+——————–+
| Database |
+——————–+
| information_schema |
| mohan |
| mysql |
| performance_schema |
+——————–+
4 rows in set (0.00 sec)
Bye
Recent Comments