default redis reads options

details in https://github.com/chrislusf/seaweedfs/pull/1165
This commit is contained in:
Chris Lu 2019-12-21 09:30:51 -08:00
parent fcbd04c425
commit a9b1ee18af
2 changed files with 7 additions and 2 deletions

View file

@ -136,8 +136,10 @@ addresses = [
"localhost:30006", "localhost:30006",
] ]
password = "" password = ""
readOnly = false // allows reads from slave servers or the master, but all writes still go to the master
routeByLatency = false readOnly = true
// automatically use the closest Redis server for reads
routeByLatency = true
[etcd] [etcd]
enabled = false enabled = false

View file

@ -20,6 +20,9 @@ func (store *RedisClusterStore) GetName() string {
func (store *RedisClusterStore) Initialize(configuration util.Configuration) (err error) { func (store *RedisClusterStore) Initialize(configuration util.Configuration) (err error) {
configuration.SetDefault("useReadOnly", true)
configuration.SetDefault("routeByLatency", true)
return store.initialize( return store.initialize(
configuration.GetStringSlice("addresses"), configuration.GetStringSlice("addresses"),
configuration.GetString("password"), configuration.GetString("password"),