In a Tomcat cluster, how to share beans in an application?

This may seem like a silly or simple question, but I really have little experience working with clusters of any type, and I'm just wondering if and how there could be a particular scenario.

Say I created a cluster of Tomcat N instances, and I deployed the application App1for all N instances.

What do I need to do to have certain beans in the application - not all, but some - "split" across the cluster?

those. if I had a bean for WebsiteSettings, I would like to have some search process in which the application can request a bean and it will be provided with an instance, and any updates to the bean property / value are also available for any other machines in the cluster, i.e. WebsiteSettings.getGreeting()will return the same value on all N machines whenever it has been updated.

Do I need to set these beans up as MBeans and have App1to look for them through JMX? Will Tomcat clustering support take care of automatically replicating changes in the MBean to the entire node in the cluster?

+1
source share
2 answers

, Terracotta - ( ) , JVM, .

- Terracotta

+5

- . , .

+1

Source: https://habr.com/ru/post/1751519/


All Articles