# Occasional errors when using LB discovery

**URL:** <https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527>\
**Category:** Ruby Client\
**Created:** [August 2, 2019, 8:24am UTC](https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527 "2019-08-02T08:24:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![madejejej](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@madejejej](https://discuss.aerospike.com/u/madejejej)\
**Post date:** [August 2, 2019, 8:24am UTC](https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527/1 "2019-08-02T08:24:26Z")

</div>

Hi,

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

```ruby
::Aerospike::Client.new(elb_address)

```

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Albot](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/albot/32/2076_2.png) [@Albot](https://discuss.aerospike.com/u/Albot)\
**Post date:** [August 3, 2019, 2:47am UTC](https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527/2 "2019-08-03T02:47:39Z")

</div>

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](https://www.aerospike.com/products/features/smart-client/)

---

<div class="post-metadata">

**Author:** ![Jan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/jan/32/1124_2.png) [@Jan](https://discuss.aerospike.com/u/Jan)\
**Post date:** [August 3, 2019, 3:26am UTC](https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527/3 "2019-08-03T03:26:02Z")

</div>

@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)](https://discuss.aerospike.com/t/considerations-on-aerospike-client-seeding-with-aws-route53-dns-and-elb-load-balancer/5199). For the Ruby client, support was added recently in [v2.10.0](https://github.com/aerospike/aerospike-client-ruby/releases/tag/v2.10.0).

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

---

<div class="post-metadata">

**Author:** ![Albot](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/albot/32/2076_2.png) [@Albot](https://discuss.aerospike.com/u/Albot)\
**Post date:** [August 4, 2019, 1:03pm UTC](https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527/4 "2019-08-04T13:03:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![madejejej](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@madejejej](https://discuss.aerospike.com/u/madejejej)\
**Post date:** [August 5, 2019, 3:43pm UTC](https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527/5 "2019-08-05T15:43:37Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![madejejej](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@madejejej](https://discuss.aerospike.com/u/madejejej)\
**Post date:** [August 7, 2019, 12:32pm UTC](https://discuss.aerospike.com/t/occasional-errors-when-using-lb-discovery/6527/6 "2019-08-07T12:32:28Z")

</div>

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.
