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

cd /opt/getint/cluster
wget -O cluster.jar https://.........

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

cd /opt/getint/cluster

Run cluster

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

sh cluster_run.sh

Stop cluster

sh cluster_stop.sh

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.

sh cluster_tenants_create.sh <SOMEUNIQUEID>
sh cluster_tenants_access.sh <CREATED_TENANT_NAME>

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)

sh cluster_tenants_create.sh t1
Output:
Sending request to cluster
curl --insecure --location http://localhost:8300/api/system/tenants --header 'Content-Type: application/json' --header 'Api-Key: gy3e2dt87gidu132te87dfqadhjsa' --data-raw '{"tenantUniqueId": "t1"}'
{"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"}
sh cluster_tenants_access.sh te7e038f0
Output:
{"username":"platformadmin","password":"96f00538","apiKey":"23c0124c-8a28-4252-941f-781d9813ce9e"}

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

cd /opt/getint/cluster

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:

wget -O cluster.jar https://.........

3) Stop tenants threads

sh cluster_tenants.sh stop

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

sh cluster_tenants.sh check

5) Stop cluster

sh cluster_stop.sh

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.

mv <DOWNLOADED_FILE_IN_FIRST_STEP.jar cluster.jar

7) Run cluster

sh cluster_run.sh

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