# Immediately Connection reset exeption

**URL:** <https://discuss.aerospike.com/t/immediately-connection-reset-exeption/7493>\
**Category:** Java Client\
**Created:** [May 31, 2020, 10:18am UTC](https://discuss.aerospike.com/t/immediately-connection-reset-exeption/7493 "2020-05-31T10:18:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gweld](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@Gweld](https://discuss.aerospike.com/u/Gweld)\
**Post date:** [May 31, 2020, 10:18am UTC](https://discuss.aerospike.com/t/immediately-connection-reset-exeption/7493/1 "2020-05-31T10:18:24Z")

</div>

Hi! I am running aerospike server on Vagrant on mac OS. On my local machine, in IJ IDEA I am using your java client to connect to my aerospile on vagrant, but immediately I got an exception with following stacktrace: Exception in thread “main” com.aerospike.client.AerospikeException$Connection: Error Code -8: Failed to connect to host(s): 127.0.0.1 3000 java.net.SocketException: Connection reset

```
at com.aerospike.client.cluster.Cluster.seedNodes(Cluster.java:508)
at com.aerospike.client.cluster.Cluster.tend(Cluster.java:401)
at com.aerospike.client.cluster.Cluster.waitTillStabilized(Cluster.java:356)
at com.aerospike.client.cluster.Cluster.initTendThread(Cluster.java:262)
at com.aerospike.client.cluster.Cluster.<init>(Cluster.java:219)
at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:232)
at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:173)
at aerospike.AerospikeTest.main(AerospikeTest.java:11)

```

FAILURE: Build failed with an exception.

That’s how I create client: AerospikeClient client = new AerospikeClient(“127.0.0.1”, 3000);  
when I run command “nc -z -v -w5 127.0.0.1 3000” in my terminal I got successful response: “Connection to 127.0.0.1 port 3000 [tcp/hbci] succeeded!”

Any ideas what could be the cause of that exception?

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [June 1, 2020, 7:07pm UTC](https://discuss.aerospike.com/t/immediately-connection-reset-exeption/7493/2 "2020-06-01T19:07:33Z")

</div>

Your vagrant OS is listening on a different IP address. Use “ifconfig” to determine IP address on your vagrant OS.

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [June 2, 2020, 12:28am UTC](https://discuss.aerospike.com/t/immediately-connection-reset-exeption/7493/3 "2020-06-02T00:28:33Z")

</div>

Typically, it would be: 172.28.128.3

---

<div class="post-metadata">

**Author:** ![Gweld](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@Gweld](https://discuss.aerospike.com/u/Gweld)\
**Post date:** [June 2, 2020, 9:08pm UTC](https://discuss.aerospike.com/t/immediately-connection-reset-exeption/7493/4 "2020-06-02T21:08:39Z")

</div>

> [@pgupta](#):
>
> 172.28.128.3

Works, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [June 8, 2020, 9:08pm UTC](https://discuss.aerospike.com/t/immediately-connection-reset-exeption/7493/5 "2020-06-08T21:08:43Z")

</div>

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.
