From 54b835e1ae4192e785c1ae9abbeefb86ba39ad4d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 20 May 2019 09:00:30 -0700 Subject: [PATCH] filer: redis cluster add option for password fix https://github.com/chrislusf/seaweedfs/issues/971 --- weed/command/scaffold.go | 1 + weed/filer2/redis/redis_cluster_store.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go index a0908912c..e24d7b56a 100644 --- a/weed/command/scaffold.go +++ b/weed/command/scaffold.go @@ -141,6 +141,7 @@ addresses = [ "localhost:30005", "localhost:30006", ] +password = "" ` diff --git a/weed/filer2/redis/redis_cluster_store.go b/weed/filer2/redis/redis_cluster_store.go index 4f74a8a22..11c315391 100644 --- a/weed/filer2/redis/redis_cluster_store.go +++ b/weed/filer2/redis/redis_cluster_store.go @@ -21,12 +21,14 @@ func (store *RedisClusterStore) GetName() string { func (store *RedisClusterStore) Initialize(configuration util.Configuration) (err error) { return store.initialize( configuration.GetStringSlice("addresses"), + configuration.GetString("password"), ) } -func (store *RedisClusterStore) initialize(addresses []string) (err error) { +func (store *RedisClusterStore) initialize(addresses []string, password string) (err error) { store.Client = redis.NewClusterClient(&redis.ClusterOptions{ - Addrs: addresses, + Addrs: addresses, + Password: password, }) return }