欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

Mycat讀寫分離以及拆庫拆表綜合實驗3:通過日志分析mycat路由過程

#在客戶端查詢t1表中id=1的值

網(wǎng)站建設哪家好,找創(chuàng)新互聯(lián)公司!專注于網(wǎng)頁設計、網(wǎng)站建設、微信開發(fā)、微信小程序定制開發(fā)、集團企業(yè)網(wǎng)站建設等服務項目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了新市免費建站歡迎大家使用!

我們在之前的schma.cnf中定義了t1在是一張全局表,且位于名稱為MySQL的分片節(jié)點(datanode)上,因此當mycat攔截到客戶端SQL語句之后,分析t1位于mysql分片節(jié)點上,直接發(fā)放該分片節(jié)點的readhost上

mysql > select * from t1 where id=1;

2018-05-25 10:16:16.906 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.backend.mysql.nio.MySQLConnection.synAndDoExecute(MySQLConnection.java:451)) - con need syn ,total syn cmd 1 commands SET names utf8;schema change:false con:MySQLConnection [id=29, lastTime=1527214576906, user=mycat, schema=yuyang, old shema=yuyang, borrowed=true, fromSlaveDB=true, threadId=20, charset=utf8, txIsolation=3, autocommit=true, attachment=MySQL{SELECT *
FROM t1
WHERE id = 1
LIMIT 100}, respHandler=SingleNodeHandler [node=MySQL{SELECT *
FROM t1
WHERE id = 1
LIMIT 100}, packetId=0], host=192.168.31.117, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]
2018-05-25 10:16:16.907 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.server.NonBlockingSession.releaseConnection(NonBlockingSession.java:378)) - release connection MySQLConnection [id=29, lastTime=1527214576902, user=mycat, schema=yuyang, old shema=yuyang, borrowed=true, fromSlaveDB=true, threadId=20, charset=utf8, txIsolation=3, autocommit=true, attachment=MySQL{SELECT *
FROM t1
WHERE id = 1
LIMIT 100}, respHandler=SingleNodeHandler [node=MySQL{SELECT *
FROM t1
WHERE id = 1
LIMIT 100}, packetId=8], host=192.168.31.117, port=3306, statusSync=io.mycat.backend.mysql.nio.MySQLConnection$StatusSync@40563af9, writeQueue=0, modifiedSQLExecuted=false]
2018-05-25 10:16:16.907 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.backend.datasource.PhysicalDatasource.releaseChannel(PhysicalDatasource.java:595)) - release channel MySQLConnection [id=29, lastTime=1527214576902, user=mycat, schema=yuyang, old shema=yuyang, borrowed=true, fromSlaveDB=true, threadId=20, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=192.168.31.117, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]

t2同理,只不過發(fā)往名為mysql_galera的分片節(jié)點上

mysql > select * from t2 where id=3;
2018-05-25 10:44:00.504 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.backend.mysql.nio.MySQLConnection.synAndDoExecute(MySQLConnection.java:451)) - con need syn ,total syn cmd 1 commands SET names utf8;schema change:false con:MySQLConnection [id=44, lastTime=1527216240504, user=mycat, schema=yuyang, old shema=yuyang, borrowed=true, fromSlaveDB=true, threadId=42, charset=utf8, txIsolation=3, autocommit=true, attachment=MySQL_galera{SELECT *
FROM t2
WHERE id = 3
LIMIT 100}, respHandler=SingleNodeHandler [node=MySQL_galera{SELECT *
FROM t2
WHERE id = 3
LIMIT 100}, packetId=0], host=192.168.31.123, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]
2018-05-25 10:44:00.506 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.server.NonBlockingSession.releaseConnection(NonBlockingSession.java:378)) - release connection MySQLConnection [id=44, lastTime=1527216240502, user=mycat, schema=yuyang, old shema=yuyang, borrowed=true, fromSlaveDB=true, threadId=42, charset=utf8, txIsolation=3, autocommit=true, attachment=MySQL_galera{SELECT *
FROM t2
WHERE id = 3
LIMIT 100}, respHandler=SingleNodeHandler [node=MySQL_galera{SELECT *
FROM t2
WHERE id = 3
LIMIT 100}, packetId=8], host=192.168.31.123, port=3306, statusSync=io.mycat.backend.mysql.nio.MySQLConnection$StatusSync@786ee29, writeQueue=0, modifiedSQLExecuted=false]
2018-05-25 10:44:00.506 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.backend.datasource.PhysicalDatasource.releaseChannel(PhysicalDatasource.java:595)) - release channel MySQLConnection [id=44, lastTime=1527216240502, user=mycat, schema=yuyang, old shema=yuyang, borrowed=true, fromSlaveDB=true, threadId=42, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=192.168.31.123, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]

接下來我們分析一下t3的轉發(fā)邏輯,在schma.cnf中我們定義t3分別位于mysql與mysql_galera兩個分片節(jié)點上,且分片規(guī)則為id%1024后值為0-512則在mysql_galera上,513-1024則在mysql上,搞清楚了定義的分片位置與規(guī)則,下面來分析一下轉發(fā)過程
首先,當mtcat攔截到SQL語句之后,發(fā)現(xiàn)t3存在分片規(guī)則,提取分片字段,匹配分片函數(shù)(也就是規(guī)則),得到了分片列表,把SQL語句發(fā)送到對應的分片節(jié)點上去執(zhí)行

以select id from t3 where id=512 這里的查找id=512,按照分片函數(shù),512放在名為mysql的分片節(jié)點上,然后把SQL發(fā)往該節(jié)點執(zhí)行。

mysql > select id from t3 where id=512;
2018-05-25 10:46:01.027 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.server.NonBlockingSession.execute(NonBlockingSession.java:126)) - ServerConnection [id=10, schema=mycat01, host=192.168.31.124, user=root,txIsolation=3, autocommit=true, schema=mycat01]select * from t3 where id=512, route={
   1 -> MySQL{select * from t3 where id=512}
} rrs 

mysql > select id from t3 where id=1088;
2018-05-25 10:50:20.308 DEBUG [$_NIOREACTOR-1-RW] (io.mycat.server.NonBlockingSession.execute(NonBlockingSession.java:126)) - ServerConnection [id=10, schema=mycat01, host=192.168.31.124, user=root,txIsolation=3, autocommit=true, schema=mycat01]select * from t3 where id=1088, route={
   1 -> MySQL_galera{select * from t3 where id=1088}
} rrs 

網(wǎng)站欄目:Mycat讀寫分離以及拆庫拆表綜合實驗3:通過日志分析mycat路由過程
網(wǎng)頁網(wǎng)址:http://aaarwkj.com/article32/pdicpc.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供域名注冊、企業(yè)網(wǎng)站制作自適應網(wǎng)站、網(wǎng)站收錄動態(tài)網(wǎng)站、網(wǎng)頁設計公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設
天天操天天日天天干夜夜情欢| 国产成年人在线免费观看| 国产日韩手机在线不卡视频| 日韩在线啊啊啊的视频| 美女后入式在线观看| 久久久国产精品调教网站| 蜜桃免费观看在线视频| 高清在线一区二区在线| 香蕉视频网站欧美一区| 精品亚洲综合一区二区| 亚洲精品日韩国产av| 色婷婷亚洲综合色一区二区| 中文字幕国产精品专区| 日韩av在线不卡一区二区| 亚洲青涩精品一区二区三区| 亚洲一区免费在线视频| 亚洲激情自拍偷拍视频| 亚洲av永久精品一区二区三区| 亚洲av最近在线观看| 国产毛片一区二区三区二区| 日本亚洲精品一区二区三| 四虎在线观看永久地址| 国产亚洲精品视频免费| 高清免费在线自偷自拍| 色呦呦视频在线免费观看| 国产婷婷成人久久av免费高清| 国产精品一区二区三区专区| 国产一区二区91精品| 粉嫩极品美女国产精品| 亚洲 综合 久久久| 欧美精品熟妇乱黑人最大| 二区三区成人在线观看| 中文字幕成人在线电影| heyzo高清中文字幕在线| 天天操天天干蜜桃av| 在线观看国产高清自拍| 中文字幕一区二区不卡顿| 97人妻人人澡人人添人人爽| 欧美一区二区男人天堂| 一区二区在线日韩欧美| 免费女同一区二区三区|