mycat app

1.rule.xml

<?xml version="1.0" encoding="UTF-8"?>

<mycat:rule xmlns:mycat=“http://io.mycat/”>

​ id

Func1

​ user_id

Func1

​ sharding_id

​ hash-int

​ id

​ rang-long

​ id

​ mod-long

​ id

​ murmur

​ id

​ crc32slot

​ create_time

​ partbymonth

Calldate

​ latestMonth

​ id

Rang-mod

​ id

​ jump-consistent-hash

​ create_date

​ sharding-by-date

​ yyyy-MM-dd

​ 2018-01-03

​ 2018-01-07

​ 1

​ <function name=“murmur”

​ class=“io.mycat.route.function.PartitionByMurmurHash”>

​ 0

​ 2

​ 160

​ <!-- /etc/mycat/bucketMapPath

​ It is used to observe the distribution of each physical node and virtual node during testing. If this attribute is specified, the mapping between the murmur hash value of the virtual node and the physical node will be output to this file by line. There is no default value. If not specified, will not output anything -->

​ <function name=“crc32slot”

​ class=“io.mycat.route.function.PartitionByCRC32PreSlot”>

​ 2

​ <function name=“hash-int”

​ class=“io.mycat.route.function.PartitionByFileMap”>

​ partition-hash-int.txt

​ <function name=“rang-long”

​ class=“io.mycat.route.function.AutoPartitionByLong”>

​ autopartition-long.txt

​ 3

​ 8

​ 128

​ <function name=“latestMonth”

​ class=“io.mycat.route.function.LatestMonthPartion”>

​ 24

​ <function name=“partbymonth”

​ class=“io.mycat.route.function.PartitionByMonth”>

​ yyyy-MM-dd

​ 2015-01-01

​ partition-range-mod.txt

​ 3

</mycat:rule>

2.schema.xml

<?xml version="1.0"?>

<mycat:schema xmlns:mycat=“http://io.mycat/”>

  <table primaryKey="id" name="code_data" dataNode="dn1,dn2,dn3,dn4,dn5" rule="sharding-by-date" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="code_data_batch_report" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="code_data_import_error" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="code_data_upload_moa" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="code_data_upload_moa_record" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="code_data_upload_record" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="create_code_bag" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="create_code_base" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="distributor" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="error_moa_code_data" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="factory" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="product" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="production_task" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="query_report" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="query_report_detail" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="query_report_security" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="query_report_security_detail" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="rdc_user" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="rdc_warehouse" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="storage_data" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="storage_data_error" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="storage_data_upload_record" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="sys_dict" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="sys_param" />

  <table primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4,dn5" name="sys_user" />      

  <table primaryKey="id" name="code_data" dataNode="lb1,lb2,lb3,lb4,lb5" rule="sharding-by-date" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="code_data_batch_report" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="code_data_import_error" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="code_data_upload_moa" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="code_data_upload_moa_record" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="code_data_upload_record" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="create_code_bag" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="create_code_base" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="distributor" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="error_moa_code_data" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="factory" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="product" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="production_task" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="query_report" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="query_report_detail" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="query_report_security" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="query_report_security_detail" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="rdc_user" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="rdc_warehouse" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="storage_data" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="storage_data_error" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="storage_data_upload_record" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="sys_dict" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="sys_param" />

  <table primaryKey="id" type="global" dataNode="lb1,lb2,lb3,lb4,lb5" name="sys_user" />

​ select 1

​ select 1

</mycat:schema>

3.server.xml

<?xml version="1.0" encoding="UTF-8"?>

<mycat:server xmlns:mycat=“http://io.mycat/”>

​ 0

​ 0

​ 2

​ <!–

​ 1

​ 32

​ -->

​ 0

​ <!–

​ 8066 9066

​ 300000 0.0.0.0

​ 4096 32 -->

​ 0

​ <!–

​ off heap for merge/order/group/limit 1 on 0 off

​ -->

​ 1

​ <!–

​ The unit is m

​ -->

1m

​ <!–

​ The unit is k

​ -->

​ 1k

​ 0

​ <!–

​ The unit is m

​ -->

​ 384m

​ true

​ <!–

​ -->

sierac1q2w3e

​ logicdb

​ <!–

			<table name="tb01" dml="0000"></table>

			<table name="tb02" dml="1111"></table>

​ -->

sierac1q2w3e

​ logiclb

</mycat:server>

Guess you like

Origin blog.csdn.net/fzt12138/article/details/101065902