无法使用Wildfly 13实现会话复制

时间:2018-08-16 03:12:09

标签: session wildfly replication

我一直在尝试在域模式下的两个Wildfly服务器上实现会话复制。我遵循[1]:https://docs.jboss.org/author/display/WFLY9/WildFly+9+Cluster+Howto,因为我刚开始使用wildfly 9。然后,我在wildfly 9上遇到了Infinispan问题,因此我将环境更改为wildfly 13,现在我在Infinispan上没有问题,但是我仍然无法在两个服务器上复制会话。另外,当我在代码中特别提到启动我们配置的“ ee”通道时,默认情况下,Jgroups将启动ISPN通道。我认为这可能与它有关。任何建议,将不胜感激。谢谢。

显示Jgroups启动ISPN频道的服务器日志

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类文件

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();

0 个答案:

没有答案