问题描述:
18年订单表分片配置:
<sharding:table-rules>
<sharding:table-rule logic-table="t_trade_order"
actual-data-nodes="axolotl_ds_ms_0.t_trade_order_20180${1..9},axolotl_ds_ms_0.t_trade_order_2018${10..12}"
table-strategy-ref="orderTableStrategy"/>
</sharding:table-rules>
19年不想在手动的修改配置文件了eg:
<sharding:table-rules>
<sharding:table-rule logic-table="t_trade_order"
actual-data-nodes="axolotl_ds_ms_0.t_trade_order_20180${1..9},axolotl_ds_ms_0.t_trade_order_2018${10..12}, axolotl_ds_ms_0.t_trade_order_20190${1..9},axolotl_ds_ms_0.t_trade_order_2019${10..12}"
table-strategy-ref="orderTableStrategy"/>
</sharding:table-rules>
</sharding:sharding-rule>
请问大神,你们是如何实现的
Apache ShardingSphere
已初步解决,接下来看下分表规则如何统一配置,就不用在2020年的时候在添加配置了。
actual-data-nodes="${actual.data.nodes}"actual.data.nodes=t_20180${1..9},t_2018${10..12},t_20190${1..9},t_2019${10..12}