Install and configure mycat and install and configure mycat

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.