BellaDati is not depending on the selected cluster environment, you can run it on GlassFish, Websphere or JBoss, but there are several parameters contained in application.properties (see BellaDati WAR Configuration) which need to be changed in order to run BellaDati in the cluster):
application.actor.server.port=2335 tapestry.clustered-sessions=true application.servers=172.31.38.23:2335,172.31.13.180:2335,172.31.45.195:2335,172.31.2.41:2335
The example above defines parameters for 4 machines in a cluster. The server's IPs are 172.31.38.23, 172.31.13.180, 172.31.45.195 and 172.31.2.41.
Cluster overview page
BellaDati administrators have access to cluster overview page , which provides useful information regarding each of clustered servers.
Glassfish cluster on Linux
Installing cluster node prerequisites:
- Each of servers for cluster installation satisfies system requirements as described in https://support.belladati.com/techdoc/System+Requirements
- BellaDati must be installed on one server machine (next called "belladati-main" ) ; for detail information see https://support.belladati.com/techdoc/Installation+and+Update
- BellaDati database is running. Connectivity to the database is allowed from each off clustered servers. The Database Engine is not required to run on one of cluster dedicated servers.
- The servers (main server with BellaDati installation and Node servers for installing instance node) must have a valid hostname and must be visible to each other
- The resolvable hostname must be contained in /etc/hostname and /etc/hosts must contain all server names on all servers. Using of FQDN (fully qualified domain name) is must for most of Operating Systems.
- JAVA and JAR (part of Java distribution) must be installed on the servers to be used as instance node
- One SSH user with password or certificate authentication is available on each of the servers. The user is allowed to connect and transport data.
- Traffic is allowed between servers on many ports; it is recommended to use all traffic allowed - internal network
- Editing application.properties as defined above is must - the file is located in BellaDati installation subdirectory .../domain/domain1/applications/belladati/WEB-INF/classes/conf/application.properties on belladati-main server
Installation process example & description
This example shows an installation on 4 VM of AWS (Amazon Web Services) cloud running Red Hat line OS CentOS-7. HW configuration for each of the machine is: 2 virtual CPUs, 4 GiB RAM memory and 20 GiB storage.
There are two networks available : private and public. Private network is used for cluster settings. All traffic in private network is allowed. Public network inbound rules allow only ssh, http and postgres port connections for defined IPs.
BellaDati version 2.9.12 is installed on server named belladati-main at the start of installation.
Database engine PostgreSQL 10.9 runs on remote VM named dbs. User belladati_dbuser can see database belladati_db from each of the four VMs. This is set up in PostgreSQL configuration files pg_hba.conf and postgresql.conf.
Additional two VMs are named node1 and node2
Server hostnames are of FQDN (fully qualified domain name) type - example : ip-172-31-38-23.eu-central-1.compute.internal; for server with private IP 172.31.38.23
Hosts tables for all servers are the same.
Open JDK Runtime server is installed; java -version , jar commands are available for all accounts. It is recommended to use the same Java version as installed during BellaDati installation.
Account "cluster" is added on servers. The home directory is /home/cluster, user is in wheel.
The whole installation process is divided into several blocks
Environment setting up
Cluster Installation
Cluster Setup & Start
Setting up BellaDati Application
Updating BellaDati running in cluster environment
Environment setting up
Root runs the bellow mentioned commands
Initial table describing working environment
servers | Private IP | Installed | Description |
---|---|---|---|
belladati-main
| 172.31.2.41 | BellaDati application (version 2.9.12) installed by installer (GlassFish AS, JAVA openjdk, etc. is included)
| Directory: /usr/local/BellaDati, Port 8080 PATH set up JAVA commands , GlassFish commands (asadmin); psql command available { PATH=/usr/local/BellaDati/jre/bin:/usr/local/Belladati/jre/jre/bin: /usr/local/BellaDati/glassfish5/bin:/usr/local/Belladati/glassfish5/glassfish/bin: /sbin:/bin:/usr/sbin:/usr/bin } PostgreSQL command: psql -h hostname -p port -U username -d dbsname is available |
node1
| 172.31.13.180 | JAVA openjdk , postgresql-client | PATH set up to JAVA commands ( java -version, jar ...) PostgreSQL command: psql -h hostname -p port -U username -d dbsname is available |
node2
| 172.31.45.195 | JAVA openjdk,postgresql-client | PATH set up to JAVA commands (java -version, jar) PostgreSQL command: psql -h hostname -p port -U username -d dbsname is available |
dbs | 172.31.38.23 | PostgreSQL (version 10): port 5432, dbs belladati_db, usr belladati_dbuser JAVA openjdk
| PATH set up to postgresql commands all commands available PATH set up to JAVA commands ( java -version, jar...)
|
Hint: Installation directory for BellaDati application on server belladati-main contains directory jre. The files in the directory and its subdirectories are enough for clustering purposes. Just copy the "jre" directory to the rest of servers, modify PATH (e.g. add shell file to /etc/profile.d/ directory). JAVA will be 100% the same for all cluster servers.
|
- Add ssh user "cluster" on each server; home directory is /home/cluster, user is in group wheel
Test ssh user "cluster" login to each of the servers ; password authentication is allowed
User cluster authentication
This installation - example utilize internal, Firewall protected network; connections from outbound are strictly restricted for define set of IP adresses; password authentication is sufficient from security point of view.
- Setting hostname (each server )
Run command : hostnamectl set-hostname Fully Qualified Domain Name
e.g hostnamectl set-hostname ip-172-31-2-41.eu-central-1.compute.internal ( FQDM for server belladati-main in private network)
Command : hostnamectl status
- Setting hosts table for every server
Run command: vim /etc/hosts Modify the file
Modified Hosts table ( /etc/hosts file content on all servers)
- Modifying PostgreSQL setting on dbs server
Run editor command vim
Setting database connectivity
Server dbs:
Modify file pg_hba.conf
add line: host all all 172.31.0.0/16 md5
Modify file postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
If you edit the files on a running system, you have to SIGHUP the server for the changes to take effect, run "pg_ctl reload",
- Testing connectivity to database
Database engine is located/running on server dbs
Run next command on every server: psql -h 172.31.38.23 -p 5432 -U belladati_dbuser -d belladati_db
Dbs connectivity
The BellaDati cluster items (application deployed on many machines) need to see/communicate database belladati_db. Database owner/user is belladati_dbuser. This is reason for establishing/allowing communication.
- Testing ssh across servers communication and java commands availability for account cluster (login name)
Run next command on belladati-main server testing every server: ssh -l login name server identification
e.g. : ssh -l cluster dbs, ssh -l cluster node1, ssh -l cluster node2 etc (or IPs or FQDNs)
Run java testing commands on belladati-main server (for each of the servers) ssh -l login name server identification 'java command'
e.g. : ssh -l cluster node1 'java -version' ; ssh -l cluster dbs 'jar' etc.
- Setting Application Properties parameters on server belladati-main
BellaDati application is running on belladati-main server, installation directory is /usr/local/BellaDati. It yields to next location for the properties file.
Run command: vim /usr/local/BellaDati/glassfish5/glassfish/domains/domain1/applications/belladati/WEB-INF/classes/conf/application.properties
The file application.properties must be modified to cover new cluster communication requirements.
Add lines :
application.actor.server.port=2335
tapestry.clustered-sessions=true
application.servers=belladati-main:2335,node1:2335,node2:2335,dbs:2335
instead of application servers alias names, IP adress or FQDN (see /etc/hosts) could be used.
Environment setting final notice
- Now, there are four machines operating linux OS, BellaDati application is running on GlassFish AS on one of the machines
- Ssh user cluster can communicate across private network and start java commands from belladati-main on every server
- User belladati_dbuser can connect to dbs belladati_db from arbirary of the future cluster servers
- The parameters for future BellaDati application cluster are set up in the file application.properties on server belladati-main.