Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. READ MORE

Multi Node Install Example for Qlik Alerting for Windows using Nginx as a Load Balancer

cancel
Showing results for 
Search instead for 
Did you mean: 
Richard_Byard
Former Employee
Former Employee

Multi Node Install Example for Qlik Alerting for Windows using Nginx as a Load Balancer

Last Update:

Dec 21, 2022 9:59:01 AM

Updated By:

Sonja_Bauernfeind

Created date:

Aug 14, 2020 6:00:00 AM

Qlik Alerting for Windows supports multi-node environments from the September 2020 release. This document is intended to offer an example of setting up a multi-node instance of Qlik Alerting using external Redis and MongoDB database instances that can be made resilient through their own native capabilities.

A multi-node setup is not for every customer as it requires more knowledge on the part of the organisation to setup and maintain. The key benefits are:

  • Resilience - if one Qlik Alerting server node is offline the others in the cluster will take over the tasks and user interactions. Therefore there should be no loss of service due to downtime of a single machine.
  • Scalability & Performance - If you have a very large number of users with very large volumes of alerts being processed you may wish to separate the load across multiple servers to ensure there is no loss of performance for the users and for the alert delivery

What will you need to setup a multi-node architecture

  1. Access to a MongoDB instance (single server, cluster, Atlas/cloud)
  2. Access to a Redis instance (server, cluster or cloud)
  3. Multiple Windows Servers to install the Qlik Alerting nodes
  4. A load balancer to manage the users to be directed to correct, or accessible, Qlik Alerting node.

 

In this example, and assuming you are following this initially as a proof of concept, I would suggest you follow the documents to setup MongoDB and Redis on external linux machines as per the links below

Install MongoDB on an external Linux server for Qlik Alerting 

Install Redis on an external Linux server for Qlik Alerting 

 

Multi Node Architecture

The Qlik Alerting for Windows setup is reasonably simple to configure for a multi-node environment. The complexity is really outside of the Qlik Alerting install and relates to the setting up and maintenance of resilient MongoDB and Redis instances and the setup of an external load balancer for users to access the front end.

 

Architecture diagram

QAfW Multi Node.png

 

Components

  • Server 1 - Load balancer, this can be NGinx or any other load balancer that the customer has experience of. The example below will cover an NGinx deployment.
  • Server 2, 3, ...  - Qlik Alerting full stack installs using installer. Note: you do not need to install Redis or MongoDB on these servers but you will need to install NodeJS and then the Qlik Alerting installer.
  • External Databases

 

What does the Load Balancer do

The load balancer is used to direct access to the web UI, extension and API calls to the appropriate / most available server. It acts as the single entry point to the cluster and would typically be setup to be resilient on it's own.

How does this setup manage the allocation of backend tasks (scans, notifications etc)

Backend tasks are identified and pushed into the queue in Redis. Each node will take from the queue as required and the action completed by that node. When a node has taken the item from the queue it is removed and therefore the same action will not be duplicated on another node.

 

Setup a multi-node Qlik Alerting for Windows site

  1. Ensure you have your MongoDB and Redis connection details. If you need to setup external servers for the databases follow the links in the introduction before continuing.

  2. On the first windows server you will install Qlik Alerting and run through the setup (assuming you have not transferred the MongoDB database from an existing install)

    1. Install the latest NodeJS version. https://nodejs.org/en/download/

    2. Install Qlik Alerting for Windows (Sept 2020 or later). It will complete the install even though the databases are not locally installed so let it run through to the end of the process.

    3. Update the MongoDB connection details
      1. on the server navigate to the C:/program files/qlik alerting/repository/config/ folder

      2. open the default.json file with a text editor

      3. update the MongoDB connection details to your new server, if you are using a cluster then you will likely use the connectionString option as you will be connecting to multiple nodes through the string.
        For details see https://help.qlik.com/en-US/alerting/June2020/Content/QlikAlerting/installation-prerequisites.htm#an...

      4. save this file and restart the Qlik Alerting Repository service

    4. Update the Redis connection details
      1. on the server navigate to the C:/program files/qlik alerting/queuer/config/ folder

      2. open the default.json file with a text editor

      3. update the Redis details to your new external instance
        For details see https://help.qlik.com/en-US/alerting/June2020/Content/QlikAlerting/installation-prerequisites.htm#an...
        1. IP - the IP, server DNS or cloud URL
        2. Port - the port to connect to Redis on that machine. Default is 6379 but can be changed and will be different for a cloud connection.
        3. Password - the secure password that you need to connect to the database, this can be left blank if no password has been setup.

      4. save this file and restart the Qlik Alerting Queuer service

    5. Update the ports on which the Qlik Alerting instances are running from the default 4551/4552 to 80/443 as this will simplify the application of the load balancer.
      1. on the server navigate to the C:/program files/qlik alerting/config/ folder

      2. open the default.json file with a text editor

      3. in the top section for the Gateway details
        1. update the httpPort entry to 80
        2. update the httpsPort entry to 443
        3. update the https entry to false (this is only necessary as we are running the load balancer as http in this example)
      4. save this file and restart the Qlik Alerting Gateway service

    6. You should now be able to access the Qlik Alerting web portal by accessing https://localhost and you should be directed to the registration setup pages to enter your datasource (Qlik Sense site details), email server etc.
      For details see https://help.qlik.com/en-US/alerting/June2020/Content/QlikAlerting/install-configure.htm#anchor-3
      1. For the Qlik Alerting Config section, please update the following
        1. Update the Qlik Alerting Host Server Name to the load balancer URL if known. You can update this later if this is not known yet.
        2. Update the Qlik Alerting HTTP port to 80
        3. Update the Qlik Alerting HTTPS port to 443

  3. Repeat the steps 2.a. to 2.e. above for any other windows servers you wish to add as a node to this Qlik Alerting site.
    As you have already updated the connections to the databases you will not need to do step 2.f.
    Access https://localhost from those machines to check everything is running and you will be directed to the login page.

  4. You can test your connection from your machine to each of these servers
    1. check https://<server IP, DNS or FQDN> for each of the servers (you should not have to enter the port as we have changed this to the default https port 443)

  5. If you have setup the load balancer you should also check the connection through that URL (if you have not set this up see below for an example)
    1. check https://<load balancer IP, DNS or FQDN>
    2. if successful you should reach the Qlik Alerting login page

 

Setup a load balancer using Nginx

The below steps are the setup I used to create a simple load balancing node using Nginx which will allow you to test the load balancing and monitor which calls go to which server.

Steps for follow:

  1. Provision a linux server (in my example an Ubuntu 18.04 server)

  2. Open an SSH session through a terminal, command line or shell tool
    SSH username@servername
    And Enter the password for the user.

  3. Open the firewall for the appropriate ports, in this example i will connect with port 80 as i do not have an appropriate SSL cert. You can restrict this to your subnet etc as you require.
    sudo ufw allow proto tcp from 192.168.121.0/24 to any port 80
  4. Install Nginx
    sudo apt-get install nginx
  5. Ensure the default details do not look to run on port 80 (you can have multiple configs running in Nginx but they cannot conflict on port)

    • Open the default site details
      sudo nano /etc/nginx/sites-available/default
    • In the server {} section look for the listen <port> lines that are not commented.
      • comment '#' the two lines that show port 80
    • Click ctrl + x to exit,
      • you will be asked if you want to save  the modifications, click on y
      • It will ask the name of the file you want to save, click enter as we want to save the file we opened.

  6. Create a new config file for Nginx

    1. Open a new config file
      sudo nano /etc/nginx/conf.d/loadbalancer.conf

    2. Copy and paste the following into this file

 

 

log_format upstreamlog '$server_name to : $upstream_addr [$request]';

upstream backend {
        server qa-node1.domain.com;
        server qa-node2.domain.com;
    }

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        access_log /var/log/nginx/access.log upstreamlog;

	 location / {
               proxy_redirect      off;
                proxy_set_header    X-Real-IP $remote_addr;
                proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header    Host $http_host;
                proxy_next_upstream     error timeout invalid_header http_500;
                proxy_connect_timeout   5s;
                proxy_pass  http://backend;
        }
}

 

 

  • Click ctrl + x to exit,
    1. you will be asked if you want to save  the modifications, click on y
    2. It will ask the name of the file you want to save, click enter as we want to save the file we opened.

  • Restart Nginx
    sudo systemctl restart nginx

    NOTE: if you have a port conflict you will see an error message here so please check step 5

  • You should now be ready to connect to your Qlik alerting instances through the load balancer.
    1. If you have not entered the load balancer server details in the Qlik Alerting config settings you should do that on one of the servers now.
      1. Login to Qlik Alerting directly on one of the nodes
      2. navigate to admin > config
      3. update the  Qlik Alerting Host Server Name with the load balancer server IP, DNS or FQDN. This is used in the emails so does not require a restart of any services.

  • To check that the nodes are all receiving traffic you can request to view the logging which we have included in the config file we created.
    sudo tail -f /var/log/nginx/access.log

    As you interact with your Qlik Alerting portal you should now see the calls being distruibuted across the different nodes.

    to stop viewing the log click ctrl + c

 

IMPORTANT!

  • We are using port 80 for the load balancing so the links in emails will not connect directly as they are always https://. Click on the link but you will need to change the https:// to http:// for the link to work.
  • We had to update the https: key in the config/default.json file in step 2e of the Qlik Alerting setup steps above. Again this is simply because we are running the setup on port 80 in http and we need to allow Qlik Alerting to open as http.

 

Additional resources

Nginx setup resources

Nginx SSL configuration resources

 

Tags (1)
Labels (1)
Version history
Last update:
‎2022-12-21 09:59 AM
Updated by: