Problem while creating a data grid with Payara

150 views
Skip to first unread message

theirman

unread,
Feb 6, 2019, 5:03:54 AM2/6/19
to Payara Forum
Hello, 

I would like to create a data grid with Payara to increase availability of my web applications. Only, I've been struggling for 4 days trying to figure out how to create a data grid under Payara. 
Note : I am a beginner on Payara and, even if I have a short experience with Glassfish3, I have never had to manage either cluster or data grid, only a standalone machine.


I created 3 machines as shown below:

docker-ps-trace.png



Each of its machines uses a domain called production. Theoretically, the thirsty_stallman machine should be my DAS and the other two, optimistic_dewdney and vigilant_hermann, should be members of the data grid. But that's not the case, and I don't know why. It seems that each of my machines behaves like DAS and waits for instances to join them:

  • thirsty_stallman (port forwarding: 4848->4848, 8080->8080, 8181->8181, 4900->4900, 5900->5900) : screenshot here

thirsty_stallman .png


  • optimistic_dewdney (port forwarding: 4848->4849, 8080->8081, 8181->8182, 4900->4901, 5900->5901) : screenshot here

optimistic_dewdney.png



  • vigilant_hermann (port forwarding: 4848->4850, 8080->8082, 8181->8183, 4900->4902, 5900->5902) : screenshot here

vigilant_hermann .png



Before asking, I read a lot of documentation including this and this but none of it has helped me to progress so far.

My questions:
  • How to create a single DAS, in a unique way?
  • How to link other servers to the DAS?
  • How to launch the data grid? manage the data grid?
  • How to deploy SOAP or REST applications in the data grid?

Any ideas ?
Thanks

HASUNUMA Kenji

unread,
Feb 24, 2019, 7:42:04 PM2/24/19
to Payara Forum
Hello,

It looks that DAS was installed on each instance, therefore there are 3 data grid on your environment.
In this case, DAS should be installed only one machine and create standalone instances on other 2 machines.

>How to create a single DAS, in a unique way?

You may install Payara Server on 3 machines. But you have to run only a DAS on thirsty_stallman.

>How to link other servers to the DAS?

1. you create SSH nodes on optimistic_dewdney and vigilant_hermann using DAS ("Nodes" in left side tree).
2. you create standalone instances on each node using DAS ("Instances" in left side tree). Usually an instance are linked to the DAS automatically when it is created and then started.
3. Set port forwarding for optimistic_dewdney and vigilant_hermann. In case of standalone instance, default HTTP and HTTPS ports are 28080 and 28181.

How to launch the data grid? manage the data grid?

When you run DAS on thirsty_stallman, data grid is launched and you manage data grid from DAS.

How to deploy SOAP or REST applications in the data grid?

You may deploy your application with targets: server (DAS), instance name (standalone instance) and/or deployment group name.

For example, you want to deploy your application to optimistic_dewdney and vigilant_hermann, you deploy it with instance name of optimistic_dewdney and vigilant_hermann that you give when to create these instances as target.

Thanks,
Kenji

2019年2月6日水曜日 19時03分54秒 UTC+9 theirman:

theirman

unread,
Mar 5, 2019, 4:03:24 AM3/5/19
to Payara Forum
Dear Kenji, 
thank you for your answer, which I will study carefully.

Do you have any idea how I can manage the DAS on these two instances? Like "asadmin start-das" and "asadmin stop-das" commands? or others ?

Ondro Mihályi

unread,
Mar 5, 2019, 5:42:57 AM3/5/19
to Payara Forum
Hi,

There should be only one DAS for whole data grid. DAS can manage all instances remotely, there's no need of DAS on each instance. In DAS, jsut modify the configuration for the instances and the DAS will remotely update the configuration of the instances. For asadmin  commands, each command has the --target argument, which should either specify the name of an instance of its configuration name, e.g. isntance-config.

With Docker, this configuration isn't straightforward and we're now exploring the best practice how to configure this. An easy solution is to run several Payara Server docker images as you did, having 3 DAS instances in the datagrid. But you have to modify the grid discovery mechanism. By default it uses domain discovery, which means that instances need to know the IP address of another DAS. For Docker, you can use either TCP discovery or even better, use DNS discovery. Here's an example post boot command file to enable the DNS discovery: https://github.com/OndrejM-demonstrations/ReactiveWay-cargotracker/blob/91f45bf5f0551559c211dc787b514a1c50441201/src/main/jib/postboot.asadmin. You should also assign docker dontainers a DNS name, which is done automatically if you start them with this docker-compose configuration: https://github.com/OndrejM-demonstrations/ReactiveWay-cargotracker-ext/blob/13_jee8_deploy_to_docker_01_simple/docker-compose/docker-compose.yml

Another option is to run only one Payara Server docker container and use a plain docker container without Payara Server and just with SSH daemon for server isntances. If you create an SSH node in DAS linked to a another docker container via SSH and create a remote instance on this node from DAS using the create-instance command. DAS will copy Payara Server installation with the isntance configuration to the linked remote docker container.

All the best,
Ondrej

theirman

unread,
Mar 5, 2019, 8:53:19 AM3/5/19
to Payara Forum
Thank you Ondrej for your answer.

If we put aside dockwork to focus on Payara, I would like to know how to start payara-server on a machine without running the DAS.

Let's say I use two physical machines called Asterix and Obelix. I install on each of them the 5.184 version of payara, configure them and start them. We agree that, as a result, on both machines there is a DAS? Now, I want Asterix to be the machine that owns the DAS and Obelix to be a simple Payara server. How do I proceed?

Another question, if only Asterix is DAS, how can Obelix take over the role of DAS if Asterix falls?

Thanks :)

PS: Sorry if I don't understand everything easily but I'm new to this field and without any real training.

Ondro Mihályi

unread,
Mar 5, 2019, 11:21:07 AM3/5/19
to theirman, Payara Forum
This guide will lead you to build a cluster with DAS and an instance on one machine and another instance on a remote machine: https://blog.payara.fish/creating-a-simple-deployment-group. As the guide explains, you start with 2 machines but you install Payara Server only on one of them. Payara Server will be installed on the other machine automatically via SSH.

After following the guide, you can start both instances from DAS via Admin Console. You can also start the local instance with the start-local-instance asadmin command. You can start the remote instance with the start-instance command with the DAS running - it will instruct DAS to start the remote instance over SSH. Or you can log into the second machine and run start-local-instance on the second machine locally. To summarize, start-local-instance doesn't require running DAS and can only be used to start instances on the local machine. The command start-instance requires running DAS and can start remote instances too.

There are other, more flexible ways how to create a cluster or datagrid with Payara Server.  But it's not well documented how to set them up. If you want an easy clustering solution, Payara Micro might be better for you. You can just start multiple instances of Payara Micro from command line (java -jar payara-micro.jar application.war) and they will connect to each other (if the network allows multicast). If multicast isn't enabled, you can use tcpip discovery, e.g. with  
java -jar payara-micro.jar --clustermode tcpip:192.168.0.104:6900,192.168.0.105:6900 (documented here: https://docs.payara.fish/documentation/payara-micro/clustering/autoclustering.html)

ut 5. 3. 2019 o 14:53 theirman <thierry...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/11eb85c6-87c0-4e2e-ad68-e978c14830fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Charlesworth

unread,
Mar 5, 2019, 10:00:10 PM3/5/19
to Payara Forum
Hi Ondro, as someone who has tried (and failed) recently to create a cluster of payara servers on docker, I think this is an important thing to be addressed so I'm glad to hear you guys are looking at it. Hopefully soon you'll be able to share the redommended payara way to acheive this. Cheers,
Martin

Rudy De Busscher

unread,
Mar 20, 2019, 11:40:44 AM3/20/19
to Payara Forum
Hi Martin,

In case you want to create a cluster of several DAS servers in a Data Grid you can add the following to your Docker Image (when you are using the Official Payara Docker Image)

RUN echo 'set-hazelcast-configuration --clusterMode=multicast --multicastGroup=224.2.2.3 --multicastPort=54327 --dynamic=true' > $POSTBOOT_COMMANDS

Then all DAS servers which are defined on the same Docker network will join together.

But as Ondrej mentioned, Payara Micro is probably a better choice.

Regards
Rudy
Reply all
Reply to author
Forward
0 new messages