Payara Micro instances can join a cluster automatically. They could also join the Domain Data Grid as well as standalone Payara Server instances. In this blog, I explain how to join Payara Micro instances to the Data Grid in the Admin Console.
First, we need to run the Payara Server Domain Administration Server (DAS) before joining Payara Micro instances. In this case, we assume that DAS is on dashost.
$ ./asadmin start-domain
The Hazelcast version of all instances in Data Grid must be same. If it is different, Hazelcast denies joining the instances to the cluster.
To avoid incompatibility issues, we should also use the same version of Payara Server and Payara Micro, but it's not required.
Join a Payara Micro Instance to Data Grid
To join a Payara Micro instance to Data Grid, run Payara Micro with “--clustermode” option as follows:
$ java -jar payara-micro-5.193.1.jar --clustermode domain:dashost:4900
In default, “--clustermode” option is set as “multicast” for joining with a Payara Micro cluster automatically. We need to set the mode to “domain” and specify the DAS’s hostname and its Hazelcast listening port (4900 in default) for joining to Data Grid. Regarding the other options, we would set them (e.g. “--deploy”, “--autobindhttp”) on demand as usual.
When the Payara Micro instance is running, the status is listed on “Data Grid Instance” page in Admin Console (figure 1). We could confirm its location, listen port, deployed applications and other information.
Figure 1. List of Payara Micro Instances (on "Data Grid Instances" Page)
Note: Payara Micro Instances couldn’t join to any Deployment Groups. Their configuration is independent from other instances (either Payara Server or Payara Micro).
Send asadmin Command to Payara Micro Instances
We could send asadmin command to Payara Micro instances on Data Grid using Admin Console or asadmin command on DAS.
Deploy an Application to Payara Micro Instances
Payara Micro instance is usually started with applications and we couldn’t deploy or undeploy other applications while it’s running. However, to send asadmin command from DAS, we could deploy applications to Payara Micro instances which is still running.
To deploy an application, choose the target from the list of Payara Micro instances and send “deploy” asadmin command as follows:
Note: The application should exist on the host which the instance is running.
For example, in Figure 2, I send “deploy” command to a Payara Micro instance (“Crazy-Lionfish”) to deploy “clusterjsp-1.1.war” application, and then its result is as figure 3.
Figure 2. Send "deploy" command to Payara Micro instance
Figure 3. The result of sending "deploy" command to Payara Micro instance.
Stop Payara Micro Instances
We could shutdown Payara Micro instances to send asadmin command from DAS.
To stop the instances, choose the target from the list of Payara Micro instances and send “stop-domain” asadmin command as follows:
For example, in figure 4, I send “stop-domain” command to both Payara Micro instances (“Bright-Dogfish” and “Crazy-Lionfish”) to stop them, and then its result is as figure 5. (To refresh the page, once select another tab and select it again.)
Figure 4. Send "stop-domain" command to Payara Micro instances
Figure 5. Result of sending "stop-domain" command to Payara Micro instances
Control Payara Micro and Payara Server Instances in the Domain Data Grid with the Admin Console
We could join Payara Micro instances to the Domain Data Grid as well as standalone Payara Server instances, and control them in Admin Console to send asadmin commands.