Mycat distributed database architecture solution -- detailed explanation of Server.xml

Echo editor, welcome to reprint, reprint please state the source of the article. Welcome to add echo wechat (wechat: t2421499075) for communication and learning Never lose in a hundred battles, never claim to win, never lose in a hundred defeats, and strive to move forward. ——This is really powerful!!!

This file is a system configuration information file containing MYCAT. The corresponding original code is SystemConfig.java. We will explain this file in detail. This file is in our installation package, / mycat/conf (this article is based on "MYCAT distributed database architecture solution -- Linux Installation and running MYCAT"). You can understand the directory structure after installation. If you want to compare the detailed configuration file, you can also directly download the MYCAT source code from github at the download address: https://github.com/MyCATApache/Mycat-Server

<?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/">
    <!-- Mycat There are two important labels in user,system -->
    <!-- system Tags are related to system configuration -->
    <system>
        <!-- When you configure this property, you must ensure that mycat Character set and mysql The character set of is consistent.
        If you need to configure a special character set, such as: utf8mb4,Can be in index_to_charset.properties Configuration in, configuration format
        For " ID=Character set ",For example: "224=utf8mb4"-->
        <property name="charset">utf8</property>
        <!-- 1 To turn on real-time statistics, 0 to turn off -->
        <property name="useSqlStat">0</property>
        <!-- 0 For password login, 1 for no password login ,The default value is 0. If it is set to 1, you need to specify a default account-->
        <property name="nonePasswordLogin">0</property>
        <property name="useHandshakeV10">1</property>
        <!-- 1 To enable full overtime consistency detection, 0 to close -->
        <property name="useGlobleTableCheck">0</property>
        <!-- SQL Execution timeout unit:second-->
        <property name="sqlExecuteTimeout">300</property>
        <!-- Designated use Mycat The type of global sequence 0 is the local file mode, 1 is the database mode, 2 is the time stamp sequence mode, and 3 is the distributed mode ZK ID Generator, 4 for zk Increase progressively id Generation. -->
        <property name="sequnceHandlerType">5</property>
        <!-- Must have MYCATSEQ_perhaps mycatseq_Enter the sequence matching process Note MYCATSEQ_With spaces -->
        <property name="sequnceHandlerPattern">(?:(\s*next\s+value\s+for\s*MYCATSEQ_(\w+))(,|\)|\s)*)+</property>
        <!-- When there is an associated query in a subquery,Check whether there are fragment fields in the associated fields .default false -->
        <property name="subqueryRelationshipCheck">false</property>
        <property name="sequenceHanlderClass">io.mycat.route.sequence.handler.HttpIncrSequenceHandler</property>
        <!-- Default is type 0: DirectByteBufferPool | type 1 ByteBufferArena | type 2 NettyBufferPool -->
        <property name="processorBufferPoolType">0</property>
        <!-- Distributed transaction switch, 0 for unfiltered distributed transactions, 1 for filtered distributed transactions (if only global tables are involved in distributed transactions, then no filtering), 2 for unfiltered distributed transactions,But log distributed transactions-->
        <property name="handleDistributedTransactions">0</property>
        <!-- off heap for merge/order/group/limit      1 On 0 off -->
        <property name="useOffHeapForMerge">0</property>
        <!-- Unit is m -->
        <property name="memoryPageSize">64k</property>
        <!-- Unit is k -->
        <property name="spillsFileBufferSize">1k</property>
        <property name="useStreamOutput">0</property>
        <!-- Unit is m -->
        <property name="systemReserveMemorySize">384m</property>
        <!--Whether to adopt zookeeper Coordinated switching  -->
        <property name="useZKSwitch">false</property>
        <!--If so true Strictly follow the isolation level,Not just select Switch connection in transaction when statement-->
        <property name="strictTxIsolation">false</property>
        <property name="useZKSwitch">true</property>
    </system>
    
    <!-- user Label is mainly used to define login Mycat Users and permissions for -->
    <!-- name="root" Define login user name -->
    <user name="root" defaultAccount="true">
        <!-- Login password defined -->
        <property name="password">123456</property>
        <property name="schemas">scott</property>
        <!-- true: read-only false: Both read and write. -->
        <property name="readOnly">true</property>
        <!-- Limit the total number of connections on the front end. If the value is 0 or not set, it means that there is no limit on the number of connections -->
        <property name="banchmark">1000</property>
        <!-- 0 Do not encrypt the password, 1 encrypt the password -->
        <property name="usingDecrypt">0</property>
    </user>
    <user name="user">
        <property name="password">user</property>
        <property name="schemas">scott</property>
        <property name="readOnly">true</property>
    </user>
</mycat:server>

Be a blogger with a bottom line

Tags: Java mycat Database github Apache

Posted on Tue, 05 Nov 2019 14:10:34 -0500 by Pro Ninja