Hot Rod clients establishes a connection with all servers in a JDG cluster.

Solution Unverified - Updated -

Environment

  • Red Hat JBoss Data Grid (JDG)
    • 7.x
  • Hot Rod client

Issue

  • Hotrod client connect to unlisted JDG server.
  • When hotrod client is configured to connect to let's say 2 JDG instances and , if in total 3 JDG instances are in cluster among themselves , we can see that hotrod client is as well making connection to the unlisted JDG instance. We have configured hotrod client to connect to 2 JDG instances (running on port 11222,11322) as below and have in total 3 JDG instances in cluster(running on port 11222,11322,11422)
ConfigurationBuilder builder = new ConfigurationBuilder();
            builder.addServer().host("127.0.0.1").port(11222).addServer().host("127.0.0.1").port(11322);
            remoteCMgr = new RemoteCacheManager(builder.build());

  • Upon deploying the Hotrod Application WAR in EAP (having the above configuration) and trying to access the application from EAP we can see the below logging in EAP console i.e hotrod is as well able to connect directly to JDG instances running on port 11422 along with 2 JDG instances running on port 11222 and 11322 , with all the 3 JDG instances being in cluster among themselves.
22:04:22,124 INFO  [org.infinispan.client.hotrod.impl.protocol.Codec20] (default task-1) ISPN004006: /127.0.0.1:11222 sent new topology view (id=8) containing 3 addresses: [/127.0.0.1:11222, /127.0.0.1:11322, /127.0.0.1:11422]
22:04:22,125 INFO  [org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory] (default task-1) ISPN004014: New server added(/127.0.0.1:11422), adding to the pool.

Resolution

Hot Rod connects directly to all JDG servers , The initial servers configured in the client are to initially find a JDG server. Once it connects to one, it gets the full cluster view and connects to all of the JDG instances in the cluster.

The normal use case (direct access to RHDG, no proxies) that is the initial node to connect to. It will then get the full list of cluster members and connect to them all. For most use cases there will be a minimum of 2 RHDG instances, for failover purposes. However, it could be a lot more for higher loads. Finally, there must be at least one of the initial nodes listed running and connecting to a single rhdg using multiples IP is not possible.

Currently, RHPAM uses only this property to connect to a RHDG where it sets the IP (and thus the IP restriction):

<property name="org.appformer.ext.metadata.infinispan.host" value="22.22.22.222" boot-time="true"/>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments