Occasional errors when using LB discovery

Hi,

We’re using Aerospike Ruby client (v2.11.0) and I’m using AWS ELB address to initialize the client.

::Aerospike::Client.new(elb_address)

We’re seeing occasional errors Aerospike::Exceptions::Aerospike: Server not available

File /webapps/api/vendor/bundle/ruby/2.6.0/gems/aerospike-2.11.0/lib/aerospike/cluster.rb line 65 in connect
File /webapps/api/vendor/bundle/ruby/2.6.0/gems/aerospike-2.11.0/lib/aerospike/client.rb line 64 in connect
File /webapps/api/vendor/bundle/ruby/2.6.0/gems/aerospike-2.11.0/lib/aerospike/client.rb line 56 in initialize

For connection, we’re just using the default policies. At the moment we have just 3 nodes in the cluster.

You can’t use aerospike with a load balancer, so its probably messing up the partitioning algorithm on the client side. DNS is fine, but load balancing is not ok for Aerospike see Smart Client | Aerospike

@Albot, that’s actually not quite true any more. Most Aerospike clients do have limited support for using a load balancer for seed node discovery: Considerations on Aerospike client seeding with AWS route53 DNS and ELB (load balancer). For the Ruby client, support was added recently in v2.10.0.

@madejejej, do you see any other errors in the client logs? Esp. Seed #{seed} failed.

That’s news to me, and might make my life easier. Thanks @Jan

@Jan unfortunately I don’t see any errors. I’m running with log_level: INFO and the only thing that was logged before the error was:

I, [2019-08-05T15:32:06.841307 #3517] INFO – : Seeding the cluster. Seeds count: 1

I was looking into this issue more. Turns out that when the initial connection times out, you can also get Aerospike::Exceptions::Aerospike: Server not available. I tried increasing this timeout from the default 1 second to 5 seconds, but we’re still getting that error.