当前位置:网站首页>MYCAT configuration
MYCAT configuration
2022-04-23 08:53:00 【Both refined and popular tastes zyyyy】
<!--schema Used to define mycat The logical library of , surface , Fragmentation rule ,dataNode and dataHost-->
<mycat:schema xmlns:mycat="http://io.mycat/">
<schema name=" Write the database name here " checkSQLschema="false" sqlMaxLimit="100">
<!--checkSQLschema Used to check whether the database name . Query by table name , if true, The query is sql It's going to be select * from Database name . Table name ; if false, be sql by select * from Table name -->
<!--sqlMaxLimit Used to implement limit, Even if sql No definition shown limit, After setting this value ,sql The effect is equivalent to limit 100-->
<table name=" Write the table name here , It's a logical table to slice " primaryKey="id" dataNode=" To work with dataNode Of name Consistent attributes , Here, for example. dn5" subTables=" Table name _$1-100, This represents 100 Slice table , Table name + Underline + Numbers " rule=" Fragment rule name , The rule name is in rule.xml Definition , for example ysgs"/>
</schema>
<!-- Entity library related -->
<dataNode name="dn5" dataHost=" Database instance , And dataHost Of name Consistent attributes , for example localhost4" database=" Entity database name " />
<!-- Instance connection related -->
<!--balance Property represents the load balancing policy :
balance=”0”, Do not turn on the read-write separation mechanism , All read operations are sent to the currently available writeHost On .
balance=”1”, All of the readHost And stand by writeHost Participate in select Statement load balancing , To put it simply , When dual master dual slave mode (M1->S1,M2->S2, also M1 And M2 Prepare for each other ), Under normal circumstances ,M2,S1,S2 All involved select Statement load balancing .
balance=”2”, All the reading operations are random in writeHost、readhost To distribute .
balance=”3”, All read requests are randomly distributed to wiriterHost Corresponding readhost perform ,writerHost No pressure to read
-->
<!--dbDriver, Specify the connection to the back-end database Driver, The values currently available are native and JDBC. Use native Words , Because the value is binary mysql agreement , So you can use mysql and maridb. Other types of databases need to use JDBC Drive to support -->
<!--switchType,-1 Means no automatic switching ;1 The default value is , Automatic switch ;2 be based on mysql Master slave state switching ;3 Based on cluster switching -->
<dataHost name="localhost4" maxCon=" Specifies the maximum connection for each read-write instance connection pool , for example 1000" minCon=" Specifies the minimum connection for each read-write instance connection pool , for example 10" balance="0"
writeType="1" dbType=" Database type , for example mysql" dbDriver="native" switchType="1" slaveThreshold="100">
<heartbeat>select user()</heartbeat>
<writeHost host="hostM1" url=" Database connection " user=" user name " password=" password ">
</writeHost>
</dataHost>
</mycat:schema>
<!--rule.xml Configuration related -->
<tableRule name="ysgs, This corresponds to the partition rule name written above ">
<rule>
<columns> Which column name is used as the partition benchmark </columns>
<algorithm> Fragmentation rule ,murmur For consistency hash,10 See other bloggers' blogs for the rules of segmentation , Link to [https://blog.csdn.net/zxp2624161989/article/details/107230370/](https://blog.csdn.net/zxp2624161989/article/details/107230370/)</algorithm>
</rule>
</tableRule>
<function name="murmur"
class="io.mycat.route.function.PartitionByMurmurHash">
<property name="seed">0</property><!-- The default is 0 -->
<property name="count">100</property><!-- Number of database nodes to fragment , Must specify , Otherwise, it can't be divided -->
<property name="virtualBucketTimes">160</property><!-- An actual database node is mapped to so many virtual nodes , The default is 160 times , That is, the number of virtual nodes is the number of physical nodes 160 times -->
<!-- <property name="weightMapFile">weightMapFile</property> Weight of nodes , Nodes without weights are 1. With properties Format of documents , From the 0 Start to count-1 That is, the node index is key, Take node weight value as value . Ownership value must be a positive integer , Otherwise, we should 1 Instead of -->
<!-- <property name="bucketMapPath">/etc/mycat/bucketMapPath</property>
Used to observe the distribution of physical nodes and virtual nodes during the test , If this property is specified , The virtual node murmur hash The mapping of values to physical nodes is output to this file by line , No default , If you don't specify , You don't export anything -->
</function>
版权声明
本文为[Both refined and popular tastes zyyyy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230816162322.html
边栏推荐
- ONEFLOW learning notes: from functor to opexprinter
- valgrind和kcachegrind使用運行分析
- Concave hull acquisition method based on convex hull of point cloud
- Yangtao electronic STM32 Internet of things entry 30 step notes II. Cube ide download, installation, sinicization and setting
- Automatic differentiation and higher order derivative in deep learning framework
- 深度学习框架中的自动微分及高阶导数
- 错误: 找不到或无法加载主类
- Go language self-study series | golang structure as function parameter
- Brief steps to build a website / application using flash and H5
- 计算神经网络推理时间的正确方法
猜你喜欢

Star Trek's strong attack opens the dream linkage between metacosmic virtual reality

L2-024 tribe (25 points) (and check the collection)

Valgrind and kcache grind use run analysis

The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution

Bk3633 specification

L2-024 部落 (25 分)(并查集)

STM32 uses Hal library. The overall structure and function principle are introduced

Reference passing 1

在sqli-liabs学习SQL注入之旅(第十一关~第二十关)

L2-3 浪漫侧影 (25 分)
随机推荐
Harbor企业级镜像管理系统实战
On time atom joins hands with oneos live broadcast, and the oneos system tutorial is fully launched
Test your machine learning pipeline
After a circle, I sorted out this set of interview questions..
Technological innovation in government affairs in the construction of Digital Government
Whether the same binary search tree (25 points)
Yangtao electronic STM32 Internet of things introduction 30 steps notes 1. The difference between Hal library and standard library
PCTP考试经验分享
Swagger document export custom V2 / API docs interception
STM32 uses Hal library. The overall structure and function principle are introduced
bashdb下载安装
Taxable income
Initial experience of talent plan learning camp: communication + adhering to the only way to learn open source collaborative courses
Introduction to GUI programming swing
Correct method of calculating inference time of neural network
洋桃电子STM32物联网入门30步笔记三、CubeMX图形化编程、设置开发板上的IO口
xctf刷题小记
微信:获取单个标签所有人
玩转二叉树 (25 分)
洋桃电子STM32物联网入门30步笔记一、HAL库和标准库的区别