mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer: redis cluster add option for password
fix https://github.com/chrislusf/seaweedfs/issues/971
This commit is contained in:
parent
fbbc74abb4
commit
54b835e1ae
|
@ -141,6 +141,7 @@ addresses = [
|
||||||
"localhost:30005",
|
"localhost:30005",
|
||||||
"localhost:30006",
|
"localhost:30006",
|
||||||
]
|
]
|
||||||
|
password = ""
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,14 @@ func (store *RedisClusterStore) GetName() string {
|
||||||
func (store *RedisClusterStore) Initialize(configuration util.Configuration) (err error) {
|
func (store *RedisClusterStore) Initialize(configuration util.Configuration) (err error) {
|
||||||
return store.initialize(
|
return store.initialize(
|
||||||
configuration.GetStringSlice("addresses"),
|
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{
|
store.Client = redis.NewClusterClient(&redis.ClusterOptions{
|
||||||
Addrs: addresses,
|
Addrs: addresses,
|
||||||
|
Password: password,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue