diff --git a/conf/redis-shake.conf b/conf/redis-shake.conf index 8acf1a7..345af66 100644 --- a/conf/redis-shake.conf +++ b/conf/redis-shake.conf @@ -35,12 +35,12 @@ source.type = standalone # ip:port # the source address can be the following: # 1. single db address. for "standalone" type. -# 2. ${sentinel_master_name}:${master or slave}@sentinel single/cluster address, e.g., mymaster:master@127.0.0.1:26379;127.0.0.1:26380. for "sentinel" type. +# 2. ${sentinel_master_name}:${master or slave}@sentinel single/cluster address, e.g., mymaster:master@127.0.0.1:26379;127.0.0.1:26380, or @127.0.0.1:26379;127.0.0.1:26380. for "sentinel" type. # 3. cluster that has several db nodes split by semicolon(;). for "cluster" type. e.g., 10.1.1.1:20331;10.1.1.2:20441. # 4. proxy address(used in "rump" mode only). for "proxy" type. # 源redis地址。对于sentinel模式,输入格式为"master名字:拉取角色为master或者slave@sentinel的地址" source.address = 127.0.0.1:20441 -# password. +# password of db/proxy. even if type is sentinel. source.password_raw = 123456 # auth type, don't modify it source.auth_type = auth @@ -59,11 +59,11 @@ target.type = standalone # ip:port # the target address can be the following: # 1. single db address. for "standalone" type. -# 2. sentinel_master_name@sentinel single/cluster address, e.g., mymaster@127.0.0.1:26379;127.0.0.1:26380. for "sentinel" type. +# 2. ${sentinel_master_name}:${master or slave}@sentinel single/cluster address, e.g., mymaster:master@127.0.0.1:26379;127.0.0.1:26380, or @127.0.0.1:26379;127.0.0.1:26380. for "sentinel" type. # 3. cluster that has several db nodes split by semicolon(;). for "cluster" type. # 4. proxy address(used in "rump" mode only). for "proxy" type. target.address = 127.0.0.1:20551 -# password. +# password of db/proxy. even if type is sentinel. target.password_raw = # auth type, don't modify it target.auth_type = auth diff --git a/src/redis-shake/common/configure.go b/src/redis-shake/common/configure.go index 8b38f27..453e4d3 100644 --- a/src/redis-shake/common/configure.go +++ b/src/redis-shake/common/configure.go @@ -57,8 +57,9 @@ func parseAddress(tp, address, redisType string, isSource bool) error { case conf.RedisTypeSentinel: arr := strings.Split(address, AddressSplitter) if len(arr) != 2 { - return fmt.Errorf("redis type[%v] address[%v] length[%v] != 2", - conf.RedisTypeStandalone, address, len(arr)) + return fmt.Errorf("redis type[%v] address[%v] must begin with or has '%v': e.g., \"master@ip1:port1;ip2:port2\", " + + "\"@ip1:port1,ip2:port2\"", + conf.RedisTypeSentinel, address, AddressSplitter) } var masterName string