Skip to content

Instantly share code, notes, and snippets.

@luobuda
Created May 21, 2021 05:08
Show Gist options
  • Select an option

  • Save luobuda/3d7f9cd4ca187a6e27f507f210449a2d to your computer and use it in GitHub Desktop.

Select an option

Save luobuda/3d7f9cd4ca187a6e27f507f210449a2d to your computer and use it in GitHub Desktop.
baikal-client配置文件示例
#健康检查周期, 单位:s
healthy_check_time: 10
#bns同步周期, 单位:s
bns_syn_time: 15
#配置每个物理分库的信息
#f1统一存储,包括所有db
[@service]
service_name: baikaldb # 服务名字
service_type:Mysql
#service_type:Redis
#新增配置, 1代表初始化时全部建立连接,默认为1
connect_all: 0
#若需要给sql增加注释, "$"符号会被替换成client传入的partition_key
comment_format: /*"partion_key":"$"*/
#每个connectionpool中的连接数
connection_num: 3
#每个实例最大的连接数
max_connection_per_instance:5
#以秒s为单位
read_timeout: 100
write_timeout: 100
connect_timeout: 10
username: test
password: test
charset: gbk
#分库信息配置
#分库数量
db_shard_count: 4
#分库公式
db_split_function: (($/32%2)<<3)+($>>8)
#每个分库对应一个ip,写库分为4个库,所以对应4个bns
#db00
[.@db_shard]
id:0
ip_list: 127.0.0.1:8991
#db01
[.@db_shard]
id:1
ip_list: 127.0.0.1:8991
#db02
[.@db_shard]
id:2
ip_list: 127.0.0.1:8991
#db03
[.@db_shard]
id:3
ip_list: 127.0.0.1:8991
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment