MyCat安装和基本配置
作者:互联网
安装包下载
下载地址:http://dl.mycat.org.cn/
我只这里下的是1.6Linux安装包:http://dl.mycat.org.cn/1.6.7.6/20220419132943/
安装配置
- 解压:tar -zxvf Mycat-server-1.6-RELEASE-20161028204710-linux.tar
- 修改server.xml文件,修改连接mycat时的账号密码,schemas为逻辑库的名字,这里得记一下,多余的user标签可删除
<user name="mycat"> <property name="password">123456</property> <property name="schemas">MyCatDB</property> <property name="readOnly">false</property> </user>
- 修改schema.xml文件,默认配置可修改为下面的内容,多余的配置可删除
<schema name="MyCatDB" checkSQLschema="false" sqlMaxLimit="100" dataNode="dn1"> </schema> <!-- <dataNode name="dn1$0-743" dataHost="localhost1" database="db$0-743"/> --> <dataNode name="dn1" dataHost="host1" database="szmachine" /> <dataHost name="host1" 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="A13d@32332547641~!20200831@"> <!-- can have multi read hosts--> <readHost host="hostS2" url="192.168.12.229:3306" user="root" password="A13d@32332547641~!20200831@"/> </writeHost> </dataHost>
- 启动(./mycat start) ;关闭(./mycat stop);重启(./mycat restart);控制台启动(./mycat console );
如果启动过程中出现异常:可在这里面搜索:https://www.cnblogs.com/yaohy/p/16199706.html
标签:xml,1.6,cn,安装包,配置,mycat,修改,MyCat,安装 来源: https://www.cnblogs.com/yaohy/p/16201959.html