当前位置:网站首页>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
边栏推荐
- Go language self-study series | initialization of golang structure
- Go language self-study series | golang nested structure
- Yangtao electronic STM32 Internet of things entry 30 step notes IV. engineering compilation and download
- How much inventory recording does the intelligent system of external call system of okcc call center need?
- Virtual online exhibition - Online VR exhibition hall realizes 24h immersive exhibition viewing
- Stm32f103zet6 [development of standard library functions] - Introduction to library functions
- 深度学习框架中的自动微分及高阶导数
- Go语言自学系列 | golang结构体的初始化
- Use of Arthas in JVM tools
- Summary of solid problems
猜你喜欢

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

Idea is configured to connect to the remote database mysql, or Navicat fails to connect to the remote database (solved)

Non duplicate data values of two MySQL query tables

1099 建立二叉搜索树 (30 分)

洋桃电子STM32物联网入门30步笔记二、CubeIDE下载、安装、汉化、设置

使用flask和h5搭建网站/应用的简要步骤

L2-3 romantic silhouette (25 points)

Get the absolute path of the class according to the bytecode

Consensus Token:web3.0生态流量的超级入口

LeetCode_DFS_中等_1254. 统计封闭岛屿的数目
随机推荐
Go language self-study series | golang structure as function parameter
Idea is configured to connect to the remote database mysql, or Navicat fails to connect to the remote database (solved)
Valgrind and kcache grind use run analysis
BK3633 规格书
Introduction to matlab
错误: 找不到或无法加载主类
Learn SQL injection in sqli liabs (Level 11 ~ level 20)
论文阅读《Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry》
Latex mathematical formula
Chris LATTNER, father of llvm: the golden age of compilers
Talent Plan 学习营初体验:交流+坚持 开源协作课程学习的不二路径
Correct method of calculating inference time of neural network
共享办公室,提升入驻体验
PLC point table (register address and point table definition) cracking detection scheme -- convenient for industrial Internet data acquisition
Star Trek强势来袭 开启元宇宙虚拟与现实的梦幻联动
Complete binary search tree (30 points)
Test your machine learning pipeline
Withholding agent
基于点云凸包的凹包获取方法
Illegal character in scheme name at index 0: