Install and configure mycat and install and configure mycat
1. Install jdk
Test whether jdk has been installed
[Root @ node002 ~] # Java-version
-Bash: java: command not found
Create an extract directory
[Root @ node002 ~] # Mkdir-p/usr/local/java
Upload jdk
Decompress jdk
[Root @ node002 ~] # Tar zxvf jdk-7u80-linux-x64.tar.gz-C/usr/local/java/
[Root @ node002 ~] #/Usr/local/java/jdk1.7.0 _ 80/
[Root @ node002 ~] # Vi/etc/profile
79 export JAVA_HOME =/usr/local/java/jdk1.7.0 _ 80
80 export CLASSPATH =./$ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
81 export PATH = $ PATH: $ JAVA_HOME/bin
[Root @ node002 ~] # Source/etc/profile
[Root @ node002 ~] # Java-version
Java version "1.7.0 _ 80"
Java (TM) SE Runtime Environment (build 1.7.0 _ 80-b15)
Java HotSpot (TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
2. Upload and decompress
Http://dl.mycat.io download path
Upload
Extract
[Root @ node002 ~] # Tar zxvf Mycat-server-1.6.5-release-20171117203123-linux.tar.gz-C/usr/local/
3 Configuration
Specify the logical database, logical table, and node (schema. xml)
[Root @ node002 mycat] # cd/usr/local/mycat/conf
[Root @ node002 conf] # vi schema. xml
Modify user-specify logical database
4. Start the connection
[Root @ node002 conf] # cd/usr/local/mycat/bin/
[Root @ node002 bin] #./mycat start
Starting Mycat-server...
Started successfully. The default port used is 8066.
Connection
5 Test
Add different data in physical db1, db2, and db3 respectively
Create a table in mycat and execute a query in mycat to merge and display physical db1, db2, and DB3.