|
|
|
@ -2,7 +2,6 @@ package common
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"fmt"
|
|
|
|
|
"github.com/go-redis/redis/v8"
|
|
|
|
|
"log"
|
|
|
|
|
"os"
|
|
|
|
@ -83,12 +82,6 @@ func GetRedisFromConsul(vip *viper.Viper) (red *redis.Client, err error) {
|
|
|
|
|
PoolSize: vip.GetInt("poolSize"),
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|