作为分布式数据库中间插件,mycat入门配置很简单(我感觉是这样,除了遇到了坑~~)先放几个学习的时候看到的博客,先留着。
官网:The domain name Mycat.io is for sale
mycat下载地址:http://dl.mycat.io/
mycat简介:【MyCat】分库分表_王如霜的博客-CSDN博客
mycat schema.xml详解:myCat schema.xml详解_糖糖_的博客-CSDN博客_mycat schema.xml
mycat最主要配置文件有三个,server.xml、schema.xml、与rule.xml。其中server.xml:是Mycat服务器参数调整和用户授权的配置文件。schema.xml:是逻辑库定义和表以及分片定义的配置文件。rule.xml: 是分片规则的配置文件,分片规则的具体一些参数信息单独存放为文件。
server.xml配置,需要修改的有:登陆的账户密码、逻辑数据库。此处设置的登陆账户名密码是root / xichuan123456,逻辑数据库是db_xichuan。mycat默认的服务端口是8066,默认的管理端口是9066。
<?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://io.mycat/">
<system>
<property name="nonePasswordLogin">0</property> <!-- 0为需要密码登陆、1为不需要密码登陆 ,默认为0,设置为1则需要指定默认账户-->
<property name="useHandshakeV10">1</property>
<property name="useSqlStat">1</property> <!-- 1为开启实时统计、0为关闭 -->
<property name="useGlobleTableCheck">1</property> <!-- 1为开启全加班一致性检测、0为关闭 -->
<property name="sequnceHandlerType">2</property>
<property name="subqueryRelationshipCheck">false</property> <!-- 子查询中存在关联查询的情况下,检查关联字段中是否有分片字段 .默认 false -->
<property name="processorBufferPoolType">0</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="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 n