Administering Deployment Groups
Deployment Groups were introduced in Payara Platform 5 as an effective replacement for clusters. Deployment groups are a complement to the Data Grid whereas the grid is responsible to managing distributed application data across multiple instances, deployment groups manage how application deployment is targeted in general.
A Deployment Group is a loose grouping of Payara Server instances that can be used as a target for deployments. Deployment Groups consist of one or more Payara Server standalone instances and each instance can belong to one or more deployment groups.
Deployment Groups can then be used to manage the lifecycle of the standalone instances in the group. All instances can be started, re-started and stopped via their corresponding deployment group.
Deployment Group Benefits
With the introduction of Deployment Groups and the Domain Data Grid, Payara Server instances are the primary resource for management: First, you create the managed servers you need running on various nodes in your environment. You can then add these instances to various deployment groups depending on your business requirements.
For example, imagine you are in a cloud environment, and you have a couple of deployment groups:
-
core-web
running your core e-commerce system -
reporting
running applications for management reporting.
With deployment groups in response to peak load it is very simple to re-purpose a reporting instance to the core-web deployment group with a single asadmin command like this:
asadmin add-instance-to-deployment-group --instance reporting-1 --deploymentgroup core-web
For another example in a cloud environment (shown below), you could have each IAAS virtual server configured to have a couple of generic Payara Server instances running on them (colored grey). Then, when you come to deploy applications, you could select a number of these instances to be in deployment group 1 (colored blue), a number in deployment group 2 (colored orange) and so on.
With the flexibility to change the distribution as time goes on. As data sharing of sessions is spread throughout the whole Payara Server domain, moving instances between deployment groups does not impact accessibility of web session data.
Managing Deployment Groups
Deployment groups can be created, modified, listed and deleted from both the Admin Console and the Asadmin CLI.
Creating a Deployment Group
Once a new deployment group is created, it will be created in an empty state, as standalone instances will have to be added later.
Using the Administration Console
To create a new deployment group using the Admin Console, follow these steps:
-
Navigate to the Deployment Groups node in the navigation tree.
-
Click on the New button and give the deployment group a unique name.
-
From this screen it is also possible to add a number of new server instances if desired:
Instances created in this screen will be created alongside a corresponding configuration object that is a copy of the default-config
object.
If you want these instances to reference an existing configuration object, it is better to create them from the Instances screen and add them to the deployment group later.
Using Asadmin commands
To create a new deployment group run the create-deployment-group
command:
asadmin create-deployment-group test
Deleting a Deployment Group
A deployment group can be deleted using both the Administration console and from the command line.
Instances that belong to a deployment group won’t be deleted when the group is deleted. |
Using the Administration Console
To delete a deployment group using the Admin Console, follow these steps:
-
Navigate to the Deployment Groups section in the side panel.
-
Select the group from corresponding table.
-
Click the Delete button.
Using asadmin commands
To delete a deployment group use the delete-deployment-group
command:
asadmin> delete-deployment-group test
Managing Deployment Group Membership
Deployment group membership can also be managed by either using the Admin console or the Asadmin CLI.
Adding an Instance
Existing standalone instances be assigned to an existing deployment group via the Admin console by following these steps:
-
Navigate to the Deployment Groups node in the navigation tree.
-
Navigate to the deployment group you want to modify.
-
Select the instance to add from the dropdown in the Instances tab.
The same result can be achieved from the command line by using the add-instance-to-deployment-group
command:
asadmin add-instance-to-deployment-group --instance testserver --deploymentgroup test2
Remember that an instance can belong to multiple deployment groups. |
Removing an Instance
If you want to remove an instance from a deployment group by using the Admin console follow these steps:
-
Navigate to the Deployment Groups node in the navigation tree.
-
Navigate to the deployment group you want to modify.
-
Select the instance and choose the Remove from the More actions drop down.
The same can be achieved using the Asadmin CLI by using the remove-instance-from-deployment-group
command:
asadmin remove-instance-from-deployment-group --instance testserver --deploymentgroup test2
Server Lifecycle Management
Deployment Groups also provide lifecycle management capabilities. You can start a deployment group and all instances currently in the group will be started. Similarly, you can stop a deployment group. In addition, Deployment Groups support a "rolling restart" which is Data Grid aware.
In a rolling restart, all instances in the group are stopped and then started again in turn, ensuring that the Data Grid has enough time to adapt and ensure no loss of data during the restart.
To do this from the Admin console, follow these steps:
-
Navigate to the Deployment Groups node in the navigation tree.
-
Navigate to the deployment group you want to manage.
-
Choose either the Start Deployment Group, Stop Deployment Group or Restart Deployment Group action.
These commands are Data Grid safe and operated in a way as to minimize the danger of data disruption. |
The same can be achieved from the command line by using the following Asadmin commands:
Like this:
asadmin start-deployment-group test2
asadmin restart-deployment-group test2
asadmin stop-Deployment Group.adoc test2
Deploying Applications to a Deployment Group
To deploy an application to a deployment group when using the Admin console you select the deployment group name in the list of targets in the usual way.
This can be done both on the Applications tab of the corresponding deployment group or on the Applications section of the administration console:
To deploy an application from the command line by using the deploy
command, just specify the deployment group as a target like this:
asadmin deploy --target test2 test.war
The same targeting also works for server resources (connection pools, mail resources, JMS resources, etc.) |