windows下安裝mycat,並簡單使用

來源:互聯網
上載者:User

標籤:tab   bin   mysq   image   讀寫分離   資料   代碼   bsp   需要   

使用mycat需要先安裝jdk1.7以上

參考:http://www.cnblogs.com/llhhll/p/9257764.html

1從官網下載解壓後目錄如下(1.6版本)

:https://github.com/MyCATApache/Mycat-download

2主要的設定檔在conf檔案夾下

主要用到兩個server.xml 和schema.xml

 

現在我們採用mycat來進行mysql資料庫叢集讀寫分離 ,資料同步採用mysql內建的二進位檔案進行主從同步

mycat  192.168.0.1

主庫   192.168.0.2(寫)

從庫   192.168.0.3 (讀)資料同步讀取主庫二進位檔案進行 (參考:http://www.cnblogs.com/llhhll/p/9182679.html)

 

server.xml配置如下:

配置user節點即可

schema.xml配置如下:

 

schema節點

 

 

dataNode節點

 

datahost節點如下

 

 這裡主庫(寫入)為 192.168.0.2

  這裡從庫(讀)為 192.168.0.3

 

配置以後 正常啟動bin檔案下

 

啟動startup_nowrap 

 

測試:

1 採用navicat 直接連庫   mycat預設連接埠為8066

2 採用代碼直連方式驗證

connectionString="server=127.0.0.1;database=TestLiang;uid=root;pwd=123456;Pooling=true;Connection Lifetime =120; Connection Timeout =120; Port=8066";

這裡的   database=TestLiang;uid=root;pwd=123456;  與mycat下 server.xml 下user節點一致

 

windows下安裝mycat,並簡單使用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.