Payara Server in Production - Ops Teams Guide-1
Payara Server in Production - Ops Teams Guide-1
Introduction
Once you have developed applications on Payara Server and moved these applications into a pro-
duction environment, control will pass over to your operations teams. This guide will introduce
some features of Payara Server that you may not know about, which are especially useful for the
operations teams.
Production Configuration
Script Your Installation
Payara Server comes with a very powerful administration client called asadmin. When moving to
production, asadmin can be used to create scripts to build out Payara Server domains in a repeat-
able fashion for production, preproduction and test environment. An example asadmin script for
building a domain is available from our examples repository; A simple example to create a domain
containing a separate deployment group in a Hazelcast cluster and an application deployed to that
deployment group:
1
Payara Server in Production
Detailed guidance on a specific heap size depends on the needs of the application but some of the
guidelines below should be followed:
2
Payara Server in Production
JVM Settings can be set in Payara from the administration console within the JVM Options settings
on the server configuration. Or the configuration can be incorporated into your script for building
domains using create–jvm–options and delete–jvm–options asadmin commands:
3
Payara Server in Production
In order to use the production domain, just execute the start-domain command with the argu-
ment production:
To create a new domain based on the production domain, you can execute the following command:
To create a new default domain based on the production domain, first, delete the default domain
domain1 and then create domain1 with the production-domain template, such as:
The new domain can be then started without adding the domain name to the start-domain command:
./asadmin start-domain
4
Payara Server in Production
5
Payara Server in Production
You can also download any log file—select the Domain page, Domain Logs tab, select the instance
to download logs for and press “Collect Logs” in the top right corner to download them:
6
Payara Server in Production
You can get a thread dump from the Admin Console. Go to the server or instance you want to gener-
ate a thread dump for and press “JVM Report” in the General Information page. Then, in the new
window, select Thread dump from the “View” select box:
You can also generate a thread dump using the generate–jvm–report command:
7
Payara Server in Production
A thread dump and a lot of other diagnostic information can also be attached to a support ticket if
Payara Server is connected to the Payara Support portal:
In addition to these services, there is also a slow SQL logger which operates independently. By
simply specifying a “slow” threshold on a data source, any query made through that data source
which takes longer than the threshold will cause both the problematic query and a stacktrace to
show where the query originated from to be printed to the server.log file.
8
Payara Server in Production
The Notification Service provides the ability to disseminate notification events through various chan-
nels that are being created by other services. This service is provided with a number of configurable
notifiers, the default being a log notification mechanism alongside these other notifiers:
• HipChat
• Slack
• NewRelic
• Datadog
• SNMP
• XMPP
• JMS
• Email
• CDI Event Bus
Because other operation monitoring services depend on the Notification Service to output their
data, both the Notification Service itself, and at least one notifier, must be enabled for any data to
be recorded. If this does not happen, then the data will be discarded.
It is for this reason that the Log notifier is the default notifier and is enabled out-of-the-box.
In order to configure a service like the HealthCheck Service to send notifications to a specific notifier,
the following configuration steps are needed:
Notifiers have to be enabled both globally in the Notification Service and also for each service that
sends notifications.
9
Payara Server in Production
The argument --dynamic is optional and applies the configuration without restart the server.
10