Cluster management

Fetching cluster package

Installation and Cluster setup steps, has installed so far all needed software to run a cluster plus downloaded all the scripts to manage cluster. Although, JAR file containing cluster Java application was not yet downloaded. You can download it with following command
1
cd /opt/getint/cluster
2
wget -O cluster.jar https://.........
Copied!
If you do not obtained yet url to a JAR file containing a cluster, please contact us at [email protected] or chat with us on our website https://getint.io​

Available bash scripts

  • cluster_run.sh - script to run a cluster instance. Its using variables defined in cluster.env.
  • cluster_stop.sh - script to stop a cluster instance
  • cluster_tenants_list.sh - script to list all cluster tenants
  • cluster_tenants_create.sh - script to create tenant within a cluster
Before executing any of those scrips lets navigate to created cluster directory
1
cd /opt/getint/cluster
Copied!

Run cluster

Once there is a cluster.jar file in /opt/getint/cluster, lets run it (with tail command to preview run logs):
1
sh cluster_run.sh
Copied!

Stop cluster

1
sh cluster_stop.sh
Copied!

Create cluster tenant

Run below 2 commands to create and generate initial admin user that can access the platform. In the output you can find also a password that you will need to sign in.
1
sh cluster_tenants_create.sh <SOMEUNIQUEID>
2
sh cluster_tenants_access.sh <CREATED_TENANT_NAME>
Copied!
For tenant creation you need to provide a unique id. It can be anything just provide some distinguish name for the new tenant. AS you can see below, the access script has been executed with an argument te7e038f0 which was the name of the created tenant by first script (tenantName property)
1
sh cluster_tenants_create.sh t1
2
​
3
Output:
4
​
5
Sending request to cluster
6
curl --insecure --location http://localhost:8300/api/system/tenants --header 'Content-Type: application/json' --header 'Api-Key: gy3e2dt87gidu132te87dfqadhjsa' --data-raw '{"tenantUniqueId": "t1"}'
7
{"uuid":"b120b5de-7202-4fe5-ae23-c59c461e3886","schemaName":"te7e038f0","tenantName":"te7e038f0","uniqueId":"t1","jiraUrl":null,"preferredApps":null,"createdAt":"2021-02-10T11:07:20.721+0000","updatedAt":"2021-02-10T11:07:20.721+0000"}
8
​
9
sh cluster_tenants_access.sh te7e038f0
10
​
11
Output:
12
​
13
{"username":"platformadmin","password":"96f00538","apiKey":"23c0124c-8a28-4252-941f-781d9813ce9e"}
14
​
Copied!
So right now, the second command returned you the default access for the tenant. So beacuse in a cluster.env we have set domain equal to temp.getint.io here is how I should be able to access tenant:

Restart / Upgrade

1) Change directory to main cluster directory
1
cd /opt/getint/cluster
Copied!
2) If you do not want to upgrade cluster version you can skip this step. To upgrade a version you need to obtain a dedicated link to a precompiled cluster version dedicated for you. Once you have that link you can download it:
1
wget -O cluster.jar https://.........
Copied!
3) Stop tenants threads
1
sh cluster_tenants.sh stop
Copied!
4) Make sure that none of threads is still working. Following command should return FALSE. If it returns other value, wait few seconds try again. Keep trying until it returns FALSE
1
sh cluster_tenants.sh check
Copied!
5) Stop cluster
1
sh cluster_stop.sh
Copied!
6) If its upgrade, replace cluster application binary file. Otherwise skip this step. Make sure that below command is successfully executed and cluster.jar file is replaced.
1
mv <DOWNLOADED_FILE_IN_FIRST_STEP.jar cluster.jar
Copied!
7) Run cluster
1
sh cluster_run.sh
Copied!

Cluster manager

Cluster manager Java application is a new way to manage cluster. Its a command line Java application which can be run through a bash script called manager.sh, to make things easier (no need to remember command to run java application e.g. (java -jar ..... ).
Right now with new cluster manager, it's possible to manage tenants. Its functionality will be expanded soon to starting / stopping and upgrading a cluster, as well so it will become a central, one command tool which you can use to easily your cluster instance.
Preparation to use
  • manager can be downloaded from the artifactory with command: cd /opt/getint/cluster && curl -O https://artifactory.getint.io/manager.zip
  • unzip downloaded cluster manager with command unzip manager.zip
  • add executable permissions to the manager script chmod +rx manager.sh
  • link to .env file must be created within cluster directory, so manager application can read the configuration. Use following command: ln -s /opt/getint/cluster/cluster.env /opt/getint/cluster/.env
To run below commands, go to /opt/getint/cluster directory
Action
Command
List tenants
./manager ListTenants
Create tenant
./manager CreateTenant <uniqeid>
Is cluster alive
./manager IsAlive
Stop tenants threads
./manager StopTenants
Create tenant user
./manager CreateUser <tenantname> <username>
  • Instead of <uniqueid> provide some unique id which will let you distinguish the tenant, e.g. it can be a customer name.
  • Instead of <username> provide a username for the created user. User must be unique within a tenant scope. Also command will print out password and the api key generated for the user which should be exchanged with in a secure way.
  • Instead of <tenantname> provide a name of the tenant in which you want to create a new user. Tenants names can be found using ListTenants command
​