mysql 集群 分片_mysql-sharded-cluster

# server listen addr

addr : 0.0.0.0:9696

# prometheus server listen addr

prometheus_addr : 0.0.0.0:7080

# server user and password

user_list:

-

user : kingshard

password : kingshard

# the web api server

web_addr : 0.0.0.0:9797

#HTTP Basic Auth

web_user : admin

web_password : admin

# if set log_path, the sql log will write into log_path/sql.log,the system log

# will write into log_path/sys.log

#log_path : /Users/flike/log

# log level[debug|info|warn|error],default error

log_level : debug

# if set log_sql(on|off) off,the sql log will not output

log_sql: on

# only log the query that take more than slow_log_time ms

#slow_log_time : 100

# the path of blacklist sql file

# all these sqls in the file will been forbidden by kingshard

#blacklist_sql_file: /Users/flike/blacklist

# only allow this ip list ip to connect kingshard

# support ip and ip segment

#allow_ips : 127.0.0.1,192.168.15.0/24

# the charset of kingshard, if you don't set this item

# the default charset of kingshard is utf8.

#proxy_charset: gbk

# node is an agenda for real remote mysql server.

nodes :

-

name : node1

# default max conns for mysql server

max_conns_limit : 32

# all mysql in a node must have the same user and password

user : root

password : 123456

# master0 represents a real mysql master0 server

master : 127.0.0.1:3306

# slave0 represents a real mysql salve server,and the number after '@' is

# read load weight of this slave0.

slave : 127.0.0.1:3307

down_after_noalive : 32

-

name : node2

# default max conns for mysql server

max_conns_limit : 32

# all mysql in a node must have the same user and password

user : root

password : 123456

# master0 represents a real mysql master0 server

master : 127.0.0.1:3316

# slave0 represents a real mysql salve server

slave : 127.0.0.1:3317

# down mysql after N seconds noalive

# 0 will no down

down_after_noalive: 32

# schema defines sharding rules, the db is the sharding table database.

schema_list :

-

user: kingshard

nodes: [node1,node2]

default: node1

shard:

-

# 数据库

db : test

# 虚拟表

table: userinfo

# 用来分片的字段

key: id

# 两个主从复制集群

nodes: [node1, node2]

# hash 分片

type: hash

# 每个分片的表个数,通过 表名+ _ + 4位数字组成,userinfo_0000

locations: [4,4]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值