mutliple payara on single host

581 views
Skip to first unread message

Korbinian

unread,
Mar 3, 2017, 7:52:55 AM3/3/17
to Payara Forum
Hi,

is there anything to care for when one would like to deploy 2 to 4 instances of payara on a single host?

e.g.:
/payara/instance1
/payara/instance2
/payara/instance3
/payara/instance4

I know that with wildfly this is as easy as changing a single port, but for payara I'm not sure. I plan to do it so applications can be seperated a bit more, so 1 app per payara instance (so I can have different JVM/ JDK running);

Would you advise in this scenario the usage of a domain cluster or 4 completely independent payaras?


Ondrej Mihályi

unread,
Mar 3, 2017, 9:12:13 AM3/3/17
to Payara Forum
Hi,

Creating multiple instances on localhost is very easy. 
It is enough to create multiple standalone instances. You can set all instances to refer the same configuration, while port numbers are externalized as system properties,  each instance is automatically assigned a different port, without affecting the common configuration. You can redefine their ports by editing system properties for each instance separately, but if you don't care, you can just use the generated ports. 

I recommend following this blog post Creating a Simple Cluster with Payara Server, which describes how to create multiple instances based on the same configuration. The blog post further guides you to setting up Hazelcast and distributed memory among the instances, but this is not necessary. However, you may want to turn Hazelcast on later, so that you may share memory among your applications via JCache.

Alternatively, you may consider using Payara Micro to run multiple applications on the same server. It is a server packaged as an executable JAR, so that you may easily run your applications just by something like:  

java -jar payara-micro.jar --deploy application.war --port 8081

It provides Java EE Web Profile and some other API (JBatch, Concurrency, JCache, ...). All instances automatically cluster together - if you don't need it, just add argument option --noCluster to turn clustering off.

Ondrej
Reply all
Reply to author
Forward
0 new messages