??????????MYCAT?????? jdk??????? ?????oracle????????????jdk8??????????????JAVA_HOME?????D:WorksoftwareJavajdk1.8 CLASSPATH?????.;%JAVA_HOME%lib;%JAVA_HOME%lib ools.jar path?????????%JAVA_HOME%in; Mycat???????
???????????Windows??????????MYCAT_HOME??????????E:WorkSoftWareMycatServer1.5
?????????????????mycat??jvm??????startup_nowrap.bat?????????????????????????
????“%JAVA_CMD%” -server -Xms1G -Xmx2G -XX:MaxPermSize=64M -XX:+AggressiveOpts -XX:MaxDirectMemorySize=1G -DMYCAT_HOME=%MYCAT_HOME% -cp “..conf;..lib*” io.mycat.MycatStartup
????????-Xms1G???-Xms512M??-Xmx2G???-Xmx1024M??????????????????.
????wrapper.conf????????wrapper.java.command=E:WorkSoftWarejdk1.8injava.exe Mycat????????? schema.xml????????????????????????????????????????datahost??????????datahost????????writeHost????????????á?type=”global”????????
????<?xml version="1.0"?>
????<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
????<mycat:schema xmlns:mycat="http://org.opencloudb/" >
????<!--??????в??????棬schema name???????????MyCAT??????????????????????checkSQLschema????????False?????????MyCAT??????????????????????????????mydatabase1.test1????????test1;sqlMaxLimit?????SQL??????????????-->
????<schema name="TESTDB" checkSQLschema="false" sqlMaxLimit="100">
????<!-- ??????Χ???? -->
????<!-- ????д?????MyCAT?????????Щ????????????ж??????????????????????????????MyCAT??????????????????漲?????????????????show create table ??MyCAT?????????????????????Debug??????????????MyCAT????????????dn1??????????????dn1????????????????? ?????ж????????????????Щ???????п????????????????????????????????????????????
????dataNode???????????????????????洢???????????????????rule???????????????students??????з???????MyCAT????????????????У?????Щ???????????з??????????????????????????                 
????-->
????<table name="travelrecord" dataNode="dn1??dn2??dn3" rule="auto-sharding-long" />
????<table name="company" primaryKey="ID" dataNode="dn3??dn2??dn1" rule="mod-long"/>
????<table name="goods" primaryKey="ID" type="global" dataNode="dn1??dn2" />
????<!--????????????? -->
????<table name="hotnews" primaryKey="ID" dataNode="dn1??dn2??dn3"
????rule="mod-long" />
????<table name="employee" primaryKey="ID" dataNode="dn1??dn2"
????rule="sharding-by-intfile" />
????<table name="customer" primaryKey="ID" dataNode="dn1??dn2"
????rule="sharding-by-intfile">
????<!--
????childtable????????в???????????????????MyCAT??????????????????childtable??????????????????
????????ζ???childtable??joinkey????????parentKey?????????з?????????????????????
????????????????childtable.joinKey=parenttable.parentKey?????????п???????.
????-->
????<childTable name="orders" primaryKey="ID" joinKey="customer_id"
????parentKey="id">
????<childTable name="order_items" joinKey="order_id"
????parentKey="id" />
????</childTable>
????<childTable name="customer_addr" primaryKey="ID" joinKey="customer_id"
????parentKey="id" />
????</table>
????<!-- ?????????????????ж??????????????????????????κα???????????????????????-->
????<table name="news_table" primaryKey="ID" type="global" dataNode="dn1??dn2??dn3" />
????</schema>
????<dataNode name="dn1" dataHost="localhost1" database="mycatDB1" />
????<dataNode name="dn2" dataHost="localhost1" database="mycatDB2" />
????<dataNode name="dn3" dataHost="localhost1" database="mycatDB3" />
????<!--
????dataHost?????????????????????????????????????????????????????????????????????????writeType??balance.
????-->
????<!-- writeType??balance?????????????????д????????????????????????????????????
??????????????????鷳????????????????
????1.balance=0?????????????localhost??(localhost???????????????)
????2.balance=1???????????????????localhost1??????readhost????(localhost??????д????????localhost1?????localhost1???????????????д????)
????3.balance=2???д????????localhost???????????????????localhost1??localhost1??????readhost????(???)
????4.writeType=0???д????????localhost??????localhost??????????л???localhost1??localhost???????????л???localhost????д????
????5.writeType=1???д??????????????localhost??localhost1?????????????????????д?????????????????????????????????£?????????????????????????
????????:localhost??????д????????localhost1??????У?localhost1?????????????У?????localhost?????????localhost??????£?localhost???????????????????????
????-->
????<dataHost name="localhost1" maxCon="1000" minCon="10" balance="0"
????writeType="0" dbType="mysql" dbDriver="native" switchType="1"  slaveThreshold="100">
????<heartbeat>select user()</heartbeat>
????<!-- can have multi write hosts -->
????<writeHost host="hostM1" url="localhost:3306" user="root"
????password="123456">
????<!-- can have multi read hosts -->
????<!--<readHost host="hostS2" url="192.168.1.200:3306" user="root" password="xxx" />-->
????</writeHost>
????</dataHost>
????</mycat:schema>
????server.xml???????
????<?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://org.opencloudb/">
????<system>
????<property name="defaultSqlParser">druidparser</property>
????<!--  <property name="useCompression">1</property>--> <!--1?????mysql???Э??-->
????<!-- <property name="processorBufferChunk">40960</property> -->
????<!--
????<property name="processors">1</property>
????<property name="processorExecutor">32</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="mutiNodeLimitType">1</property> 0??????С???????????? ??1?????????????????
????<property name="mutiNodePatchSize">100</property> ???????????????
????<property name="processors">32</property> <property name="processorExecutor">32</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> -->
????</system>
????<user name="test"><!--?????-->
????<property name="password">test</property><!--????-->
????<!--?????????schema.xml?????schema?????????????????????????????mycat?????????????????ó????????????????????-->
????<property name="schemas">TESTDB</property>
????</user>
????<user name="user">
????<property name="password">user</property>
????<property name="schemas">TESTDB</property>
????<property name="readOnly">true</property>
????</user>
????<!--
????<quarantine>
????<whitehost>
????<host host="127.0.0.1" user="mycat"/>
????<host host="127.0.0.2" user="mycat"/>
????</whitehost>
????<blacklist check="false"></blacklist>
????</quarantine>
????-->
????</mycat:server>
????rule.xml???????
????<?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:rule SYSTEM "rule.dtd">
????<mycat:rule xmlns:mycat="http://org.opencloudb/">
????<tableRule name="rule1">
????<rule>
????<columns>id</columns>
????<algorithm>func1</algorithm>
????</rule>
????</tableRule>
????<tableRule name="rule2">
????<rule>
????<columns>user_id</columns>
????<algorithm>func1</algorithm>
????</rule>
????</tableRule>
????<tableRule name="sharding-by-intfile">
????<rule>
????<columns>sharding_id</columns>
????<algorithm>hash-int</algorithm>
????</rule>
????</tableRule>
????<tableRule name="auto-sharding-long">
????<rule>
????<columns>id</columns>
????<algorithm>rang-long</algorithm>
????</rule>
????</tableRule>
????<tableRule name="mod-long">
????<rule>
????<columns>id</columns>
????<algorithm>mod-long</algorithm>
????</rule>
????</tableRule>
????<tableRule name="sharding-by-murmur">
????<rule>
????<columns>id</columns>
????<algorithm>murmur</algorithm>
????</rule>
????</tableRule>
????<tableRule name="sharding-by-month">
????<rule>
????<columns>create_date</columns>
????<algorithm>partbymonth</algorithm>
????</rule>
????</tableRule>
????<tableRule name="latest-month-calldate">
????<rule>
????<columns>calldate</columns>
????<algorithm>latestMonth</algorithm>
????</rule>
????</tableRule>
????<tableRule name="auto-sharding-rang-mod">
????<rule>
????<columns>id</columns>
????<algorithm>rang-mod</algorithm>
????</rule>
????</tableRule>
????<tableRule name="jch">
????<rule>
????<columns>id</columns>
????<algorithm>jump-consistent-hash</algorithm>
????</rule>
????</tableRule>
????<function name="murmur"
????class="org.opencloudb.route.function.PartitionByMurmurHash">
????<property name="seed">0</property><!-- ?????0 -->
????<property name="count">2</property><!-- ?????????????????????????????????????? -->
????<property name="virtualBucketTimes">160</property><!-- ??????????????????????????????????160???????????????????????????160?? -->
????<!-- <property name="weightMapFile">weightMapFile</property> ?????????????????????????1????properties?????????д?????0?????count-1?????????????????key??????????????????????????????????????????1???? -->