The following article is an example of how you can configure Multiple Lifecycle Query Engine (LQE) Nodes, deployed with Jazz Authorization Server, with Load Balancing for Distributing query workload.
This examples assumes the ELM deployment is on IBM WebSphere Liberty Profile with Jazz Authorization Server enabled and a Reverse Proxy Server (IBM HTTP Server).
Pre-Req: LQE deployed on its own IBM Liberty server and is setup with a distributed deployment of ELM enabled with JAS.
You will need a backup from your original LQE server to configure additional servers. A backup contains all the metadata in LQE and a copy of the indexed data. You can use the backup files to install another LQE server that has a copy of the indexed data.
lqe.key
, lqe.node.id
and dbconnection.properties
files from the conf/lqe directory to the new server
lqe.key
, lqe.node.id
and dbconnection.properties
files from the original server to the conf/lqe directory in the new installation
dbconnection.properties
file in the conf/lqe directory and update the db.location and db.password
lqe.properties
file in the conf/lqe directory and set the LQE restore property to true: lqe.restore=true
[LQE_HOME]/server/server.startup
file to update any of the required configurations like Java Heap memory allocation to match the primary server
[LQE_HOME]/server/liberty/servers/clm/server.xml
file to add clone Id to httpSession element as show below <httpSession invalidateOnUnauthorizedSessionRequestException="true" cookieSecure="true" cloneId="lqenode2"/>
We have included scripts to add new URLs to JAS registrations which is primarily used for setting up clustering. We can reuse these scripts for this task.
On the LQE Server
addNodeReg.sh
and JASConfig.params
files to the server hosting Jazz Authorization Server
On the Jazz Authorization Server
addNodeReg.sh
and JASConfig.params
files to [JAS_HOME] directory
JASConfig.params
file and modify the JASPATH to set it to JAS install directory and JASCREDENTIALS to add an Admin user and password JASPATH=/opt/IBM/JazzAuthServer JASCREDENTIALS=elmadmin:elmadminpassword
https://JazzAuthServerURI/oidc/endpoint/jazzop/clientManagement
and login as an Admin User
/lqe
and copy the respective Client ID
# ./addNodeReg.sh <ClientId> https://LQEPrimaryNodeURL:PORT/lqe # ./addNodeReg.sh <ClientId> https://LQENEWNodeURL:PORT/lqe
Test by accessing individual LQE Node URLs
Primary LQE Node:
LQE_Primary_Node_1
and click Save
New LQE Node:
LQE_New_Node_2
and click Save
We have performed minimal testing of Load Balancing of LQE nodes using HAProxy and Apache HTTP Server and have documented our findings below.
For open-source software, including Apache HTTP Server and HAProxy, the following IBM Policy applies: IBM Open Source and Third-party software policy
We have documented instructions to setup Load Balancing for LQE using Apache HTTP Server
HAProxy is a free and open source software that provides a high availability load balancer and reverse proxy. It supports a rich set of Load Balancing algorithms and the default is Leastconn. We have tested the use of HAProxy with EWM/ETM Clustering and hence are documenting the setup of HAProxy for LQE load balancing. HAProxy is not supported on Microsoft Windows Operating System. You can continue to the next step if your environment is Linux based.
The steps provided in the next section is a simple setup of HAProxy. For detailed instructions please visit http://www.haproxy.org/
You need a Linux based server in your environment to install and configure HAProxy. Run the following commands
# yum update # yum install haproxy
Generate SSL Certificates to be used with HAProxy via OpenSSL
# mkdir /etc/haproxy/ssl # cd /etc/haproxy/ssl # openssl req -newkey rsa:3072 -sha256 -new -x509 -days 3652 -nodes -out haproxy.crt -keyout haproxy.key # cat haproxy.crt haproxy.key > haproxy.pem # chmod +rx haproxy.*
Import this certificate and key file into IBM HTTP Server certificate kdb file and the Plugin kdb file.
Here is a sample haproxy.cfg
file for load balancing 2 LQE nodes. You could change the ports (8080, 8443, 1936) to the ports of your choice and the user/group as well.
In addition, change the path to the SSL certificate to the one created in the previous step.
global log 127.0.0.1:514 local0 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy daemon stats socket /var/lib/haproxy/stats tune.ssl.default-dh-param 2048 defaults mode http log global option http-keep-alive option dontlognull option http-server-close option forwardfor except 127.0.0.0/8 option redispatch retries 3 timeout http-request 10s timeout queue 1m timeout connect 10s timeout client 2h timeout server 2h timeout http-keep-alive 10s timeout check 10s maxconn 4000 # Connect to LQE cluster frontend lqe-proxy bind *:8080 bind *:8443 ssl crt /etc/haproxy/ssl/haproxy.pem no-sslv3 log global option httplog mode http capture cookie SERVERID len 32 redirect scheme https if !{ ssl_fc } maxconn 1000 # The expected number of the users of the system. default_backend lqe backend lqe option forwardfor http-request set-header X-Forwarded-Port %[dst_port] http-request add-header X-Forwarded-Proto https if { ssl_fc } fullconn 1000 # if not specified, HAProxy will set this to 10% of 'maxconn' specified on the frontend balance leastconn cookie SERVERID insert indirect nocache # Edit the LQE Node URLs, and change Minimum and Maximum connections as per you need. For another node, add server lqenode1 <LQEPrimaryNode_Hostname>:<PORT> minconn 100 maxconn 500 ssl check cookie lqenode1 verify none server lqenode2 <LQENEWNode_Hostname>:<PORT> minconn 100 maxconn 500 ssl check cookie lqenode2 verify none # The following configuration opens the Load Balancing Statistics Page,, change user password per your requirement listen statistics bind *:1936 stats uri / stats admin if TRUE stats enable stats hide-version stats auth admin:password stats refresh 5s
Run the following commands to start the HAProxy Server, enable it to auto start during machine startup and to check status of the HAProxy server
# systemctl start haproxy # systemctl enable haproxy # systemctl status haproxy
Find the ClientId of LQE Application (This was also done in an earlier step)
https://JazzAuthServerURI/oidc/endpoint/jazzop/clientManagement
and login as an Admin User
/lqe
and copy the respective Client ID
On the JAS Server machine, switch to [JAS_HOME] directory
# ./addNodeReg.sh <ClientId> https://HAProxyServer:PORT/lqe
Access LQE via HAProxy URL https://HAProxyServer:PORT/lqe
SERVERID: "lqenode1"
http://HAProxyServer:1936
(Default user and password as per the haproxy.cfg file above is admin
and password
)
As the landing ELM and LQE URL is IHS or your configured Reverse Proxy, you would have to change the redirection of /lqe to the HAProxy server and port. Example of IHS plugin URL below
<Transport Hostname="<HAProxy_Server>" Port="8443" Protocol="https">
Access the original LQE URL via the Revers
SERVERID: "lqenode1"
Proxy
https://LQE_IHS_URL/lqe/web/health/query-stats
Status icon key: