wuxibin89 / redis-go-cluster

redis cluster client implementation in Go
Apache License 2.0
488 stars 145 forks source link

not support redis 4.0 rc #15

Closed zhaohansprt closed 7 years ago

zhaohansprt commented 7 years ago

i test against the 6 nodes instance made followed by https://redis.io/topics/cluster-tutorial

and my code is
`package main

import ( "fmt" "time"

redis "github.com/chasex/redis-go-cluster"

)

func main() {

cluster, err := redis.NewCluster(
    &redis.Options{
        StartNodes: []string{
            "192.168.212.173:30001",
            "192.168.212.173:30002",
            "192.168.212.173:30003",
            "192.168.212.173:30004",
            "192.168.212.173:30005",
            "192.168.212.173:30006",
        },
        ConnTimeout:  50 * time.Millisecond,
        ReadTimeout:  50 * time.Millisecond,
        WriteTimeout: 50 * time.Millisecond,
        KeepAlive:    16,
        AliveTime:    60 * time.Second,
    })
fmt.Println("redis new ", err)
reply, err2 := cluster.Do("SET", "foo", "bar")
// reply, err2 := redis.String(cluster.Do("GET", "foo"))
// reply, err2 := redis.Int(cluster.Do("INCR", "mycount", 1))
fmt.Println("reply", reply)
fmt.Println("err2", err2)

}` And i got the results below

redis new nil reply nil err2 ECONNTIMEOUT

zhaohansprt commented 7 years ago

it is ok to Run it in the same host ! get error in different local lan host i forget to modify the create-cluster script