-
Notifications
You must be signed in to change notification settings - Fork 113
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
radix.NewCluster got err: NOAUTH Authentication required. #276
Comments
The cluster you are trying to connect to requires authentication, but you didn't provide any. You can try something like this to authenticate each connection in the cluster: cluster, err := radix.NewCluster(cfg.Clusters, radix.ClusterPoolFunc(func(network, addr string) (Client, error) {
return radix.NewPool(network, addr, 4, radix.PoolConnFunc(func(network, addr string) (Client, error) {
return radix.Dial(network, addr, radix.DialAuthPass(cfg.Password))
}))
}))
if err != nil {
// maybe an
// ERR This instance has cluster support disabled
return nil, err
} Or you can put the password into the addresses passed to Also looking at the code linked in the referenced issue, I'm confused about the cluster usage. The code creates a If you change the var client radix.Client
if len(cfg.Clusters) > 0 {
cluster, err := radix.NewCluster(cfg.Clusters, radix.ClusterPoolFunc(func(network, addr string) (Client, error) {
return radix.NewPool(network, addr, 4, radix.PoolConnFunc(func(network, addr string) (Client, error) {
return radix.Dial(network, addr, radix.DialAuthPass(cfg.Password))
}))
}))
if err != nil {
// maybe an
// ERR This instance has cluster support disabled
return nil, err
}
client = cluster
} else {
pool, err := radix.NewPool("", "", cfg.MaxActive, radix.PoolConnFunc(connFunc))
if err != nil {
return nil, err
}
client = pool
}
exc := &StackExchange{
pool: client,
connFunc: connFunc,
// If you are using one redis server for multiple nefos servers,
// use a different channel for each neffos server.
// Otherwise a message sent from one server to all of its own clients will go
// to all clients of all nefos servers that use the redis server.
// We could use multiple channels but overcomplicate things here.
channel: channel,
subscribers: make(map[*neffos.Conn]*subscriber),
addSubscriber: make(chan *subscriber),
delSubscriber: make(chan closeAction),
subscribe: make(chan subscribeAction),
unsubscribe: make(chan unsubscribeAction),
} There should be no difference in the behavior. Only the number of connections to the nodes should be reduced (since the cluster keeps 4 connections to each node by default, even if you only use the cluster for retrieving the topology information, plus the Also by using the |
Cool, your thinking is very clear. Thank you very much for your reply. I will sort out your use cases and try them out. |
The problem has been solved. I have reimplemented the interface according to your instructions, and everything runs normally. Thank you @nussjustin. |
I can confirm that the configuration is correct and the same configuration can connect to the cluster using go-redis.
Locate where the error occurred:
radix/cluster.go
Lines 203 to 208 in edd71cc
ref: kataras/neffos#55
The text was updated successfully, but these errors were encountered: