How and When to Disable Domain Data Grid in Payara Server

Photo of Rudy De Busscher by Rudy De Busscher

Payara Server comes with the Domain Data Grid, a very powerful feature related to the clustering capabilities of the product. If you're deploying the application on the domain server itself and are not using any clustering options, it's possible to disable the Domain Data Grid to slightly reduce Payara Server's start up time - but should you?

The Domain Data Grid can be disabled but be aware that a few other features in Payara Server also depend on the Domain Data Grid.

How to Disable the Domain Data Grid

The Domain Data Grid, built on top of the Hazelcast project, can be disabled within Payara Server. It is not needed for most of the functionality of the Server. (What is a Domain Data Grid?)

The following asadmin command disables it without having to restart the Domain Server.

./asadmin set-hazelcast-configuration --enabled=false --dynamic=true

 

You can also disable it using the Admin Console by selecting the Data Grid item within the server-config element.

disableDomainDataGridWithin the log, you get a confirmation that the Domain Data Grid is stopped.

[2021-08-03T16:53:32.167+0200] [Payara 5.2021.4] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=385 _ThreadName=RunLevelControllerThread-1628002411946] [timeMillis: 1628002412167] [levelValue: 800] [[Shutdown Hazelcast]]

Disabled High Availability Cluster Capabilities 

Once the Domain Data Grid is down, the High Availability option will longer work as it relies on the Domain Data Grid to synchronize the HTTP session data between the different instances that are running your application.

Without this high availability option, the session information is not available somewhere else when the load balancer directs a user request to another instance that started the HTTP session. However, even when you don't have the Domain Data Grid enabled, you can achieve high availability within Payara Server by deploying your application on multiple instances within a Deployment Group when you use the Sticky session pattern, or when your application doesn't require HTTP Session replication.

The Deployment Group feature works also in the absence of the Domain Data Grid. The config can still be managed centrally for all instances of the deployment and when an application is deployed to the Deployment Group, it ends up on all instances of the Deployment Group.

No JCache or Hazelcast Support When the Domain Data Grid is Disabled

With the Domain Data Grid not running, the JCache functionality is not available. Accessing a cache as follows will not work:

@NamedCache(cacheName = "name-of-the-cache")
@Inject
private javax.cache.Cache<String, Long> examplesCache;

And accessing the Hazelcast instance will also not work when the Domain Data Grid is disabled since the JNDI entry is no longer available.

@Inject
private HazelcastInstance hazelcastInstance;

Other Functionalities Disabled 

The Domain Data Grid is used for several other features of the Payara Server and if you disable the Domain Data Grid these features will also no longer work. Before disabling the Domain Data Grid, make sure you don't need any of the following features:

The Clustered Singleton provides you with the option to define a singleton on the Deployment Group level. This makes it possible to have a 'single' instance with synchronized property values within the cluster for your entire Deployment Group.
 

The Clustered CDI event mechanism, which allows you to send POJO instances of a class to the other instances within the Deployment Group, will no longer work without the Domain Data Grid. 

The Domain Data Grid is also one of the storage options of the persistent EJB timers. The option is still shown in the Admin Console when the Domain Data Grid is disabled, but this will no longer work and results in an error when the systems tries to use it.  If you disable the Domain Data Grid, you'll need to store it in a database instead.

The Payara Monitoring Console (Payara Platform Community Edition) and the Payara InSight feature (Payara Platform Enterprise Edition) will only show information of the Domain Server itself if the Domain Data Grid is disabled. The Domain Data Grid is used to collect the information of the domain instances and thus no information is transferred to the console if it is disabled.

Only Disable Domain Data Grid if You Don't Need High Availability or Synchronisation of Data

The Domain Data Grid can be disabled without affecting most of Payara Server's functionality. The clustering functionality is still available, but you lose the high availability option. Functionality based on Hazelcast, like the JCache support, is not available when the Domain Data Grid is not running.

Also, other functionality that relies on the synchronisation of data between the Domain server and the instances like the CDI clustered Singleton, Clustered CDI event, Persistent EJB timers (except when using a database).

Before disabling the Domain Data Grid in Payara Server, you should also keep in mind the Monitoring Console (Payara Community Edition) and Payara InSight (Payara Enterprise Edition) will not work with the Domain Data Grid disabled.

Related Posts

Comments