user3813256
user3813256

Reputation:

hazelcast client unable to connect to server

I am using hazelcast (hazelcast client and server jars on the client side and server jar on the server - both versions are the same i.e. 3.2.4). The server is running on a different box - I specified that IP address in my client. It appears that the server is running (I can see that the process is up and binding on the 5701 port). My client tries to connect to the remote IP address and port but is unable to do so and the hazlecast messages do not help much (unless I misconfigured logging). Output below:

Sep 04, 2014 8:30:45 PM com.hazelcast.core.LifecycleService
INFO: HazelcastClient[hz.client_0_dev][3.2.4] is STARTING
Sep 04, 2014 8:30:46 PM com.hazelcast.core.LifecycleService
INFO: HazelcastClient[hz.client_0_dev][3.2.4] is STARTED
Sep 04, 2014 8:30:49 PM com.hazelcast.client.spi.ClientClusterService
WARNING: Unable to get alive cluster connection, try in 0 ms later, attempt 1 of 2.
Sep 04, 2014 8:30:52 PM com.hazelcast.client.spi.ClientClusterService
WARNING: Unable to get alive cluster connection, try in 0 ms later, attempt 2 of 2.
Sep 04, 2014 8:30:55 PM com.hazelcast.client.spi.ClientClusterService

Config file section:

<network>
        <port auto-increment="true" port-count="100">5701</port>
        <outbound-ports>
            <!--
            Allowed port range when connecting to other nodes.
            0 or * means use system provided port.
            -->
            <ports>0</ports>
        </outbound-ports>
        <join>
            <multicast enabled="false">
                <multicast-group>224.2.2.3</multicast-group>
                <multicast-port>54327</multicast-port>
            </multicast>
            <tcp-ip enabled="true">
                <interface>127.0.0.1</interface>
            </tcp-ip>
            <aws enabled="false">
            </aws>
        </join>
        <interfaces enabled="false">
            <interface>10.10.1.*</interface>
        </interfaces>
        <ssl enabled="false" />
        <socket-interceptor enabled="false" />
        <symmetric-encryption enabled="false">
            <algorithm>PBEWithMD5AndDES</algorithm>
            <salt>fakesalt</salt>
            <password>fakepwd</password>
            <iteration-count>19</iteration-count>
        </symmetric-encryption>
    </network>

any help in troubleshooting would be great

Edit I was able to vlaidate network traffic between the two servers (hosting the client and server via port 5701) using iperf.

------------------------------------------------------------
Server listening on TCP port 5701
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to xxx.xxx.xxx.xxx, TCP port 5701
TCP window size:  101 KByte (default)
------------------------------------------------------------
[  3] local xxx.xxx.xxx.xxx port 40937 connected with xxx.xxx.xxx.xxx port 5701
[  5] local xxx.xxx.xxx.xxx port 5701 connected with xxx.xxx.xxx.xxx port 51788
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  3.31 GBytes  2.84 Gbits/sec
[  5]  0.0-10.0 sec  3.20 GBytes  2.75 Gbits/sec

Upvotes: 3

Views: 16911

Answers (1)

ali haider
ali haider

Reputation: 20202

Make sure you're using the hazelcast-client config file and preferably test via tcp/ip using a simple server and client.

<hazelcast-client xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-client-config-3.1.xsd"
           xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <group>
        <name>dev</name> 
        <password>dev-pass</password> 
    </group>
    <management-center enabled="false">http://localhost:8080/mancenter</management-center>
    <network>
       <cluster-members>
            <address>127.0.0.1</address>
        </cluster-members>
        <smart-routing>true</smart-routing>
        <redo-operation>true</redo-operation>
        <connection-pool-size>30</connection-pool-size>

        <port auto-increment="true" port-count="100">5701</port>
        <outbound-ports>
            <ports>0</ports>
        </outbound-ports>
        <join>
            <multicast enabled="false">
                <multicast-group>224.2.2.3</multicast-group>
                <multicast-port>54327</multicast-port>
            </multicast>
            <tcp-ip enabled="false">
                <interface>127.0.0.1</interface>
            </tcp-ip>
            <aws enabled="false">
                <access-key>my-access-key</access-key>
                <secret-key>my-secret-key</secret-key>
                <region>us-west-1</region>
                <host-header>ec2.amazonaws.com</host-header>
                <security-group-name>hazelcast-sg</security-group-name>
                <tag-key>type</tag-key>
                <tag-value>hz-nodes</tag-value>
            </aws>
        </join>
        <interfaces enabled="false">
            <interface>10.10.1.*</interface>
        </interfaces>
        <ssl enabled="false" />
        <socket-interceptor enabled="false" />
        <symmetric-encryption enabled="false">
            <algorithm>PBEWithMD5AndDES</algorithm>
            <salt>thesalt</salt>
            <password>thepass</password>
            <iteration-count>19</iteration-count>
        </symmetric-encryption>
    </network>
<!-- additional tags -->
</hazelcast-client>

Upvotes: 2

Related Questions