aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-12-21 09:30:51 -0800
committerChris Lu <chris.lu@gmail.com>2019-12-21 09:30:51 -0800
commita9b1ee18afdaee0806d91f253fbb35e5ffd49c76 (patch)
treedbb6532e279213ccf030a9f2a0b6f311f9a7ab42 /weed
parentfcbd04c4253927da2c16821ec1a6565b29de6a6f (diff)
downloadseaweedfs-a9b1ee18afdaee0806d91f253fbb35e5ffd49c76.tar.xz
seaweedfs-a9b1ee18afdaee0806d91f253fbb35e5ffd49c76.zip
default redis reads options
details in https://github.com/chrislusf/seaweedfs/pull/1165
Diffstat (limited to 'weed')
-rw-r--r--weed/command/scaffold.go6
-rw-r--r--weed/filer2/redis/redis_cluster_store.go3
2 files changed, 7 insertions, 2 deletions
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go
index 3ef7ab914..a76466ed6 100644
--- a/weed/command/scaffold.go
+++ b/weed/command/scaffold.go
@@ -136,8 +136,10 @@ addresses = [
"localhost:30006",
]
password = ""
-readOnly = false
-routeByLatency = false
+// allows reads from slave servers or the master, but all writes still go to the master
+readOnly = true
+// automatically use the closest Redis server for reads
+routeByLatency = true
[etcd]
enabled = false
diff --git a/weed/filer2/redis/redis_cluster_store.go b/weed/filer2/redis/redis_cluster_store.go
index 0915be219..f1ad4b35c 100644
--- a/weed/filer2/redis/redis_cluster_store.go
+++ b/weed/filer2/redis/redis_cluster_store.go
@@ -20,6 +20,9 @@ func (store *RedisClusterStore) GetName() string {
func (store *RedisClusterStore) Initialize(configuration util.Configuration) (err error) {
+ configuration.SetDefault("useReadOnly", true)
+ configuration.SetDefault("routeByLatency", true)
+
return store.initialize(
configuration.GetStringSlice("addresses"),
configuration.GetString("password"),