05、Mycat实战:Mycat安装启动

6.Mycat安装启动

Mycat使用Java编写,所以需要优先安装jdk,此处略过,本文使用版本如下:

  • jdk 1.8
  • MyCat Mycat-server-1.6-RELEASE-20161028204710-linux

如果未安装jdk,请提前下载:

https://www.oracle.com/cn/java/technologies/javase/javase8-archive-downloads.html

6.1下载解压

官网下载地址:http://dl.mycat.org.cn/

官网中选择对应平台及版本的压缩包:
*

切换到/opt目录,使用wget 下载压缩包

[root@mycat ~]# cd /opt/

[root@mycat opt]# wget http://dl.mycat.org.cn/1.6-RELEASE/Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz
--2021-06-14 21:54:21--  http://dl.mycat.org.cn/1.6-RELEASE/Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz
正在解析主机 dl.mycat.org.cn (dl.mycat.org.cn)... 210.51.26.184
正在连接 dl.mycat.org.cn (dl.mycat.org.cn)|210.51.26.184|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:15662280 (15M) [application/octet-stream]
正在保存至: “Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz”

100%[=====================================================================================================================================================>] 15,662,280  4.18MB/s 用时 4.5s   

2021-06-14 21:54:26 (3.32 MB/s) - 已保存 “Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz” [15662280/15662280])

[root@mycat opt]# ll |grep My
-rw-r--r--. 1 root root  15662280 10月 28 2016 Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz
[root@mycat opt]# tar -zxvf Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz 
mycat/bin/wrapper-linux-ppc-64
mycat/bin/wrapper-linux-x86-64
mycat/bin/wrapper-linux-x86-32
mycat/bin/mycat
mycat/lib/zookeeper-3.4.6.jar
mycat/lib/jline-0.9.94.jar
mycat/lib/ehcache-core-2.6.11.jar
mycat/lib/log4j-1.2.17.jar
mycat/lib/fastjson-1.2.12.jar
mycat/lib/curator-client-2.11.0.jar
mycat/lib/joda-time-2.9.3.jar
mycat/lib/log4j-slf4j-impl-2.5.jar
mycat/lib/libwrapper-linux-x86-32.so
mycat/lib/netty-3.7.0.Final.jar
mycat/lib/druid-1.0.26.jar
mycat/lib/log4j-api-2.5.jar
mycat/lib/mapdb-1.0.7.jar
mycat/lib/slf4j-api-1.6.1.jar
mycat/lib/univocity-parsers-2.2.1.jar
mycat/lib/hamcrest-core-1.3.jar
mycat/lib/Mycat-server-1.6-RELEASE.jar
mycat/lib/objenesis-1.2.jar
mycat/lib/leveldb-api-0.7.jar
mycat/lib/hamcrest-library-1.3.jar
mycat/lib/wrapper.jar
mycat/lib/commons-lang-2.6.jar
mycat/lib/reflectasm-1.03.jar
mycat/lib/mongo-java-driver-2.11.4.jar
mycat/lib/guava-19.0.jar
mycat/lib/curator-recipes-2.11.0.jar
mycat/lib/curator-framework-2.11.0.jar
mycat/lib/libwrapper-linux-ppc-64.so
mycat/lib/log4j-core-2.5.jar
mycat/lib/leveldb-0.7.jar
mycat/lib/sequoiadb-driver-1.12.jar
mycat/lib/mysql-binlog-connector-java-0.4.1.jar
mycat/lib/kryo-2.10.jar
mycat/lib/jsr305-2.0.3.jar
mycat/lib/commons-collections-3.2.1.jar
mycat/lib/disruptor-3.3.4.jar
mycat/lib/log4j-1.2-api-2.5.jar
mycat/lib/velocity-1.7.jar
mycat/lib/libwrapper-linux-x86-64.so
mycat/lib/dom4j-1.6.1.jar
mycat/lib/minlog-1.2.jar
mycat/lib/asm-4.0.jar
mycat/conf/wrapper.conf
mycat/conf/
mycat/conf/zkconf/
mycat/conf/zkdownload/
mycat/conf/sequence_time_conf.properties
mycat/conf/sharding-by-enum.txt
mycat/conf/migrateTables.properties
mycat/conf/zkconf/sequence_time_conf.properties
mycat/conf/zkconf/sharding-by-enum.txt
mycat/conf/zkconf/ehcache.xml
mycat/conf/zkconf/index_to_charset.properties
mycat/conf/zkconf/partition-range-mod.txt
mycat/conf/zkconf/sequence_db_conf.properties
mycat/conf/zkconf/sequence_time_conf-mycat_fz_01.properties
mycat/conf/zkconf/cacheservice.properties
mycat/conf/zkconf/partition-hash-int.txt
mycat/conf/zkconf/autopartition-long.txt
mycat/conf/zkconf/server-mycat_fz_01.xml
mycat/conf/zkconf/auto-sharding-long.txt
mycat/conf/zkconf/rule.xml
mycat/conf/zkconf/auto-sharding-rang-mod.txt
mycat/conf/zkconf/sequence_distributed_conf.properties
mycat/conf/zkconf/sequence_distributed_conf-mycat_fz_01.properties
mycat/conf/zkconf/sequence_conf.properties
mycat/conf/zkconf/schema.xml
mycat/conf/zkconf/server.xml
mycat/conf/ehcache.xml
mycat/conf/index_to_charset.properties
mycat/conf/partition-range-mod.txt
mycat/conf/sequence_db_conf.properties
mycat/conf/cacheservice.properties
mycat/conf/partition-hash-int.txt
mycat/conf/autopartition-long.txt
mycat/conf/auto-sharding-long.txt
mycat/conf/rule.xml
mycat/conf/auto-sharding-rang-mod.txt
mycat/conf/sequence_distributed_conf.properties
mycat/conf/sequence_conf.properties
mycat/conf/myid.properties
mycat/conf/schema.xml
mycat/conf/zkdownload/auto-sharding-long.txt
mycat/conf/server.xml
mycat/version.txt
mycat/conf/log4j2.xml
mycat/bin/init_zk_data.sh
mycat/bin/startup_nowrap.sh
mycat/bin/dataMigrate.sh
mycat/bin/rehash.sh
mycat/logs/
mycat/catlet/

[root@mycat opt]# ll
总用量 30352
drwx--x--x. 4 root  root        28 6月   6 10:02 containerd
drwxr-xr-x. 5 10143 10143      129 4月   8 03:26 jdk1.8.0_291
-rw-r--r--. 1 root  root   2641920 5月  26 09:19 jdk-8u291-linux-x64.tar.gz
drwxr-xr-x. 7 root  root        85 6月  14 17:04 mycat
-rw-r--r--. 1 root  root  26030477 3月   3 08:54 Mycat-server-1.6.7.6-release-20210303094759-linux.tar.gz
-rwxrwxrwx. 2 root  root    397618 5月  26 13:40 nmon_x86_64_centos7
drwxrwxr-x. 6 root  root      4096 3月   2 14:11 redis-5.0.12
-rw-r--r--. 1 root  root   1995069 3月   2 14:22 redis-5.0.12.tar.gz
drwxr-xr-x. 2 root  root         6 10月 31 2018 rh
[root@mycat opt]# 

6.2 文件复制

将解压后的目录copy到 /usr/local目录中

[root@mycat opt]# cp -r mycat/ /usr/local/

[root@mycat opt]# ls /usr/local/
bin  etc  games  include  lib  lib64  libexec  mycat  sbin  share  src
[root@mycat opt]# 

查看mycat目录及mycat的配置文件目录

[root@mycat opt]# cd /usr/local/mycat/
[root@mycat mycat]# ls
bin  catlet  conf  lib  logs  version.txt
[root@mycat mycat]# cd conf/
[root@mycat conf]# ls
autopartition-long.txt       rule.xml
auto-sharding-long.txt       schema.xml
auto-sharding-rang-mod.txt   schema.xml.bak
cacheservice.properties      sequence_conf.properties
dbseq.sql                    sequence_db_conf.properties
dbseq - utf8mb4.sql          sequence_distributed_conf.properties
dnindex.properties           sequence_http_conf.properties
ehcache.xml                  sequence_time_conf.properties
index_to_charset.properties  server.xml
log4j2.xml                   server.xml.bak
migrateTables.properties     sharding-by-enum.txt
myid.properties              wrapper.conf
partition-hash-int.txt       zkconf
partition-range-mod.txt      zkdownload
[root@mycat conf]# 

*其中主要的几个配置文件如下:

  • server.xml:是Mycat服务器参数调整和用户授权的配置文件。

  • schema.xml:是逻辑库定义和表以及分片定义的配置文件。

  • rule.xml: 是分片规则的配置文件,分片规则的具体一些参数信息单独存放为文件,也在这个目录下,配置文件修改需要重启MyCAT。

  • log4j.xml: 日志存放在logs/log中,每天一个文件,日志的配置是在conf/log4j.xml中,根据自己的需要可以调整输出级别为debug

  • debug级别下,会输出更多的信息,方便排查问题。

  • autopartition-long.txt,partition-hash-int.txt,sequence_conf.properties, sequence_db_conf.properties 分片相关的id分片规则配置文件

  • lib MyCAT自身的jar包或依赖的jar包的存放目录。

  • logs MyCAT日志的存放目录。日志存放在logs/log中,每天一个文件

6.3 配置

需要安装jdk,修改jdk环境,即编辑 /usr/local/mycat/conf/wrapper.conf

 vi /usr/local/mycat/conf/wrapper.conf 

配合java命令绝对路径

wrapper.java.command=/opt/jdk1.8.0_291/bin/java

配置mycat 和mysql数据库连接等信息

1.修改server.xml

修改user用户信息
*

完整的配置文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<!-- - - Licensed under the Apache License, Version 2.0 (the "License"); 
	- you may not use this file except in compliance with the License. - You 
	may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 
	- - Unless required by applicable law or agreed to in writing, software - 
	distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 
	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the 
	License for the specific language governing permissions and - limitations 
	under the License. -->
<!DOCTYPE mycat:server SYSTEM "server.dtd">
<mycat:server xmlns:mycat="http://io.mycat/">
	<system>
	<property name="useSqlStat">0</property>  <!-- 1为开启实时统计、0为关闭 -->
	<property name="useGlobleTableCheck">0</property>  <!-- 1为开启全加班一致性检测、0为关闭 -->

		<property name="sequnceHandlerType">2</property>
      <!--  <property name="useCompression">1</property>--> <!--1为开启mysql压缩协议-->
        <!--  <property name="fakeMySQLVersion">5.6.20</property>--> <!--设置模拟的MySQL版本号-->
	<!-- <property name="processorBufferChunk">40960</property> -->
	<!-- 
	<property name="processors">1</property> 
	<property name="processorExecutor">32</property> 
	 -->
		<!--默认为type 0: DirectByteBufferPool | type 1 ByteBufferArena-->
		<property name="processorBufferPoolType">0</property>
		<!--默认是65535 64K 用于sql解析时最大文本长度 -->
		<!--<property name="maxStringLiteralLength">65535</property>-->
		<!--<property name="sequnceHandlerType">0</property>-->
		<!--<property name="backSocketNoDelay">1</property>-->
		<!--<property name="frontSocketNoDelay">1</property>-->
		<!--<property name="processorExecutor">16</property>-->
		<!--
			<property name="serverPort">8066</property> <property name="managerPort">9066</property> 
			<property name="idleTimeout">300000</property> <property name="bindIp">0.0.0.0</property> 
			<property name="frontWriteQueueSize">4096</property> <property name="processors">32</property> -->
		<!--分布式事务开关,0为不过滤分布式事务,1为过滤分布式事务(如果分布式事务内只涉及全局表,则不过滤),2为不过滤分布式事务,但是记录分布式事务日志-->
		<property name="handleDistributedTransactions">0</property>
		
			<!--
			off heap for merge/order/group/limit      1开启   0关闭
		-->
		<property name="useOffHeapForMerge">1</property>

		<!--
			单位为m
		-->
		<property name="memoryPageSize">1m</property>

		<!--
			单位为k
		-->
		<property name="spillsFileBufferSize">1k</property>

		<property name="useStreamOutput">0</property>

		<!--
			单位为m
		-->
		<property name="systemReserveMemorySize">384m</property>
		<!--是否采用zookeeper协调切换  -->
		<property name="useZKSwitch">true</property>
	</system>
	
	<!-- 全局SQL防火墙设置 -->
	<!-- 
	<firewall> 
	   <whitehost>
	      <host host="127.0.0.1" user="mycat"/>
	      <host host="127.0.0.2" user="mycat"/>
	   </whitehost>
       <blacklist check="false">
       </blacklist>
	</firewall>
	-->
	
	<user name="mycat">
		<property name="password">123456</property>
		<property name="schemas">TESTDB</property>
		
		<!-- 表级 DML 权限设置 -->
		<!-- 		
		<privileges check="false">
			<schema name="TESTDB" dml="0110" >
				<table name="tb01" dml="0000"></table>
				<table name="tb02" dml="1111"></table>
			</schema>
		</privileges>		
		 -->
	</user>

	<user name="user">
		<property name="password">user</property>
		<property name="schemas">TESTDB</property>
		<property name="readOnly">true</property>
	</user>

</mycat:server>

2.修改schema.xml

修改dataNode、dataHost

<?xml version="1.0"?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">

	<schema name="TESTDB" checkSQLschema="false" sqlMaxLimit="100" dataNode="dn1">
	</schema>

	<dataNode name="dn1" dataHost="host1" database="testdb" />
	<dataHost name="host1" maxCon="1000" minCon="10" balance="2"
			  writeType="0" dbType="mysql" dbDriver="native" switchType="1"  slaveThreshold="100">
		<heartbeat>select user()</heartbeat>

		<!--can have multi write hosts -->
		<writeHost host="hostM1" url="172.17.0.2:3306" user="root"   password="123456">
			<!-- can have multi read hosts -->
			<readHost host="hostS1" url="172.17.0.3:3306" user="root" password="123456" />
		</writeHost>
	</dataHost>
</mycat:schema>

6.4 启动

到mycat/bin目录执行shell脚本

  • 控制台启动 ./mycat console
  • 后台启动 ./mycat start

如果启动报如下错误原因是没有配置jdk

*

需要修改 /usr/local/mycat/conf/wrapper.conf中的java命令所在的位置

*

完整的启动过程如下

[root@mycat bin]# pwd
/usr/local/mycat/bin
[root@mycat bin]# ls
dataMigrate.sh  init_zk_data.sh  mycat  rehash.sh  startup_nowrap.sh  wrapper-linux-ppc-64  wrapper-linux-x86-32  wrapper-linux-x86-64
[root@mycat bin]# ./mycat 
Usage: ./mycat {
   
      console | start | stop | restart | status | dump }
[root@mycat bin]# ./mycat console
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    | 2021-06-14 21:44:34,395 [INFO ][WrapperSimpleAppMain] total resouces of dataHost host1 is :2  (io.mycat.backend.datasource.PhysicalDBPool:PhysicalDBPool.java:100) 
jvm 1    | 2021-06-14 21:44:34,417 [INFO ][WrapperSimpleAppMain] create layer cache pool TableID2DataNodeCache of type encache ,default cache size 10000 ,default expire seconds18000  (io.mycat.cache.CacheService:CacheService.java:125) 
jvm 1    | 2021-06-14 21:44:34,419 [INFO ][WrapperSimpleAppMain] create child Cache: TESTDB_ORDERS for layered cache TableID2DataNodeCache, size 50000, expire seconds 18000  (io.mycat.cache.DefaultLayedCachePool:DefaultLayedCachePool.java:80) 
jvm 1    | 2021-06-14 21:44:40,604 [INFO ][WrapperSimpleAppMain] dyna class load from ./catlet,and auto check for class file modified every 60 seconds  (io.mycat.config.classloader.DynaClassLoader:DynaClassLoader.java:34) 
jvm 1    | 2021-06-14 21:44:40,605 [INFO ][WrapperSimpleAppMain] ===============================================  (io.mycat.MycatServer:MycatServer.java:266) 
jvm 1    | 2021-06-14 21:44:40,605 [INFO ][WrapperSimpleAppMain] MyCat is ready to startup ...  (io.mycat.MycatServer:MycatServer.java:267) 
jvm 1    | 2021-06-14 21:44:40,606 [INFO ][WrapperSimpleAppMain] Startup processors ...,total processors:4,aio thread pool size:8    
jvm 1    |  each process allocated socket buffer pool  bytes ,a page size:2097152  a page's chunk number(PageSize/ChunkSize) is:512  buffer page's number is:80  (io.mycat.MycatServer:MycatServer.java:279) 
jvm 1    | 2021-06-14 21:44:40,606 [INFO ][WrapperSimpleAppMain] sysconfig params:SystemConfig [processorBufferLocalPercent=100, frontSocketSoRcvbuf=1048576, frontSocketSoSndbuf=4194304, backSocketSoRcvbuf=4194304, backSocketSoSndbuf=1048576, frontSocketNoDelay=1, backSocketNoDelay=1, maxStringLiteralLength=65535, frontWriteQueueSize=2048, bindIp=0.0.0.0, serverPort=8066, managerPort=9066, charset=utf8, processors=4, processorExecutor=8, timerExecutor=2, managerExecutor=2, idleTimeout=1800000, catletClassCheckSeconds=60, sqlExecuteTimeout=300, processorCheckPeriod=1000, dataNodeIdleCheckPeriod=300000, dataNodeHeartbeatPeriod=10000, clusterHeartbeatUser=_HEARTBEAT_USER_, clusterHeartbeatPass=_HEARTBEAT_PASS_, clusterHeartbeatPeriod=5000, clusterHeartbeatTimeout=10000, clusterHeartbeatRetry=10, txIsolation=3, parserCommentVersion=50148, sqlRecordCount=10, bufferPoolPageSize=2097152, bufferPoolChunkSize=4096, bufferPoolPageNumber=80, maxResultSet=524288, bigResultSizeSqlCount=10, bufferUsagePercent=80, flowControlRejectStrategy=0, clearBigSqLResultSetMapMs=600000, defaultMaxLimit=100, sequnceHandlerType=2, sqlInterceptor=io.mycat.server.interceptor.impl.DefaultSqlInterceptor, sqlInterceptorType=select, sqlInterceptorFile=/usr/local/mycat/logs/sql.txt, mutiNodeLimitType=0, mutiNodePatchSize=100, defaultSqlParser=druidparser, usingAIO=0, packetHeaderSize=4, maxPacketSize=16777216, mycatNodeId=1]  (io.mycat.MycatServer:MycatServer.java:280) 
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    | 2021-06-14 21:44:41,495 [INFO ][WrapperSimpleAppMain] using nio network handler   (io.mycat.MycatServer:MycatServer.java:381) 
jvm 1    | 2021-06-14 21:44:41,541 [INFO ][WrapperSimpleAppMain] $_MyCatManager is started and listening on 9066  (io.mycat.MycatServer:MycatServer.java:397) 
jvm 1    | 2021-06-14 21:44:41,543 [INFO ][WrapperSimpleAppMain] $_MyCatServer is started and listening on 8066  (io.mycat.MycatServer:MycatServer.java:401) 
jvm 1    | 2021-06-14 21:44:41,544 [INFO ][WrapperSimpleAppMain] ===============================================  (io.mycat.MycatServer:MycatServer.java:403) 
jvm 1    | 2021-06-14 21:44:41,544 [INFO ][WrapperSimpleAppMain] Initialize dataHost ...  (io.mycat.MycatServer:MycatServer.java:407) 
jvm 1    | 2021-06-14 21:44:41,544 [INFO ][WrapperSimpleAppMain] init backend myqsl source ,create connections total 10 for hostM1 index :0  (io.mycat.backend.datasource.PhysicalDBPool:PhysicalDBPool.java:294) 
jvm 1    | 2021-06-14 21:44:41,551 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,555 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,560 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,564 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,633 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,650 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,653 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,677 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,680 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,681 [INFO ][WrapperSimpleAppMain] no ilde connection in pool,create new connection for hostM1 of schema testdb  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:413) 
jvm 1    | 2021-06-14 21:44:41,905 [INFO ][$_NIOREACTOR-3-RW] connected successfuly MySQLConnection [id=3, lastTime=1623678281905, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=12, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,905 [INFO ][$_NIOREACTOR-1-RW] connected successfuly MySQLConnection [id=1, lastTime=1623678281904, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=21, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,905 [INFO ][$_NIOREACTOR-2-RW] connected successfuly MySQLConnection [id=6, lastTime=1623678281905, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=20, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,906 [INFO ][$_NIOREACTOR-3-RW] connected successfuly MySQLConnection [id=7, lastTime=1623678281905, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=17, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,906 [INFO ][$_NIOREACTOR-0-RW] connected successfuly MySQLConnection [id=4, lastTime=1623678281905, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=15, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,906 [INFO ][$_NIOREACTOR-2-RW] connected successfuly MySQLConnection [id=2, lastTime=1623678281906, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=14, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,906 [INFO ][$_NIOREACTOR-1-RW] connected successfuly MySQLConnection [id=9, lastTime=1623678281906, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=13, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,906 [INFO ][$_NIOREACTOR-1-RW] connected successfuly MySQLConnection [id=5, lastTime=1623678281906, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=19, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,907 [INFO ][$_NIOREACTOR-0-RW] connected successfuly MySQLConnection [id=8, lastTime=1623678281907, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=18, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,909 [INFO ][$_NIOREACTOR-2-RW] connected successfuly MySQLConnection [id=10, lastTime=1623678281909, user=root, schema=testdb, old shema=testdb, borrowed=true, fromSlaveDB=false, threadId=16, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.2, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.GetConnectionHandler:GetConnectionHandler.java:67) 
jvm 1    | 2021-06-14 21:44:41,985 [INFO ][WrapperSimpleAppMain] init result :finished 10 success 10 target count:10  (io.mycat.backend.datasource.PhysicalDBPool:PhysicalDBPool.java:319) 
jvm 1    | 2021-06-14 21:44:41,986 [INFO ][WrapperSimpleAppMain] host1 index:0 init success  (io.mycat.backend.datasource.PhysicalDBPool:PhysicalDBPool.java:265) 
jvm 1    | 2021-06-14 21:44:41,986 [INFO ][WrapperSimpleAppMain] save DataHost index  host1 cur index 0  (io.mycat.MycatServer:MycatServer.java:604) 
jvm 1    | 2021-06-14 21:44:42,056 [INFO ][Timer0] create connections ,because idle connection not enough ,cur is 0, minCon is 10 for hostS1  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:299) 
jvm 1    | 2021-06-14 21:44:42,127 [INFO ][$_NIOREACTOR-3-RW] connectionAcquired MySQLConnection [id=11, lastTime=1623678282126, user=root, schema=testdb, old shema=testdb, borrowed=false, fromSlaveDB=true, threadId=15, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.3, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.NewConnectionRespHandler:NewConnectionRespHandler.java:45) 
jvm 1    | 2021-06-14 21:44:42,149 [INFO ][$_NIOREACTOR-0-RW] connectionAcquired MySQLConnection [id=12, lastTime=1623678282149, user=root, schema=testdb, old shema=testdb, borrowed=false, fromSlaveDB=true, threadId=16, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.3, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.NewConnectionRespHandler:NewConnectionRespHandler.java:45) 
jvm 1    | 2021-06-14 21:44:42,149 [INFO ][$_NIOREACTOR-1-RW] connectionAcquired MySQLConnection [id=13, lastTime=1623678282149, user=root, schema=testdb, old shema=testdb, borrowed=false, fromSlaveDB=true, threadId=17, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.3, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.NewConnectionRespHandler:NewConnectionRespHandler.java:45) 
jvm 1    | MyCAT Server startup successfully. see logs in logs/mycat.log
jvm 1    | 2021-06-14 21:49:42,022 [INFO ][Timer1] create connections ,because idle connection not enough ,cur is 3, minCon is 10 for hostS1  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:299) 
jvm 1    | 2021-06-14 21:49:42,040 [INFO ][$_NIOREACTOR-3-RW] connectionAcquired MySQLConnection [id=15, lastTime=1623678582039, user=root, schema=testdb, old shema=testdb, borrowed=false, fromSlaveDB=true, threadId=18, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.3, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.NewConnectionRespHandler:NewConnectionRespHandler.java:45) 
jvm 1    | 2021-06-14 21:49:42,040 [INFO ][$_NIOREACTOR-2-RW] connectionAcquired MySQLConnection [id=14, lastTime=1623678582039, user=root, schema=testdb, old shema=testdb, borrowed=false, fromSlaveDB=true, threadId=19, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.3, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.NewConnectionRespHandler:NewConnectionRespHandler.java:45) 
jvm 1    | 2021-06-14 21:49:52,518 [INFO ][$_NIOREACTOR-0-RW] [thread=$_NIOREACTOR-0-RW,class=ManagerConnection,id=1,host=127.0.0.1,port=9066,schema=null]'mycat' login success  (io.mycat.net.handler.FrontendAuthenticator:FrontendAuthenticator.java:194) 
jvm 1    | 2021-06-14 21:52:56,495 [INFO ][$_NIOREACTOR-0-RW] close connection,reason:quit cmd ,[thread=$_NIOREACTOR-0-RW,class=ManagerConnection,id=1,host=127.0.0.1,port=9066,schema=null]  (io.mycat.net.AbstractConnection:AbstractConnection.java:508) 
jvm 1    | 2021-06-14 21:54:42,022 [INFO ][Timer1] create connections ,because idle connection not enough ,cur is 5, minCon is 10 for hostS1  (io.mycat.backend.datasource.PhysicalDatasource:PhysicalDatasource.java:299) 
jvm 1    | 2021-06-14 21:54:42,049 [INFO ][$_NIOREACTOR-1-RW] connectionAcquired MySQLConnection [id=16, lastTime=1623678882039, user=root, schema=testdb, old shema=testdb, borrowed=false, fromSlaveDB=true, threadId=20, charset=latin1, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=172.17.0.3, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.backend.mysql.nio.handler.NewConnectionRespHandler:NewConnectionRespHandler.java:45) 

关注公众号,获取等多资讯
*

版权声明:本文不是「本站」原创文章,版权归原作者所有 | 原文地址: