Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
There is not limitation to two nodes in BellaDati installation for horizontal scalability based on Payara application server. Tests with Belladati have been done to more than 4 nodes.



Summary of installation instructions


  • arranging ssh connectivity for selected user on all "multiple-node (cluster)" computers in a given computer private network

  • installing java11 environment

  • creating multiple-node (cluster) environment (nodes, instances)

  • deploying BellaDati application to multiple-node (cluster)

  • setting up parameters in Payara application server  needed to run BellaDati

  • licensing Belladati


server Environment

SSH connectivity


User "cluster" is added to server, group admin,

password authentication allowed in private network, ssh allowed in firewall


/etc/hosts table(s):

server 172.31.40.20

127.0.0.1 localhost

127.0.0.1 ip-172-31-40-20

172.31.40.20 ip-172-31-40-20.eu-central-1.compute.internal belladati-main

172.31.38.252 ip-172-31-38-252.eu-central-1.compute.internal node1


server 172.31.38.252

127.0.0.1 localhost

127.0.0.1 ip-172-31-38-252

172.31.40.20 ip-172-31-40-20.eu-central-1.compute.internal belladati-main

172.31.38.252 ip-172-31-38-252.eu-central-1.compute.internal node1


i.e. two servers are included to multiple-node (cluster) environment ; the static (private) FQDN IP are   ip-172-31-40-20.eu-central-1.compute.internal and p-172-31-38-252.eu-central-1.compute.internal

FQDN stands for Fully Qualified Domain Name          

    e.g    hostnamectl set-hostname ip-172-31-40-20.eu-central-1.compute.internal      ( FQDM for server belladati-main in private network)

Testing ssh across servers communication and java commands availability for account     cluster  (login name)   ssh -l cluster node1, ( belladati-main  or IPs or FQDNs)


Installing java11 environment


As mentioned above, BellaDati version 2.10 comes with java11 and Payara application server.

The fact is utilized in the following installation instructions:

  •     PostgreSQL database engine is installed(in this example on belladati-main server but using separate sever is recommended  );
  •     IP, port, database_name, database_user/password are known and database is visible from both servers  
  •     install BellaDati ( version with installer ) on computer with alias name belladati-main (example used  BellaDati_linux-x64_2_10_0_beweinPRjava11_80-SNAPSHOT.sh)
  •     jre environment is after installation  available  on belladati-main server, directory /usr/local/BellaDati
  •     copy jre from belladati-main to node1 server  (second server of multiple-node (cluster) environment) : scp -r jre cluster@node1:/home/cluster/
  •     modify  /etc/environment adding path to jre/bin

Run java testing commands on belladati-main server (for each of the servers)       ssh -l login name server identification 'java command'

(tick)      ssh -l cluster node1 'java -version' ;  ssh l cluster node1 'jar -help ' etc.

 (lightbulb)SSH account cluster is going to spread Payara application server environment from belladati-main server to every multiple-node server.



Sv translation
languageen

Introduction


Info
  • Base line of BellaDati versions 2.10+ is developed (architecture) on java11 and Payara application server.

( Payara 5.2021.4 https://docs.payara.fish/community/docs/5.2021.4/documentation/payara-server/README.html,

java 11.0.2 https://openjdk.org/projects/jdk/11/ )


  • BellaDati 2.10+ is scalable both vertically and horizontally.

Vertical scaling is done adding more power to machine - more CPUs, Memory, storage, network speed.

Horizontal scaling is realized by adding additional nodes to the pool of resources.

  • BellaDati 2.10+ as mentioned above operate (is deployed) on application server Payara 5+.

The application server makes possible to increase  BellaDati complex power by horizontal scaling. BellaDati application is deployed to many nodes of multiple-node environment of Payara application server.

More details see web pages of Payara.


Info
titleHorizontal Scalability

Multiple-node (Cluster) environment for several computers computers  - horizontal scalability can be created to achieve achieve  HA or other desired operation levels.

Payara server is derived from GlassFish Server Open Source Edition. To install multiple-node (cluster) solution on set of computers is similar (but not the same) as that, used for GlassFish application server clustering.

( detail description for BellaDatiGlassFish BellaDati GlassFish is in https://support.belladati.com/techdoc/Running+BellaDati+in+Cluster+-+Linux+in+Cluster+-+Linux


Note
titleWhat is node

A node, in the context of Payara Server, is a logical representation of a host where Payara Server is installed, which the Domain Administration Server (DAS) can use to locate and identify remote instances. A node must be configured for any host where an instance of Payara Server is to be created.


Note
titlemultiple-node environment

There is not limitation to two nodes in BellaDati installation for horizontal scalability based on Payara application server. Tests with deploying BellaDati application have been done to  4+ nodes.


Next manual illustrates and step by step describes  how  to realize multiple-node ( cluster) installation with two computers up to to operational status; 

Private network for nodes communication is used.


  

Note
titlemultiple-node environment
Info
titleEnvironment setting final notice
  • Now, there are at least two computers operating linux OS
  • BellaDati application is running on Payara application server on "belladati-main" computer as common non-cluster installation
  • Defined ssh user "cluster" can  communicate across private network and start java commands from belladati-main on every server
  • PostgreSQL dbs engine database is visible from both servers


Multiple-node (Cluster) environment Installation



(lightbulb)The processes described here are carried out by root on belladati-main machine.

   Payara asadmin utility subcommands are preferred ( GUI of Payara console is available too).


  • Setting account(user) cluster password

The role of the user cluster is to spread up Payara environment from belladat-main machine  to all cluster machines. To utilize the account in next commands, its password alias is created:


run command : asadmin create-password-alias clusterpassword    

insert cluster account password

run vim /home/cluster/clusterpassword     

add line:    AS_ADMIN_SSHPASSWORD=${ALIAS=clusterpassword}


(info)  asadmin list-password-aliases   shows the name, asadmin delete-password-alias  XXXXX  delete the password alias


  • Node(s) creation

             Machine belladati-main directory /usr/local/BellaDati/payara5 will be copied to the multiple-node (cluster) machine node1 to directory /home/cluster/payara5 directory of the user cluster.

             The user cluster has ssh connection to the machines. Its password information is in /home/password/clusterpassword file.


Warning
titlenadmin file

/home/cluster/payara5 directory exists on node1 computer

Before next step check/modify nadmin file permissions   on belladati-main server, directory ...payara5/glassfish/lib   ; ( chmod +x nadmin)


                

                asadmin create-node-ssh  --nodehost node1 --installdir /home/cluster/payara5 --install=true --sshuser cluster --passwordfile  /home/cluster/clusterpassword  node1 


 Node verification - testing connection to node (s)


      run command  asadmin ping-node-ssh node1

                            asadmin list-nodes-ssh    (info) ssh nodes created are listed

                            asadmin list-nodes          (info)  this command list all nodes, including original node localhost-domain1 on localhost i.e. on belladati-main

example:

root@iproot@ip-172-31-40-20:/usr/local/BellaDati/payara5/glassfish/lib# asadmin list-nodes
localhost-domain1 CONFIG localhost
node1 SSH node1
Command list-nodes executed successfully.

Modifying Path to Payara java variable:

change variable AS_JAVA in /home/cluster/payara5/glassfish/config/asenf.conf  AS_JAVA=/home/cluster/jre/

(lightbulb) reason: PATH for JAVA environment; on ssh nodes is not equal to PATH copying from belladati-main in asenv.conf file



  • Multiple-node (Cluster) formation

         The base environment/configuration for multiple-node (cluster)  itself is establishing now. The multiple-node (cluster) name will be  "belladati-cluster". 


     run command  asadmin create-cluster belladati-cluster

     (lightbulb)  New configuration is added to Payara configuration. Its name is belladati-cluster-config. Its  configuration is the same as default-config.

     (info)  helpful additional commands:   asadmin list-clusters     ;     asadmin delete-cluster belladati-cluster 


  • Creating belladati-cluster instances

       

       Cluster instance on belladati-main; its name is  "instance-local"


       run command     asadmin create-local-instance  --cluster belladati-cluster instance-local

(tick)  output example:

Rendezvoused with DAS on localhost:4848.

Port Assignments for server instance instance-local:

OSGI_SHELL_TELNET_PORT=26666

JAVA_DEBUGGER_PORT=29009

HTTP_LISTENER_PORT=28080

IIOP_SSL_LISTENER_PORT=23820

ASADMIN_LISTENER_PORT=24848

IIOP_SSL_MUTUALAUTH_PORT=23920

JMX_SYSTEM_CONNECTOR_PORT=28686

HTTP_SSL_LISTENER_PORT=28181

IIOP_LISTENER_PORT=23700

Command create-local-instance executed successfully


(info)  see /usr/local/BellaDati/payara5/glassfish    additional files hierarchy appears  nodes/localhost-domain1/...


Cluster instance on ssh node

       


run commands for node1; names for the created instances will be instance-node1

asadmin create-instance --node node1   --cluster belladati-cluster instance-node1

(tick) output example

Command _create-instance-filesystem executed successfully.

Port Assignments for server instance instance-node1:

OSGI_SHELL_TELNET_PORT=26666

JAVA_DEBUGGER_PORT=29009

HTTP_LISTENER_PORT=28080

IIOP_SSL_LISTENER_PORT=23820

ASADMIN_LISTENER_PORT=24848

IIOP_SSL_MUTUALAUTH_PORT=23920

JMX_SYSTEM_CONNECTOR_PORT=28686

HTTP_SSL_LISTENER_PORT=28181

IIOP_LISTENER_PORT=23700

The instance, instance-node1, was created on host node1

Command create-instance executed successfully.



(info) helpful commands;  for visibility:  asadmin list-instances, for deleting: asadmin delete-instance  NAME of the instance to delete


          

Setting up multiple-node (cluster)  Configuration


Info
titlebelladati-cluster configuration

Configuration file for belladati-cluster is named belladati-cluster-config. Until now, there is no information in its contents regarding resources for BellaDati in the cluster, no information about application to run in cluster. Parameters defining now (overtaking from default-config)  e.g. thread-pools, heap space for jvm etc. are not valid for running application BellaDati in cluster environment.

Next steps describe how to modify the configuration file belladati-cluster-config

  


  • Setting up application reference


       run commands:     asadmin create-application-ref   --target belladati-cluster  belladati

                                   asadmin delete-application-ref  --target server  belladati

(lightbulb) BellaDati was installed on Payaraapplication serverand its target was server; for cluster arrangement  target change  to "belladati-cluster" is needed


       (info)  to see the application references    asadmin list-application-refs  belladati-cluster   ;

           to delete belladati reference from cluster                  asadmin delete-application-ref  --target belladati-cluster belladati    

           to delete belladati reference from default server        asadmin delete-application-ref  --target server  belladati

    

  • Setting up thread pools

        Taking into account recommendation for belladati installation max-thread-pool-size will be changed.


        run command     asadmin list-threadpools belladati-cluster  to see list of threadpools;

        modifications will be done threadpools: http-thread-pool   and   thread-pool-1

       http-thread-pool:

       run command  asadmin get belladati-cluster-config.thread-pools.thread-pool.http-thread-pool.*        (info) parameters values  before setting up

            and run      asadmin set belladati-cluster-config.thread-pools.thread-pool.http-thread-pool.max-thread-pool-size=512


      thread-pool-1:

       run command  asadmin get belladati-cluster-config.thread-pools.thread-pool.thread-pool-1*        (info) parameters values  before setting up

            and run      asadmin set belladati-cluster-config.thread-pools.thread-pool.thread-pool-1.max-thread-pool-size=512



  • JVM options setting


Info
titleJVM

New BellaDati 2.10+ architecture transfer transfered  some parameters from application server (see https://support.belladati.com/techdoc/Running+BellaDati+in+Cluster+-+Linux) to jvm options. The parameters must be defined in belladati-cluster-config.



 to see all JVM options as defined before modification for belladati-cluster:

                           asadmin list-jvm-options    --target  belladati-cluster


        Dependently on machine HW specifications there are recommendation to modify so called "heap-space" for running jvm. The parameter  -Xmxnnnnnm. nnnnn is value of RAM size for jvm.

 Heap space modification

      run command to delete -Xmx value not valid for cluster:

      asadmin delete-jvm-options  --target belladati-cluster -Xmx512m               (info)  the "-Xmx512m" is default value, i.e. just 512 MB for running jvm - not enough for BellaDati operation

      run command to setup new, valid value for -Xmx:

      asadmin create-jvm-options  --target belladati-cluster  -Xmx4096m           (tick)  the "-Xmx2048m" i.e. 4096 MB for jvm  is valid for this cluster. (The value is based on given machines HW specification and usually is higher;)


Parameters for jdbc resources


asadmin create-jvm-options --target belladati-cluster -Djdbc.driverClassName=org.postgresql.Driver

asadmin create-jvm-options --target belladati-cluster -Dfile.encoding=UTF-8

asadmin create-jvm-options --target belladati-cluster -Dlogs.location=../../../../../logs

asadmin create-jvm-options --target belladati-cluster "-Djdbc.url=jdbc\:postgresql\://IPaddress where  dbs engine runs\:port/dbs_name"

asadmin create-jvm-options --target belladati-cluster -Djdbc.username=dbs_user_name

asadmin create-jvm-options --target belladati-cluster -Djdbc.password=password

asadmin create-jvm-options --target belladati-cluster -Djdbc.pool.maxActive=200

asadmin create-jvm-options --target belladati-cluster -Djdbc.pool.minIdle=8

asadmin create-jvm-options --target belladati-cluster -Djdbc.pool.maxIdle=200

asadmin create-jvm-options --target belladati-cluster -Djdbc.pool.minIdleEvictionTime=300000

asadmin create-jvm-options --target belladati-cluster -Djdbc.pool.maxWaitTime=60000


Parameters specifying cluster environment:


asadmin create-jvm-options --target belladati-cluster -Dtapestry.clustered.session=true

asadmin create-jvm-options --target belladati-cluster -Dapplication.actor.server.port=2335

asadmin create-jvm-options --target belladati-cluster -Dapplication.servers=belladati-main\:2335,node1\:2335



Info
titleCluster setup final notice

New, modified configuration for cluster is available now. Many changes occurred during the process. Payara application server needs restarting.



Run command:                                                      asadmin  restart-domain




Starting Cluster



(info)  helpful commands to check the cluster environment before starting cluster:

     asadmin list-domains ;   asadmin list-nodes ;   asadmin list-instances ;  asadmin list-application-refs belladati-cluster

     (lightbulb)  asadmin list-instances  belladati-cluster command lists all instances available for cluster belladati-cluster, namely: instance-local, instance-node1


(warning) The process of the cluster starting can take minutes. 


 run command          asadmin start-cluster  --verbose belladati-cluster      (info) one command to start all cluster nodes (instances)


or alternatively


 run commands          asadmin start-instance   NAME   (instance-local, instance-node1 etc)  

(info) command for the first instance start cluster environment with one instance; the next commands will add instances to the cluster.

This command is very illustrative with BellaDati application Monitoring cluster screen.


(lightbulb) Visibility:           asadmin list-clusters       ;         asadmin list-instances beladati-cluster


Modifying BellaDati License

  • log in to BellaDati application

Application BellaDati is operating in the cluster environment.


To log into BellaDati application

for machine   "belladati-main"  public IP and port 28080, for  "node1" public IP and port 28080

(warning)    BellaDati license screens indicate :  license is not valid 


(lightbulb)Reason:  BellaDati application cluster settings require a dedicated licence key.

   Instead of starting position with BellaDati running on machine belladati-main, there are two machines where BellaDati is deployed now. 



  • new license

     

Contact BellaDati support for obtaining a new license.

To modify license, copy all cluster Server IDs of the machines (belladati-main, node1) and send both to BellaDati support .

The new license must be implemented on the every BellaDati installation in cluster machine environment.




Updating BellaDati running in cluster environment


Who: root, Location: belladati-main server


  •  download BellaDati-xxxxx.war.zip
  •  unzip the war file and change to directory where belladati.war is located
  •  belladati.war is now available

 (lightbulb)user root will now operate with the belladati.war. This is new version of BellaDati application and is going to be redeployed as "belladati" (name of application) to Payara application server target "domain"


run   asadmin redeploy --name belladati --target domain belladati.war

run   asadmin stop-cluster belladati-cluster

run   asadmin restart-domain


run asadmin start-cluster belladati-cluster   

















...