-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't connect Redis cluster #35
Comments
I get the same error: |
Redis version: 5.0.7 I got the similar error:
source code: package main
import (
"fmt"
"github.com/chasex/redis-go-cluster"
"os"
"time"
)
func main() {
cluster, err := redis.NewCluster(
&redis.Options{
StartNodes: []string{"127.0.0.1:30001", "127.0.0.1:30002", "127.0.0.1:30003"},
ConnTimeout: 500 * time.Millisecond,
ReadTimeout: 500 * time.Millisecond,
WriteTimeout: 500 * time.Millisecond,
KeepAlive: 16,
AliveTime: 60 * time.Second,
})
if err != nil {
fmt.Println("err=", err)
os.Exit(1)
}
cluster.Do("SET", "foo", "bar")
cluster.Do("INCR", "mycount", 1)
cluster.Do("LPUSH", "mylist", "foo", "bar")
cluster.Do("HMSET", "myhash", "f1", "foo", "f2", "bar")
} redis-server cluster is running normally. > c ps -ef|grep redis
501 40677 1 0 10:38下午 ?? 0:28.61 ../../src/redis-server *:30001 [cluster]
501 40679 1 0 10:38下午 ?? 0:28.79 ../../src/redis-server *:30002 [cluster]
501 40681 1 0 10:38下午 ?? 0:28.72 ../../src/redis-server *:30003 [cluster]
501 40683 1 0 10:38下午 ?? 0:28.44 ../../src/redis-server *:30004 [cluster]
501 40685 1 0 10:38下午 ?? 0:28.47 ../../src/redis-server *:30005 [cluster]
501 40687 1 0 10:38下午 ?? 0:28.26 ../../src/redis-server *:30006 [cluster] |
this problem caused by errcode "ECONNTIMEOUT", you should close cluster conn after use cluster |
I use this code to create cluster, but it has a problem:
NewCluster: no valid node in [10.151.3.24:6379 10.151.3.24:6383 10.151.3.24:6381]
but when I use "github.com/gomodule/redigo/redis" to create Redis.conn it was worked.
this is codes:
I don't know what cause this problem. What Redis cluster need? I use Virtualmachine+Docker to create Redis cluster.What should I do to handle this problem. Please help me.Thanks
The text was updated successfully, but these errors were encountered: