http://www.mycat.io/
[root@localhost ~]# ls
anaconda-ks.cfg jdk-8u192-linux-x64.tar.gz Mycat-server-1.6.5-release-20180122220033-linux.tar.gz
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# setenforce 0
[root@localhost ~]# tar -xf jdk-8u192-linux-x64.tar.gz
[root@localhost ~]# tar -xf Mycat-server-1.6.5-release-20180122220033-linux.tar.gz
[root@localhost ~]# cp -r jdk1.8.0_192/ /usr/local/jdk
[root@localhost ~]# cp -r mycat/ /usr/local/
[root@localhost ~]# ls /usr/local/jdk/
bin jre README.html THIRDPARTYLICENSEREADME.txt
COPYRIGHT lib release
include LICENSE src.zip
javafx-src.zip man THIRDPARTYLICENSEREADME-JAVAFX.txt
[root@localhost ~]# sed -i '$aexport JAVA_HOME=/usr/local/jdk' /etc/profile
[root@localhost ~]# sed -i '$aexport PATH=$PATH:$JAVA_HOME/bin' /etc/profile
[root@localhost ~]# java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
[root@localhost ~]# javac -version
javac 1.8.0_192
测试启动mycat
[root@localhost ~]# ls /usr/local/mycat/
bin catlet conf lib logs version.txt
[root@localhost ~]# ll /usr/local/mycat/bin
总用量 384
-rwxr-xr-x. 1 root root 3567 8月 15 15:18 dataMigrate.sh
-rwxr-xr-x. 1 root root 1225 8月 15 15:18 init_zk_data.sh
-rwxr-xr-x. 1 root root 15714 8月 15 15:18 mycat
-rwxr-xr-x. 1 root root 2941 8月 15 15:18 rehash.sh
-rwxr-xr-x. 1 root root 2496 8月 15 15:18 startup_nowrap.sh
-rwxr-xr-x. 1 root root 140198 8月 15 15:18 wrapper-linux-ppc-64
-rwxr-xr-x. 1 root root 99401 8月 15 15:18 wrapper-linux-x86-32
-rwxr-xr-x. 1 root root 111027 8月 15 15:18 wrapper-linux-x86-64
启动mycat
[root@localhost ~]# /usr/local/mycat/bin/mycat consol
Running Mycat-server...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | log4j:WARN No appenders could be found for logger (io.mycat.memory.MyCatMemory).
jvm 1 | log4j:WARN Please initialize the log4j system properly.
jvm 1 | log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
jvm 1 | MyCAT Server startup successfully. see logs in logs/mycat.log
找到server.xml和schema.xml
[root@localhost ~]# ls /usr/local/mycat/conf/
autopartition-long.txt migrateTables.properties sequence_distributed_conf.properties
auto-sharding-long.txt myid.properties sequence_time_conf.properties
auto-sharding-rang-mod.txt partition-hash-int.txt server.xml
cacheservice.properties partition-range-mod.txt sharding-by-enum.txt
dbseq.sql rule.xml wrapper.conf
ehcache.xml schema.xml zkconf
index_to_charset.properties sequence_conf.properties zkdownload
log4j2.xml sequence_db_conf.properties
配置server.xml
[root@localhost ~]# vim /usr/local/mycat/conf/server.xml
配置schema.xml
[root@localhost ~]# vim /usr/local/mycat/conf/schema.xml
[root@localhost ~]# /usr/local/mycat/bin/mycat start
Starting Mycat-server...
[root@localhost ~]# netstat -lnput|grep 8066
tcp6 0 0 :::8066 :::* LISTEN 4516/java
客户机测试:
[root@client ~]# mysql -utdr -h192.168.1.60 -ptdr_123 -P8066