master
shenzhuan 2 years ago
parent 9e172267d0
commit 2844033713

@ -2,7 +2,6 @@ package common
import ( import (
"context" "context"
"fmt"
"github.com/go-redis/redis/v8" "github.com/go-redis/redis/v8"
"log" "log"
"os" "os"
@ -83,12 +82,6 @@ func GetRedisFromConsul(vip *viper.Viper) (red *redis.Client, err error) {
PoolSize: vip.GetInt("poolSize"), PoolSize: vip.GetInt("poolSize"),
MinIdleConns: vip.GetInt("minIdleConn"), MinIdleConns: vip.GetInt("minIdleConn"),
}) })
//集群
clusterClients := redis.NewClusterClient(
&redis.ClusterOptions{
Addrs: []string{"192.168.100.131:6380", "192.168.100.131:6381", "192.168.100.131:6382"},
})
fmt.Println(clusterClients)
return red, nil return red, nil
} }

Loading…
Cancel
Save