2 Replies Latest reply on Jun 29, 2017 2:30 PM by Sebastian Łaskawiec

    Infinispan Remote Cache Multiple Host add and connecting from client

    abhishek dutta gupta Newbie

      Hi,

       

      I want to set up two machines with different ip and then try to connect to from client code to connect to Remote Infinispan. I am running domain.bat file for this.I have done this:

       

      1. Inside host.xml I have modified the public interface ip to 10.129.27.76 :

       

      <interfaces>

              <interface name="management">

                  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

              </interface>

              <interface name="public">

                  <inet-address value="${jboss.bind.address:10.129.27.76}"/>

              </interface>

              <interface name="unsecure">

                  <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>

              </interface>

          </interfaces>

       

      In this ip 10.129.27.76 I have two nodes running in distributed fashion.

       

      Now from my client code I need to connect to another host whose ip is 192.128.10.1, where I can define this ip in hosts.xml and is my client code correct? This is a bit urgent,

       

      My client code looks like this:

       

      ConfigurationBuilder builder = new ConfigurationBuilder();

          

        

            builder.addServers("10.129.27.76:11222;192.128.10.1:11222").marshaller(new ProtoStreamMarshaller());

        

            cacheManager = new RemoteCacheManager(builder.build());

            //remoteCacheManager.

            //cacheManager.

           

            /*builder.addServers("192.168.0.100:11222").socketTimeout(1200000).security().authentication().enable().serverName("myhotrodserver").

            saslMechanism("DIGEST-MD5").callbackHandler(new MyCallBackHandler("myuser", "ApplicationRealm", "qwer1234!".toCharArray())).marshaller(new ProtoStreamMarshaller());

            cacheManager = new RemoteCacheManager(builder.build());*/

       

           

            addressbookCache = cacheManager.getCache(cacheName);

            if (addressbookCache == null) {

               throw new RuntimeException("Cache '" + cacheName + "' not found. Please make sure the server is properly configured");

            }

        • 1. Re: Infinispan Remote Cache Multiple Host add and connecting from client
          abhishek dutta gupta Newbie

          I am getting below error, one server has been removed from the pool

           

          Jun 29, 2017 2:28:20 PM org.infinispan.client.hotrod.configuration.ConfigurationBuilder withProperties

          WARN: Hash function version 1 is no longer supported

          Jun 29, 2017 2:28:22 PM org.infinispan.client.hotrod.impl.protocol.Codec20 readNewTopologyAndHash

          INFO: ISPN004006: /137.72.235.95:11222 sent new topology view (id=3, age=0) containing 2 addresses: [/137.72.235.95:11372, /137.72.235.95:11222]

          Jun 29, 2017 2:28:22 PM org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory updateTopologyInfo

          INFO: ISPN004014: New server added(/137.72.235.95:11372), adding to the pool.

          Jun 29, 2017 2:28:22 PM org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory updateTopologyInfo

          INFO: ISPN004016: Server not in cluster anymore(/10.129.27.76:11222), removing from the pool.

          Jun 29, 2017 2:28:22 PM org.infinispan.client.hotrod.RemoteCacheManager start

          INFO: ISPN004021: Infinispan version: 9.0.1.Final

          • 2. Re: Infinispan Remote Cache Multiple Host add and connecting from client
            Sebastian Łaskawiec Apprentice

            You could probably have a look at one of my previous responses how Hot Rod client works.

             

            Long story short, it looks like the server with IP 10.129.27.76 is not part of the cluster view. To confirm this hypothesis please look at the server logs and search for lines containing phrase "view".

             

            If you really need to connect to 10.129.27.76 (even though it's probably not part of the cluster), set the client intelligence to basic.