Get the App
SLTechnology News&Howtos  ›  Servers  › 

Mysql mycat read-write separation

Shulou Source: shulou.com Published: 2022-06-03 09:58:12 12月06日 Update

Mysql mycat read-write separation:

Download URL: http://dl.mycat.io

Mycat official website: http://mycat.org.cn

Description:

10.0.1.2 are mycat servers, 10.0.1.3 and 10.0.1.4 are mysql servers

Yum install java-1.8.0-openjdktar zxfv Mycat-server-1.6.7.5-test-20200109231555-linux.tar.gz-C / space/

Configure read-write separation:

Vi / space/mycat/conf/schema.xml

Select user ()

: wq

Vi / space/mycat/conf/server.xml (mainly change the user part, other do not move)

0

0

one

one

0

0

three hundred

one

(?: (\ snext\ s+value\ s+for\ sMYCATSEQ_ (\ w +)) (, |) |\ s) *) +

False

Io.mycat.route.sequence.handler.HttpIncrSequenceHandler

0

0

0

64k

1k

0

384m

False

False

True

0

Xxxxxx ming ming

: wq

Vi / space/mycat/conf/rule.xml

one

: wq

Vi / space/mycat/conf/autopartition-long.txt

0-500M=0

# 500M-1000M=1

# 1000M-1500M=2

: wq

Start the service:

/ space/mycat/bin/mycat start

Check to see if log has reported any errors (if so, according to the error prompt):

Cat/ space/mycat/logs/wrapper.log

View the port:

Netstat-nplt | grep 8066 (8066 is a data port) netstat-nplt | grep 9066 (9066 is a management port)

Administrative commands:

Mysql-h 10.0.1.2-u ming-pendant xxxxxx'- P9066

Show @ @ help

Show @ @ version

Show @ @ datanode

Show @ @ heartbeat

Show @ @ datasource

Whether there is read-write separation can be seen by the number of READ_LOAD and WRITE_LOAD of different mysql servers in show @ @ datasource.

Read and write:

Mysql-h 10.0.1.2-u ming-pendant xxxxx'- P8066

Tags: Services servers ports URLs management different download URLs commands official URLs data times parts processing prompts configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information Apple NVidia macOS