Mycat is an open-source distributed database system that differs from Oracle and MYSQL,MYCAT without a storage engine, but Mycat implements the MySQL protocol, which the former user can use as a proxy. Its core function is to divide the table into the library, to divide a large table horizontally into n small tables, stored in the back-end MySQL storage engine. The latest version of Mycat not only supports MySQL, but also supports relational databases such as Ms Sqlserver,oracle,db2, and also supports MongoDB as a nosql. The MYCAT block the backend storage specific implementation for the caller.
DB Prooxy Database Middleware
The function mainly has 1 reads and writes separates M-s M-m-s-s
2 Load Balancer Galera Cluster
3 fragmented automatic Routing and aggregation of data support
Need to do well in the pre-master replication M-s s-m-s m-m-s-s
Please do the domain name analysis
First, configure the Java environment.
1
Download JDK, Baidu search jdk, download to official website
Then unzip the installation
Tar XF jdk-8u91-linux-x64.tar.gz-c/usr/local/
Easy to update later version ln-s/usr/local/jdk1.8.0_91//usr/local/java
Configuration variable/etc/profile
Java_home=/usr/local/java
Path= $JAVA _home/bin: $PATH
Export Java_home PATH
Boot Configuration Source/etc/profile
View java-version query to version, indicating successful installation
2
Download Mycat
Download website
Unzip and install the tar XF mycat-server-1.6-release-20161028204710-linux.tar.gz-c/usr/local/
Configuring the Mycat front-end Vim/usr/local/mycat/conf/server.xml
Comment out redundant users
Start Mycat Administrator
Configuring Mycat back-end Vim/usr/local/mycat/conf/schema.xml
Schema Name:mycat the name of the cluster maintained.
Datanode: The name of the rear node group.
Datahost: The host name of the rear node group.
Writehost: Write Host
Readhost: Read Host
3
Configuring the Back-end database MySQL group m-s-s
Preparing user-level permissions for a MYCAT connection
For example Master1 mysql>grant all on * * to ' mycatproxy ' @ ' 192.168.0.118 ' identified by ' [email protected] ';
4
Start Mycat/usr/local/mycat/bin/mycat Start
Detects if the port is starting SS-ANLP |grep Java
Detect Mycat process PS aux | grep mycat
Installing the database Customer Server Yum install-y mariadb
Login Mycat mysql-hmycat-uroot-p123456-p8066
show databases;
Can find the rear database data, indicating the successful installation
5
Use the rear database on Mycat
SELECT * from Lihui.t1;
INSERT into LIHUI.T1 values (3);
To do this, MYCAT has been deployed to complete the
MySQL database server proxy mycat simple settings