Install database middleware - Mycat

Table of contents

Overview

Logic introduction

Advantage

Install Mycat

1. Install JDK

2. Upload the JDK compressed file

3. Unzip

4. Configure environment variables

5. Re-execute the profile file

6. Check whether the installation is successful

7. Download and decompress the Mycat installation package [this example version is 1.6.7.3]

8. Unzip the Mycat installation package

The next article explains the configuration of Mycat


Overview

Mycat is an open source, active, Java-based MySQL database middleware. Mycat can be used like mysql, and developers don't feel Mycat at all - relying on Mycat's disguised protocol

Logic introduction

schema: logical library refers to a logically existing database that does not store data [the specific data is in the physical library]

table: A logical library contains multiple logical tables, and the data in each logical table is scattered in multiple data nodes

dataNode: A logical table contains multiple shard nodes. What kind of data exists in which shard node is configured by sharding rules

Advantage

  1. Reliable and stable performance
  2. Strong technical team
  3. Perfect system
  4. active community

Install Mycat

Mycat is an open source database middleware developed in java language, which supports Windows and Linux operating environments. The following environment needs to be prepared for installation: MySQL JDK

If you already have a JDK environment, please skip to step 7

1. Install JDK

jdk official website download

2. Upload the JDK compressed file

3. Unzip

# 将文件解压缩至 /usr/local
tar -zxvf jdk-8u171-linux-x64.tar.gz  -C /usr/local/

4. Configure environment variables

Use the vim command to modify the /etc/profile file, and add the following configuration at the end of the file

#/etc/profile

JAVA_HOME=/usr/local/jdk1.8.0_171
PATH=$PATH:$JAVA_HOME/bin

5. Re-execute the profile file

source profile

6. Check whether the installation is successful

java -version

7. Download and decompress the Mycat installation package [this example version is 1.6.7.3]

Mycat1 version download

Mycat2 version download

8. Unzip the Mycat installation package

 tar -zxvf Mycat-server-1.6.7.3-release-20210913163959-linux.tar.gz -C /usr/local/

bin: store executable files, used to start and stop Mycat

conf: store the configuration file of Mycat

lib: store Mycat project dependencies

log: store logs

Enter usr/local, find the lib directory and find that the default mysql driver package is version 5.*   

If the mysql of the small partner is version 5.*, there is no need to change

If your partner's mysql version is 8.*, you need to replace the jar package 

Here are the steps to replace:

1. Upload the compliant version dependencies and update the permissions

   chmod 777 mysql-connector-java-8.0.22.jar

2. Delete the default version of the dependency

9. Start Mycat

// 进入到Mycat的安装目录  找到bin目录  启动
bin/mycat start
// 停止
bin/mycat stop

10. Check whether the startup is successful

# 进入logs目录  
tailf wrapper.log 
# 当看到successfully的时候  证明Mycat启动成功

At this point Mycat is installed and started!

The next article explains the configuration of Mycat

Guess you like

Origin blog.csdn.net/weixin_44693109/article/details/127039703