2 Replies Latest reply on Aug 14, 2014 3:58 AM by rvansa

    Hotrod Server/client cluster with distributed cache question

    hsaid123

      I have four inifinispan server cluster nodes. The hotrod clients are running on each of the machines where the server resides. Each hotrod client is configured to go to a particular server. The cacheA is a distributed cache with two owners. I want to understand the following:

       

      1) If a particular key1 is saved to a particular sever1 and is replicated to server2 , and the client1 for server1 tries to get the key , does it always get from server1?

       

      2) When the client2 for which the primary server is sever2, tries to get key1, does it get from server2 or does it know to get from the primary owner server1?

       

      3) When client3 for server3 tries to get the key does it get from server1(primary owner), or does it get from server3, which then requests it from server1

       

      Thanks!

      Hammad

        • 1. Re: Hotrod Server/client cluster with distributed cache question
          prashant.thakur

          According to our understanding :

           

          Requests are sent to server using RoundRobinBalancingStrategy from clients.

          While connecting to hotrod server the complete topology is shared with the client and it contacts with the owners directly in a round robin fashion.

          • 2. Re: Hotrod Server/client cluster with distributed cache question
            rvansa

            HotRod protocol allows the clients to know the topology of the cluster: setting one server address to the hotrod client does not affect how the requests will be routed, after connection the HotRod client gets the topology info and therefore can contact any other server.

             

            There are two types of owners: primary and backup. In non-transactional mode (and you can't get transactions in client-server mode) write starting in node called originator must be forwarded to primary owner first and then primary owner replicates that to backups. Reads can be served by any owner (primary or backup).

             

            When doing a request, client always tries to contact the primary server first. If the request fails (connection timeout etc.) the client switches to the round-robin strategy mode and tries to contact any server in the cluster, eventually trying all of them. When the request arrives on a server that is not owner, it forwards the request to owners, but naturally this server has to respond to the requesting client.

             

            Also, after cluster topology changes (adding/removing nodes), the topology info may be outdated.

             

            Therefore:

            1) Not always, but usually it does.

            2) There's no notion of primary server with regards to client.

            3) Usually directly from primary owner

            1 of 1 people found this helpful