As of 1 July 2020, Qlik Core is no longer available to new customers. No further maintenance will be done in this repository.
This git repository contains an example on how to synchronize documents between multiple Qlik Associative Engine instances in Qlik Core. It also contains a small test scenario, implemented with enigma.js, to verify document synchronization between engine instances. Container orchestration in this example is managed with Kubernetes.
In this example, the engine instances are deployed as separate services. This makes it easier to see document synchronization because it ensures that both engine instances are used, and that the sessions are not balanced by Kubernetes built-in load balancer.
A Kubernetes Persistent Volume is shared between the two Qlik Associative Engine instances. To manage document synchronization, Qlik Core looks for document changes on the shared volume. If changes to data blobs, objetcs, variables, dimensions, or measures are detected, all existing sessions towards the document are updated, regardless of which engine instance is being used.
To run this example, you need to have Minikube (or equivalent) and Kubernetes installed locally.
Since Qlik Associative Engine instances use nobody
as the running user in the docker container,
you must set the appropriate permissions for doucment storage.
To create the document storage folder in Minikube, run the following command:
minikube ssh 'sudo mkdir -p /data/docs;sudo chmod o+rw /data/docs'
To deploy the example, run the following command:
kubectl create -f example
The test scenario runs through the following steps:
Create a document in the first Qlik Associative Engine instance.
Open the previously created document in the second Qlik Associative Engine instance.
Set a script and perform a reload in the second Qlik Associative Engine instance.
Open a session to the document again in the first Qlik Associative Engine and verify reload time.
To execute the test locally, run the following commands:
npm install
ENGINE1=<URL to Qlik Associative Engine> ENGINE2=<URL to Qlik Associative Engine> npm run test
!!! Note
You can retrieve the url to an engine by running minikube service engine --url
. The service name used for the query is specified in *-service.yaml
.
The test scenario is also part of the Circle CI pipeline and executed for each commit to this repository. For more details, look at the Circle CI config file.
To remove the deployment, run the following command:
kubectl delete -f example