查看系统参数
代码语言:javascript复制mysql> show @@sysparam ;
------------------------------- -------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| PARAM_NAME | PARAM_VALUE | PARAM_DESCR |
------------------------------- -------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| processors | 2 | 主要用于指定系统可用的线程数,默认值为Runtime.getRuntime().availableProcessors()方法返回的值。主要影响processorBufferPool、processorBufferLocalPercent、processorExecutor属性。NIOProcessor的个数也是由这个属性定义的,所以调优的时候可以适当的调高这个属性。 |
| processorBufferChunk | 40960B | 指定每次分配Socket Direct Buffer的大小,默认是4096个字节。这个属性也影响buffer pool的长度。 |
| processorBufferPool | 8192000B | 指定bufferPool计算 比例值。由于每次执行NIO读、写操作都需要使用到buffer,系统初始化的时候会建立一定长度的buffer池来加快读、写的效率,减少建立buffer的时间 |
| processorBufferLocalPercent | 100 | 就是用来控制分配这个pool的大小用的,但其也并不是一个准确的值,也是一个比例值。这个属性默认值为100。线缓存百分比 = bufferLocalPercent / processors属性。 |
| processorExecutor | 4 | 主要用于指定NIOProcessor上共享的businessExecutor固定线程池大小。mycat在需要处理一些异步逻辑的时候会把务提交到这个线程池中。新版本中这个连接池的使用频率不是很大了,可以设置一个较小的值。 |
| sequnceHandlerType | 本地文件方式 | 指定使用Mycat全局序列的类型。 |
| Mysql_packetHeaderSize | 4B | 指定Mysql协议中的报文头长度。默认4 |
| Mysql_maxPacketSize | 16M | 指定Mysql协议可以携带的数据最大长度。默认16M |
| Mysql_idleTimeout | 30分钟 | 指定连接的空闲超时时间。某连接在发起空闲检查下,发现距离上次使用超过了空闲时间,那么这个连接会被回收,就是被直接的关闭掉。默认30分钟 |
| Mysql_charset | utf8 | 连接的初始化字符集。默认为utf8 |
| Mysql_txIsolation | REPEATED_READ | 前端连接的初始化事务隔离级别,只在初始化的时候使用,后续会根据客户端传递过来的属性对后端数据库连接进行同步。默认为REPEATED_READ |
| Mysql_sqlExecuteTimeout | 300秒 | SQL执行超时的时间,Mycat会检查连接上最后一次执行SQL的时间,若超过这个时间则会直接关闭这连接。默认时间300秒 |
| Mycat_processorCheckPeriod | 1秒 | 清理NIOProcessor上前后端空闲、超时和关闭连接的间隔时间。默认是1秒 |
| Mycat_dataNodeIdleCheckPeriod | 300秒 | 对后端连接进行空闲、超时检查的时间间隔,默认是300秒 |
| Mycat_dataNodeHeartbeatPeriod | 10秒 | 对后端所有读、写库发起心跳的间隔时间,默认是10秒 |
| Mycat_bindIp | 0.0.0.0 | mycat服务监听的IP地址,默认值为0.0.0.0 |
| Mycat_serverPort | 8066 | mycat的使用端口,默认值为8066 |
| Mycat_managerPort | 9066 | mycat的管理端口,默认值为9066 |
------------------------------- -------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
18 rows in set (0.01 sec)
mysql>
查看mycat.log日志
代码语言:javascript复制mysql> show @@syslog limit=10;
--------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| DATE | LOG |
--------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 03/08 21:27:44.784 | INFO [$_NIOConnector] (PhysicalDatasource.java:373) -not ilde connection in pool,create new connection for h202M1 of schema my4 |
| 03/08 21:27:44.784 | INFO [$_NIOConnector] (SQLJob.java:111) -can't get connection for sql :select user() |
| 03/08 21:27:44.784 | INFO [$_NIOConnector] (AbstractConnection.java:458) -close connection,reason:java.net.NoRouteToHostException: No route to host ,MySQLConnection [id=0, lastTime=1457443661777, user=root, schema=my4, old shema=my4, borrowed=false, fromSlaveDB=false, threadId=0, charset=utf8, txIsolation=0, autocommit=true, attachment=null, respHandler=null, host=192.168.100.202, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] |
| 03/08 21:27:41.783 | INFO [$_NIOConnector] (PhysicalDatasource.java:373) -not ilde connection in pool,create new connection for h202M1 of schema my4 |
| 03/08 21:27:41.783 | INFO [$_NIOConnector] (SQLJob.java:111) -can't get connection for sql :select user() |
| 03/08 21:27:41.783 | INFO [$_NIOConnector] (AbstractConnection.java:458) -close connection,reason:java.net.NoRouteToHostException: No route to host ,MySQLConnection [id=0, lastTime=1457443658778, user=root, schema=my4, old shema=my4, borrowed=false, fromSlaveDB=false, threadId=0, charset=utf8, txIsolation=0, autocommit=true, attachment=null, respHandler=null, host=192.168.100.202, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] |
| 03/08 21:27:38.789 | INFO [$_NIOConnector] (SQLJob.java:111) -can't get connection for sql :select user() |
| 03/08 21:27:38.789 | INFO [$_NIOConnector] (AbstractConnection.java:458) -close connection,reason:java.net.ConnectException: Connection refused ,MySQLConnection [id=0, lastTime=1457443658778, user=root, schema=db2, old shema=db2, borrowed=false, fromSlaveDB=false, threadId=0, charset=utf8, txIsolation=0, autocommit=true, attachment=null, respHandler=null, host=localhost, port=3316, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] |
| 03/08 21:27:38.789 | INFO [$_NIOConnector] (SQLJob.java:111) -can't get connection for sql :select user() |
| 03/08 21:27:38.789 | INFO [$_NIOConnector] (AbstractConnection.java:458) -close connection,reason:java.net.ConnectException: Connection refused ,MySQLConnection [id=0, lastTime=1457443658778, user=root, schema=db2, old shema=db2, borrowed=false, fromSlaveDB=false, threadId=0, charset=utf8, txIsolation=0, autocommit=true, attachment=null, respHandler=null, host=localhost, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] |
--------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10 rows in set (0.06 sec)
mysql>
查看白名单
代码语言:javascript复制mysql> show @@white;
Empty set (0.01 sec)