I have a problem with Spring Boot Admin: after restarting the server instance, it loses all applications and events.
This is the schema and steps: server instance that monitor application A, B and C.
How can I manage this situation? Maybe, I have to persist these information on db. But, I can't find anything useful.
Thanks
You can use Hazelcast for make apps and events persistent. Take a look at SBA documentation (clustering paragraph).
Add Hazelcast dependency in pom.xml:
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
</dependency>
Then, in application.properties:
spring.boot.admin.hazelcast.enabled=true
spring.boot.admin.hazelcast.event-store=spring-boot-admin-event-store
Instantiate a HazelcastConfig
@Bean
public Config config() {
MapConfig eventStoreMap = new MapConfig("spring-boot-admin-event-store")
.setInMemoryFormat(InMemoryFormat.OBJECT)
.setBackupCount(1)
.setEvictionPolicy(EvictionPolicy.NONE)
.setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMapMergePolicy.class.getName(), 100))
.setMapStoreConfig(new MapStoreConfig().setImplementation(new HazelcastEventImplementation()));
Config config = new Config();
config.addMapConfig(eventStoreMap);
config.setProperty("hazelcast.jmx", "true");
return config;
}
Finally, implement a MapStore< InstanceId, ArrayList > class with your preferred persistence method (in my example configuration HazelcastEventImplementation.java).