Hazelcast Command Line is a tool which allows users to install & run Hazelcast IMDG and Management Center on local environment.
- Requirements
- Installation
- Basic Usages
- How to start a Hazelcast member
- How to start a Hazelcast member with custom configuration
- How to start a Hazelcast member with additional Java options
- How to start a Hazelcast Management Center
- How to start a Hazelcast Management Center with custom context path and port
- How to start a Hazelcast Management Center with additional Java options
- How to print version information
- Installation from source
- This tool runs under Unix-like environments only.
- JRE 8+ should be installed.
You can install Hazelcast Command Line using Homebrew on macOS or manually on other operating systems. Support for other package managers such as yum and apt are in progress.
To install with Homebrew, you first need to tap the hazelcast/hz
repository. Once you’ve tapped the repo, you can use brew install
to install:
$ brew tap hazelcast/hz
$ brew install hazelcast
Please download the latest archive package from this repository's releases section. Once you downloaded, you can extract it and start using Hazelcast Command Line as follows:
$ wget https://github.com/hazelcast/hazelcast-command-line/releases/download/v4.2020.09/hazelcast-command-line-4.2020.09.tar.gz
$ tar -xzvf hazelcast-command-line-4.2020.09.tar.gz
$ cd hazelcast-command-line-4.2020.09/bin
$ ./hz
Please run the following command to start a Hazelcast member with default configuration:
$ hz start
Please run the following command to start a Hazelcast member with custom configuration:
$ hz start -c /full/path/to/config-file.yaml
Please note that only XML and YAML configurations are supported and a full path is required. If -c, --config=<file>
option is not set then the configuration file at [INSTALLATION_DIR]/config/hazelcast.yaml
is used. You can update this file to configure starting Hazelcast members.
Additionally, you can see which file is used to configure Hazelcast instance at the first log line after start. Please see an example output below:
$ ./hz start
Aug 21, 2020 1:40:04 PM com.hazelcast.config.FileSystemYamlConfig
INFO: Configuring Hazelcast from '/Users/myuser/hazelcast-command-line/distro/build/dist/config/hazelcast.yaml'.
...
The following command will allow you to start a Hazelcast member with additional Java options:
$ hz start -J <option1>,<option2>
You can use ,
to separate multiple paths. Please note that class path settings (such as -cp
, -jar
) are not allowed.
When you run hz start
command with any available option, it starts a Hazelcast instance in the foreground. Please use Ctrl+C (SIGINT) to gracefully stop the running instance. For all other available options, refer to hz start --help
.
Please run the following command to start a Hazelcast Management Center with default configuration:
$ hz mc start
To start a Hazelcast Management Center with custom context path and port, please run the following command:
$ hz mc start -c [new-context-path] -p [port]
For instance, if you run with hz mc start -c my-management-center -p 9000
Management Center starts at http://localhost:9000/my-management-center
.
The following command will allow you to start a Hazelcast Management Center with additional Java options:
$ hz mc start -J <option1>,<option2>
You can use ,
to separate multiple paths. Please note that class path settings (such as -cp
, -jar
) are not allowed.
When you run hz mc start
command with any available option, it starts a Hazelcast Management Center instance in the foreground. Please use Ctrl+C (SIGINT) to gracefully stop the running instance. For all other available options, refer to hz mc start --help
.
This command prints Hazelcast IMDG, Management Center and the tool's version information to the console output:
$ hz -V
CLI tool: 4.2020.09
Hazelcast IMDG: 4.1-BETA-1
Hazelcast Management Center: 4.2020.08
Firstly, build the distribution:
cd distro/
make
After running the make
command successfully, navigate to distro/build/dist/bin
folder and run the ./hz
script:
cd build/dist/bin
./hz
This will print the usage options. You can follow the instructions in the output.
The compressed distribution package is also available at distro/build/package/
folder. You can extract & use it.
Please use the following command to run checkstyle validation:
mvn -P checkstyle clean validate
Please use the following command to run SpotBugs analysis:
mvn -P spotbugs clean compile