Cluster Replication of Authenticated Sessions Still Requires Login Upon Failover












0















I am trying to configure a 2-Node Cluster using Delta Manager to Replicate Authenticated Sessions. We are using HAproxy as the load balancer configured for sticky sessions. Load balancer appends ".s1" and ".s2" to session cookie (JSESSIONID only, no data).



To test failover, I am doing the following:




  1. start up each tomcat instance in its own separate VPS

  2. in browser, launch webapp from domain name assigned to load balancer

  3. authenticate as admin via tomcat form-based authentication

  4. review logs to identify the node the load balancer is forwarding requests to

  5. interact with webapp, then shutdown tomcat instance running on node identified in step 4.

  6. review logs to confirm that failover to other node occurs

  7. continue to interact with webapp


Step 7 fails as it causes the login page to re-appear for me to re-authenticate. When I login again, the webapp starts fresh (i.e. it doesn't continue from where it left off in step 5).



I've looked at catalina.out in failover node and it shows that the "Principal [admin] is set to session" -- but the session id specified (EA02..) is different from the failover session id (C20E...) -- and I don't know if this is correct?



I've added jvmRoute to both server.xml files based on HAproxy configuration "s1" and "s2"



Any ideas on what else I should check? Does a session cookie with no data still need to be serialized?



Also, I should mention that I am seeing lots of these messages even BEFORE I launch my webapp:



FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58



From Node 2 catalina.out file:



FINE: Detected a failover with different jvmRoute - orginal route: [s1] new one: [s2] at session id [C20E9194B5FF032546C6C408E35511C9.s1]



....



Feb 08, 2019 1:10:32 PM org.apache.catalina.ha.session.JvmRouteBinderValve handleJvmRoute
FINE: Cant find session [{0}]



....



Also, I should mention that I am seeing lots of these messages when I start tomcat and BEFORE I launch my webapp:



FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58










share|improve this question



























    0















    I am trying to configure a 2-Node Cluster using Delta Manager to Replicate Authenticated Sessions. We are using HAproxy as the load balancer configured for sticky sessions. Load balancer appends ".s1" and ".s2" to session cookie (JSESSIONID only, no data).



    To test failover, I am doing the following:




    1. start up each tomcat instance in its own separate VPS

    2. in browser, launch webapp from domain name assigned to load balancer

    3. authenticate as admin via tomcat form-based authentication

    4. review logs to identify the node the load balancer is forwarding requests to

    5. interact with webapp, then shutdown tomcat instance running on node identified in step 4.

    6. review logs to confirm that failover to other node occurs

    7. continue to interact with webapp


    Step 7 fails as it causes the login page to re-appear for me to re-authenticate. When I login again, the webapp starts fresh (i.e. it doesn't continue from where it left off in step 5).



    I've looked at catalina.out in failover node and it shows that the "Principal [admin] is set to session" -- but the session id specified (EA02..) is different from the failover session id (C20E...) -- and I don't know if this is correct?



    I've added jvmRoute to both server.xml files based on HAproxy configuration "s1" and "s2"



    Any ideas on what else I should check? Does a session cookie with no data still need to be serialized?



    Also, I should mention that I am seeing lots of these messages even BEFORE I launch my webapp:



    FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58



    From Node 2 catalina.out file:



    FINE: Detected a failover with different jvmRoute - orginal route: [s1] new one: [s2] at session id [C20E9194B5FF032546C6C408E35511C9.s1]



    ....



    Feb 08, 2019 1:10:32 PM org.apache.catalina.ha.session.JvmRouteBinderValve handleJvmRoute
    FINE: Cant find session [{0}]



    ....



    Also, I should mention that I am seeing lots of these messages when I start tomcat and BEFORE I launch my webapp:



    FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58










    share|improve this question

























      0












      0








      0








      I am trying to configure a 2-Node Cluster using Delta Manager to Replicate Authenticated Sessions. We are using HAproxy as the load balancer configured for sticky sessions. Load balancer appends ".s1" and ".s2" to session cookie (JSESSIONID only, no data).



      To test failover, I am doing the following:




      1. start up each tomcat instance in its own separate VPS

      2. in browser, launch webapp from domain name assigned to load balancer

      3. authenticate as admin via tomcat form-based authentication

      4. review logs to identify the node the load balancer is forwarding requests to

      5. interact with webapp, then shutdown tomcat instance running on node identified in step 4.

      6. review logs to confirm that failover to other node occurs

      7. continue to interact with webapp


      Step 7 fails as it causes the login page to re-appear for me to re-authenticate. When I login again, the webapp starts fresh (i.e. it doesn't continue from where it left off in step 5).



      I've looked at catalina.out in failover node and it shows that the "Principal [admin] is set to session" -- but the session id specified (EA02..) is different from the failover session id (C20E...) -- and I don't know if this is correct?



      I've added jvmRoute to both server.xml files based on HAproxy configuration "s1" and "s2"



      Any ideas on what else I should check? Does a session cookie with no data still need to be serialized?



      Also, I should mention that I am seeing lots of these messages even BEFORE I launch my webapp:



      FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58



      From Node 2 catalina.out file:



      FINE: Detected a failover with different jvmRoute - orginal route: [s1] new one: [s2] at session id [C20E9194B5FF032546C6C408E35511C9.s1]



      ....



      Feb 08, 2019 1:10:32 PM org.apache.catalina.ha.session.JvmRouteBinderValve handleJvmRoute
      FINE: Cant find session [{0}]



      ....



      Also, I should mention that I am seeing lots of these messages when I start tomcat and BEFORE I launch my webapp:



      FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58










      share|improve this question














      I am trying to configure a 2-Node Cluster using Delta Manager to Replicate Authenticated Sessions. We are using HAproxy as the load balancer configured for sticky sessions. Load balancer appends ".s1" and ".s2" to session cookie (JSESSIONID only, no data).



      To test failover, I am doing the following:




      1. start up each tomcat instance in its own separate VPS

      2. in browser, launch webapp from domain name assigned to load balancer

      3. authenticate as admin via tomcat form-based authentication

      4. review logs to identify the node the load balancer is forwarding requests to

      5. interact with webapp, then shutdown tomcat instance running on node identified in step 4.

      6. review logs to confirm that failover to other node occurs

      7. continue to interact with webapp


      Step 7 fails as it causes the login page to re-appear for me to re-authenticate. When I login again, the webapp starts fresh (i.e. it doesn't continue from where it left off in step 5).



      I've looked at catalina.out in failover node and it shows that the "Principal [admin] is set to session" -- but the session id specified (EA02..) is different from the failover session id (C20E...) -- and I don't know if this is correct?



      I've added jvmRoute to both server.xml files based on HAproxy configuration "s1" and "s2"



      Any ideas on what else I should check? Does a session cookie with no data still need to be serialized?



      Also, I should mention that I am seeing lots of these messages even BEFORE I launch my webapp:



      FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58



      From Node 2 catalina.out file:



      FINE: Detected a failover with different jvmRoute - orginal route: [s1] new one: [s2] at session id [C20E9194B5FF032546C6C408E35511C9.s1]



      ....



      Feb 08, 2019 1:10:32 PM org.apache.catalina.ha.session.JvmRouteBinderValve handleJvmRoute
      FINE: Cant find session [{0}]



      ....



      Also, I should mention that I am seeing lots of these messages when I start tomcat and BEFORE I launch my webapp:



      FINE: Created a DeltaSession with Id [EBA26338D57AAD6ECD31D29264C925D9.s1] Total count=58







      authentication tomcat cluster replication haproxy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 8 at 22:55









      Nacho GanguliNacho Ganguli

      11




      11






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403702%2fcluster-replication-of-authenticated-sessions-still-requires-login-upon-failover%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403702%2fcluster-replication-of-authenticated-sessions-still-requires-login-upon-failover%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Probability when a professor distributes a quiz and homework assignment to a class of n students.

          Aardman Animations

          Are they similar matrix