Creating a GigaSpaces Cluster On Premise
gsctl is a simple CLI tool for creating GigaSpaces clusters. You can create a cluster in minutes with a single command – run
java -jar gsctl.jar create.
In this topic, you will learn how to create, provision and install a GigaSpaces cluster on the on-premise machines, and then remove it by doing the following:
- Create a GigaSpaces cluster.
- Deploy GigaSpaces services in the cluster.
- Tear down the GigaSpaces cluster.
Before beginning to work with the gsctl tool, you must do the following:
Verify that Java 8 or higher is installed on your local workstation.
- Disable the password prompt when using
sudoin your on-premise machines.
- Install Unzip on all the cluster machines
- Ensure that you have a single pem file for all your on-premise machines
- Verify connectivity to all the machines from your workstation
- Centos machines only - disable the firewall (firewalld service) and make sure it is set to stay disabled on start (for example, when the machine reboots)
Downloading and Running the Utility
The gsctl tool can be downloaded from a dedicated repository. You can start an interactive shell for gsctl and run commands using short notation, or you can run commands from outside the interactive shell (from the OS shell) by adding
java -jar gsctl.jar before each command.
You must run the utility from the same directory where you placed the gsctl.jar file.
To download the gsctl utility and launch the interactive shell:
Create an empty directory on your machine. In this example, the drive is C: and the directory name is gsDemo.
Download the most current version of the utility (gsctl.jar file) from the dedicated repository to the directory you created (gsDemo).
To start the interactive shell, open a command window and type the following:
java -jar gsctl.jar
java -jar C:\gsDemo\gsctl.jar
Creating a GigaSpaces Cluster
Follow the steps in the procedure to create a GigaSpaces cluster and deploy the GigaSpaces services. All of the procedures on this page describe the short notation as used from inside the interactive shell.
To create a cluster:
Create an empty directory on your machine. In this example, the directory name is gsDemo.
- Download the most current version of the gsctl.jar file from the dedicated repository to the directory you created (gsDemo) and extract the contents.
- Add the pem file to this directory.
Open a command window and type the following to define a cluster called
init --mode=on-prem --cluster-name=gs_demo_cluster
This command creates also a cluster.yaml file. Modify the yaml file as follows:
keyName- name of your pem file (without the .pem extension)
userName- name of the on-premise machine being used to create the cluster
profiles- the on-premise worker (client) name, along with the IP addresses of the host machines
You must have 3 masters (gsManagers) and at least 1 worker.
gsManagers: 3 aws: null onPremise: keyName: "pem file" userName: "user name" masters: label: "GS Cluster [gs_demo_cluster] Master Group" profiles: - name: "default on premise master name" hosts: - "127.0.1.93" - "127.0.1.95" - "127.0.1.96" workers: label: "GS Cluster [gs_demo_cluster] Worker Group" profiles: - name: "default on premise worker name" hosts: - "127.0.1.97" - "127.0.1.98" - "127.0.1.99" name: "gs_demo_cluster"
To create the cluster, run the following command:
Deploying the GigaSpaces Services
After your cluster is up and running, you can deploy GigaSpaces services and microservices.
The gsctl utility supports deploying stateful, stateless, and web services. The default service type is stateless.
The gsctl tool comes with sample processor (stateful) and feeder (stateless) services in the Services folder. You must use the default artifact repository when deploying the sample services.
For more information about the artifact repository, see the Managing the GigaSpaces Product Version topic.
To deploy the sample GigaSpaces services:
When deploying the sample services, you should first deploy the processor service . As this is a stateful service, you need to specify both the service type and service name. Type the following command to deploy a processor service called mySpace:
deploy --type=stateful mySpace data-processor.jar
Next, deploy the feeder service. As this is a stateless service, you only have to specify the service name. Type the following command to deploy a feeder service called myFeeder:
deploy --type=stateless myFeeder data-feeder.jar
Monitoring the GigaSpaces Services
After you deploy your GigaSpaces services and microservices, you can monitor them using the following built-in web interfaces:
- Ops Manager
To access the administration and monitoring tools:
Run the following command:
This returns all the services with their URLs.
Copy any of the GigaSpacesManager URLs into your browser to open Ops Manager and view the deployed GigaSpaces services.
Copy the grafana URL to your browser to open Grafana and navigate to the pre-defined dashboards:
Select the Telegraf system metrics dashboard in Grafana to view the cluster metrics:
Removing a GigaSpaces Cluster
You can delete your cluster when you no longer need it, in order to release the cloud resources.
To remove the GigaSpaces cluster:
In the directory where you created the cluster, run the following command:
This tears down the cluster.