# Aerospike Remote Server Connection Issue

**URL:** <https://discuss.aerospike.com/t/aerospike-remote-server-connection-issue/7535>\
**Category:** Java Client\
**Created:** [June 14, 2020, 8:04pm UTC](https://discuss.aerospike.com/t/aerospike-remote-server-connection-issue/7535 "2020-06-14T20:04:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandrakar](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/chandrakar/32/1453_2.png) [@chandrakar](https://discuss.aerospike.com/u/chandrakar)\
**Post date:** [June 14, 2020, 8:04pm UTC](https://discuss.aerospike.com/t/aerospike-remote-server-connection-issue/7535/1 "2020-06-14T20:04:39Z")

</div>

Hi,

I am getting an error ( `Code 11: Failed to connect to host(s): 172.xx.x.xx 3000 Error Code 11: java.net.SocketTimeoutException: connect timed out`) while trying to connect with Aerospike Cluster in Remote Server using Java Client. But I’m able to connect to the cluster’s AMC console. Is there any config issue?

My Java Client Config:-

```auto
        ClientPolicy clientPolicy = new ClientPolicy();
        
clientPolicy.failIfNotConnected = true;
clientPolicy.readPolicyDefault.timeout = 1000;
        clientPolicy.readPolicyDefault.maxRetries = 3;
        clientPolicy.writePolicyDefault.timeout = 1000;
        clientPolicy.writePolicyDefault.maxRetries = 3;

 return new AerospikeClient(clientPolicy, host, port);

```

---

<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 15, 2020, 9:06pm UTC](https://discuss.aerospike.com/t/aerospike-remote-server-connection-issue/7535/2 "2020-06-15T21:06:51Z")

</div>

Your config is fine. The host/port is not accessible from the client machine. Telnet can be used to independently confirm this issue. Try the following on your client machine.

```auto
telnet <host> 3000

```

If host/port is accessible, the following is shown:

```auto
Trying <address>...
Connected to <host>.
Escape character is '^]'.

```

If host/port is not accessible, the following is shown:

```auto
Trying <address>...
telnet: connect to address <address>: Connection refused
telnet: Unable to connect to remote host

```

---

<div class="post-metadata">

**Author:** ![chandrakar](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/chandrakar/32/1453_2.png) [@chandrakar](https://discuss.aerospike.com/u/chandrakar)\
**Post date:** [June 17, 2020, 9:33am UTC](https://discuss.aerospike.com/t/aerospike-remote-server-connection-issue/7535/3 "2020-06-17T09:33:53Z")

</div>

Hi Brian,

I checked the connection. Port is accessible from the client machine, but still getting the same issue.
