aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weed/command/scaffold.go2
-rw-r--r--weed/filer2/redis/redis_cluster_store.go10
2 files changed, 9 insertions, 3 deletions
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go
index 6ad8effc2..eb97af91c 100644
--- a/weed/command/scaffold.go
+++ b/weed/command/scaffold.go
@@ -136,6 +136,8 @@ addresses = [
"localhost:30006",
]
password = ""
+readOnly = true
+routeByLatency = true
[etcd]
enabled = false
diff --git a/weed/filer2/redis/redis_cluster_store.go b/weed/filer2/redis/redis_cluster_store.go
index 11c315391..379b7a2db 100644
--- a/weed/filer2/redis/redis_cluster_store.go
+++ b/weed/filer2/redis/redis_cluster_store.go
@@ -22,13 +22,17 @@ func (store *RedisClusterStore) Initialize(configuration util.Configuration) (er
return store.initialize(
configuration.GetStringSlice("addresses"),
configuration.GetString("password"),
+ configuration.GetBool("useReadOnly"),
+ configuration.GetBool("routeByLatency"),
)
}
-func (store *RedisClusterStore) initialize(addresses []string, password string) (err error) {
+func (store *RedisClusterStore) initialize(addresses []string, password string, readOnly, routeByLatency bool) (err error) {
store.Client = redis.NewClusterClient(&redis.ClusterOptions{
- Addrs: addresses,
- Password: password,
+ Addrs: addresses,
+ Password: password,
+ ReadOnly: readOnly,
+ RouteByLatency: routeByLatency,
})
return
}