简体   繁体   中英

how can I sync data between multiple tomcat instances

I want to store my data in java static variables. like store autoCode in Map

private static final PassiveExpiringMap<String, String> authCodeMap = new PassiveExpiringMap<>(1000 * 60 * 60);

how can I sync data between multiple tomcat instances

You will have to use an in memory cache that runs as an external service like redis or Hazelcast to store the data. I would suggest to use Hazelcast, because you are using Java.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM