etaty / rediscala

Non-blocking, Reactive Redis driver for Scala (with Sentinel support)
Apache License 2.0
790 stars 142 forks source link

server not found: no server available #205

Open YannMoisan opened 6 years ago

YannMoisan commented 6 years ago

I'm using Redis in cluster mode.

Some write commands fail with the following error

java.lang.RuntimeException: server not found: no server available
    at redis.RedisCluster$$anonfun$send$2.apply(RedisCluster.scala:161)
    at redis.RedisCluster$$anonfun$send$2.apply(RedisCluster.scala:161)
CharlesAHunt commented 6 years ago

I also have this issue, here is my connection information:

getClusterSlots ->     Map()

info ->     # Server
redis_version:3.2.10
redis_git_sha1:0
redis_git_dirty:0
redis_build_id:0
redis_mode:cluster
os:Amazon ElastiCache
arch_bits:64
multiplexing_api:epoll
gcc_version:0.0.0
tcp_port:6379

#Clients
connected_clients:5
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

#Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

#Cluster
cluster_enabled:1

#Keyspace
db0:keys=4,expires=0,avg_ttl=0

redisServers ->     List(RedisServer(***.cache.amazonaws.com,6379,None,Some(0)))

getClusterAndConnection:     None

redisServerConnections:     Map(RedisServer(***.cache.amazonaws.com,6379,None,Some(0)) -> RedisConnection(Actor[akka://redis-system/user/RedisClientPool-$a#115
tech-sam commented 6 years ago

I have also faced the same issue , the workaround is to give actual endpoint of nodes like List(RedisHost("redis-public.cache.amazonaws.com", 6379), RedisHost("redis-public.cache.amazonaws.com", 6379) ) its with play redis but here the main issue is that if any proxy is available in between( through haproxy ) then it is not working getting same error . any suggestion will help !!!

gr1ev0us commented 5 years ago

It caused by filtering available redis host with cluster map. here

My recommendation is to use direct redis address instead of hosts.

jw-devops-n commented 5 years ago

I also have this issue, Some write commands fail with the following error java.lang.RuntimeException: server not found: no server available at redis.RedisCluster.$anonfun$send$2(RedisCluster.scala:158) at scala.Option.getOrElse(Option.scala:138) at redis.RedisCluster.send(RedisCluster.scala:158) at play.api.cache.redis.connector.RedisCommandsCluster$$anon$2.play$api$cache$redis$connector$RedisRequestTimeout$$super$send(RedisCommands.scala:106) at play.api.cache.redis.connector.RedisRequestTimeout.continue$2(RequestTimeout.scala:74) at play.api.cache.redis.connector.RedisRequestTimeout.$anonfun$send$4(RequestTimeout.scala:76) at scala.Option.fold(Option.scala:175) at play.api.cache.redis.connector.RedisRequestTimeout.send(RequestTimeout.scala:76) at play.api.cache.redis.connector.RedisRequestTimeout.send$(RequestTimeout.scala:72) at play.api.cache.redis.connector.RedisCommandsCluster$$anon$2.send(RedisCommands.scala:106)