1 Reply Latest reply on Aug 20, 2018 8:46 AM by Galder Zamarreño

    Unable to get session replication to work on wildfly 13 domain mode

    Michelle Alvares Newbie

      Hi, I've been trying to achieve session replication on two wildfly servers in domain mode. I followed [1]: https://docs.jboss.org/author/display/WFLY9/WildFly+9+Cluster+Howto as i was using wildfly 9 at first. I was then facing Infinispan issues on wildfly 9 so I changed the environment to wildfly 13 and now I don't have problems with Infinispan, however I am still unable to get session to replicated on both servers. Also, Jgroups by default starts the ISPN channel when i have specifically mentioned in the code to start the "ee" channel that we have configured. I think this might have something to do with it. Any suggestions would be appreciated. Thanks.

       

       

      Server logs showing Jgroups starting ISPN Channel

       

       

      2018-08-15 20:35:13,091 INFO  [biz.autoscan.persistence.HibernatePersistenceManager] (default task-1) currentSession| Opening new session Wed Aug 15 20:35:13 SGT 2018

      2018-08-15 20:35:13,109 INFO  [stdout] (default task-1) Hibernate: select distinct userinfo0_.USER_INFO_ID as USER1_84_, userinfo0_.COMPANY_ID as COMPANY2_84_, userinfo0_.USER_ID as USER3_84_, userinfo0_.USER_NAME as USER4_84_, userinfo0_.TITLE as TITLE84_, userinfo0_.PASSWORD as PASSWORD84_, userinfo0_.STATUS as STATUS84_, userinfo0_.EMAIL_ADDRESS as EMAIL8_84_, userinfo0_.MOBILE_NO as MOBILE9_84_, userinfo0_.BLOCK_ID as BLOCK10_84_, userinfo0_.CONTACT_NO as CONTACT11_84_, userinfo0_.PASSWORD_EXPIRY_DATE as PASSWORD12_84_, userinfo0_.DEPARTMENT as DEPARTMENT84_, userinfo0_.SECTION as SECTION84_, userinfo0_.CREATED_BY as CREATED15_84_, userinfo0_.CREATED_DATE as CREATED16_84_, userinfo0_.UPDATED_BY as UPDATED17_84_, userinfo0_.UPDATED_DATE as UPDATED18_84_, userinfo0_.NO_OF_ATTEMPTS as NO19_84_, userinfo0_.MANAGER_ID as MANAGER20_84_ from ilsee.USER_INFO userinfo0_ where upper(userinfo0_.USER_ID)=upper('t1check')

      2018-08-15 20:35:13,120 INFO  [stdout] (default task-1) Hibernate: select distinct companyset0_.COMPANY_ID as COMPANY1_102_, companyset0_.SESSION_TIMEOUT_PERIOD_MINS as SESSION2_102_, companyset0_.NUM_PASSWORD_RETRY as NUM3_102_, companyset0_.NUM_DAYS_PASSWD_VALID as NUM4_102_, companyset0_.NUM_PREV_PASSWORD_TO_KEEP as NUM5_102_, companyset0_.MIN_USER_ID_LENGTH as MIN6_102_, companyset0_.MIN_PASSWORD_LENGTH as MIN7_102_, companyset0_.NUM_UPPER_CASE_CHAR_IN_PASSWD as NUM8_102_, companyset0_.NUM_NON_ALPHA_IN_PASSWORD as NUM9_102_, companyset0_.NUM_DIGIT_IN_PASSWORD as NUM10_102_, companyset0_.CREATED_BY as CREATED11_102_, companyset0_.CREATED_DATE as CREATED12_102_, companyset0_.UPDATED_BY as UPDATED13_102_, companyset0_.UPDATED_DATE as UPDATED14_102_, companyset0_.COMPANY_NAME as COMPANY15_102_, companyset0_.ADDRESS1 as ADDRESS16_102_, companyset0_.ADDRESS2 as ADDRESS17_102_ from ilsee.COMPANY_SETTINGS companyset0_ where companyset0_.COMPANY_ID='TPC'

      2018-08-15 20:35:13,140 INFO  [biz.autoscan.ils.admin.services.AdminService] (default task-1)  days difference between pwd exipiry date ant current date =========  84

      2018-08-15 20:35:13,140 INFO  [biz.autoscan.ils.admin.services.AdminService] (default task-1)   LOGED_IN_SUCCESSFULLY -- getNoOfAttempts =========  0

      2018-08-15 20:35:13,145 INFO  [biz.autoscan.persistence.HibernatePersistenceManager] (default task-1)

      closeSession| Closing session......Wed Aug 15 20:35:13 SGT 2018

      2018-08-15 20:35:13,146 INFO  [biz.autoscan.ils.index] (default task-1) ====END login FacadeLOGED_IN_SUCCESSFULLY

      2018-08-15 20:35:13,147 INFO  [biz.autoscan.ils.index] (default task-1) Session ID after successful login = ZBUfINYptZWyO-8rzwl276S_rd7BVPehqeKvMTjj

      2018-08-15 20:35:13,147 INFO  [biz.autoscan.ils.index] (default task-1) session username = t1check

      2018-08-15 20:35:13,177 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000078: Starting JGroups channel ISPN

      2018-08-15 20:35:13,177 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!

      2018-08-15 20:35:18,207 INFO  [org.infinispan.CLUSTER] (default task-1) ISPN000094: Received new cluster view for channel ISPN: [uatapps03-35427|0] (1) [uatapps03-35427]

      2018-08-15 20:35:18,209 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000079: Channel ISPN local address is uatapps03-35427, physical addresses are [172.24.0.67:25432]

      2018-08-15 20:35:18,366 INFO  [stdout] (default task-1)

      2018-08-15 20:35:18,367 INFO  [stdout] (default task-1) -------------------------------------------------------------------

      2018-08-15 20:35:18,367 INFO  [stdout] (default task-1) GMS: address=uatapps03-50735, cluster=ee, physical address=172.24.0.67:19759

      2018-08-15 20:35:18,367 INFO  [stdout] (default task-1) -------------------------------------------------------------------

      2018-08-15 20:35:20,396 INFO  [biz.autoscan.ils.index] (default task-1) key = 460e7b25-5c0d-424b-a8f7-deb561336f52 value = uatapps03-35427

      2018-08-15 20:35:20,397 INFO  [biz.autoscan.ils.index] (default task-1) key = 10cec3d0-caad-44d6-8d0d-f7f6f9e9f0a5 value = uatapps03-35427

      2018-08-15 20:35:20,397 INFO  [biz.autoscan.ils.index] (default task-1) key = d7a268b3-385c-4302-b91c-c131459f41ed value = uatapps03-35427

      2018-08-15 20:35:20,397 INFO  [biz.autoscan.ils.index] (default task-1) key = b058d52c-f1fb-4b33-8919-941370a7e16b value = uatapps03-35427

      2018-08-15 20:35:20,397 INFO  [biz.autoscan.ils.index] (default task-1) key = 88b97beb-759f-4cd1-82a7-fb2e28984f7e value = uatapps03-35427

      2018-08-15 20:35:20,398 INFO  [biz.autoscan.ils.index] (default task-1) key = 144905bf-f6d6-46f4-93ec-0d53fe14058b value = uatapps03-35427

      2018-08-15 20:35:20,398 INFO  [biz.autoscan.ils.index] (default task-1) key = 11ee1eb5-4d1b-42e8-9ba7-ab142abda462 value = uatapps03-35427

      2018-08-15 20:35:20,398 INFO  [biz.autoscan.ils.index] (default task-1) key = b5883cab-2cc7-4b02-bb1c-b93a6383ff47 value = uatapps03-35427

      2018-08-15 20:35:20,398 INFO  [biz.autoscan.ils.index] (default task-1) key = 094eaa58-b85b-4b79-929c-59ea95648d5c value = uatapps03-35427

      2018-08-15 20:35:20,399 INFO  [biz.autoscan.ils.index] (default task-1) key = 4fe723e5-dc6a-4cff-9d7a-842a5449a8fa value = uatapps03-35427

      2018-08-15 20:35:20,401 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = 460e7b25-5c0d-424b-a8f7-deb561336f52 Adv value = uatapps03-35427

      2018-08-15 20:35:20,401 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = 10cec3d0-caad-44d6-8d0d-f7f6f9e9f0a5 Adv value = uatapps03-35427

      2018-08-15 20:35:20,401 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = d7a268b3-385c-4302-b91c-c131459f41ed Adv value = uatapps03-35427

      2018-08-15 20:35:20,402 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = b058d52c-f1fb-4b33-8919-941370a7e16b Adv value = uatapps03-35427

      2018-08-15 20:35:20,402 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = 88b97beb-759f-4cd1-82a7-fb2e28984f7e Adv value = uatapps03-35427

      2018-08-15 20:35:20,402 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = 144905bf-f6d6-46f4-93ec-0d53fe14058b Adv value = uatapps03-35427

      2018-08-15 20:35:20,402 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = 11ee1eb5-4d1b-42e8-9ba7-ab142abda462 Adv value = uatapps03-35427

      2018-08-15 20:35:20,403 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = b5883cab-2cc7-4b02-bb1c-b93a6383ff47 Adv value = uatapps03-35427

      2018-08-15 20:35:20,403 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = 094eaa58-b85b-4b79-929c-59ea95648d5c Adv value = uatapps03-35427

      2018-08-15 20:35:20,403 INFO  [biz.autoscan.ils.index] (default task-1) Adv key = 4fe723e5-dc6a-4cff-9d7a-842a5449a8fa Adv value = uatapps03-35427

      2018-08-15 20:35:20,408 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (default task-1) ISPN000080: Disconnecting JGroups channel ISPN

       

       

       

       

      Java class file

       

       

         

      GlobalConfigurationBuilder global = GlobalConfigurationBuilder.defaultClusteredBuilder();

      // Make the default cache a distributed synchronous one

      ConfigurationBuilder builder = new ConfigurationBuilder();

      builder.clustering().cacheMode(CacheMode.REPL_SYNC);

      // Initialize the cache manager

      DefaultCacheManager cacheManager = new DefaultCacheManager(global.defaultCacheName("ilsee").build(), builder.build());

      JChannel channel = new JChannel();

      channel.connect("ee");

      // Obtain the default cache

      Cache<String, String> cache = cacheManager.getCache();

      // Store the current node address in some random keys

      for(int i=0; i < 10; i++) {

         cache.put(UUID.randomUUID().toString(), cacheManager.getNodeAddress());

      }

      // Display the current cache contents for the whole cluster

      // cache.entrySet().forEach(entry -> System.out.printf("%s = %s\n", entry.getKey(), entry.getValue()));

       

       

      cache.entrySet().forEach(entry -> logger.info("key = " + entry.getKey() + " value = " + entry.getValue()));

      // Display the current cache contents for this node

      cache.getAdvancedCache().withFlags(Flag.SKIP_REMOTE_LOOKUP)

         .entrySet().forEach(entry -> logger.info("Adv key = " + entry.getKey() + " Adv value = " + entry.getValue()));

      // Stop the cache manager and release all resources

      cacheManager.stop();