<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Alparslan Avcı</title>
    <description>The latest articles on Forem by Alparslan Avcı (@alparslanavci).</description>
    <link>https://forem.com/alparslanavci</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F585517%2F8236dd3c-a63c-48d2-afc2-8df37309a9e1.jpeg</url>
      <title>Forem: Alparslan Avcı</title>
      <link>https://forem.com/alparslanavci</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/alparslanavci"/>
    <language>en</language>
    <item>
      <title>Hazelcast Command Line is released!</title>
      <dc:creator>Alparslan Avcı</dc:creator>
      <pubDate>Wed, 24 Feb 2021 13:37:41 +0000</pubDate>
      <link>https://forem.com/hazelcast/hazelcast-command-line-is-released-204m</link>
      <guid>https://forem.com/hazelcast/hazelcast-command-line-is-released-204m</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0gbck1zkxfr0hfdz464h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0gbck1zkxfr0hfdz464h.png" alt="Alt Text" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are pleased to announce that Hazelcast Command Line 4.2020.12 is now available. It supports Hazelcast IMDG 4.1.1 and Hazelcast Management Center 4.2020.12. It took longer than anticipated to get a proper CLI for Hazelcast, however, we hope you will find it was worth the wait.&lt;/p&gt;

&lt;p&gt;In this blog post, we will go through what problems we aim to solve with Hazelcast CLI, as well as how to use it. If you're more of a hands-on learned, feel free to skip directly to the end for tips on using it.&lt;/p&gt;

&lt;h2&gt;Installing and starting an Hazelcast instance, the long way&lt;/h2&gt;

&lt;p&gt;As you most likely know, you can use Hazelcast in two main topologies: Embedded and Client-Server. You add Hazelcast as a dependency to your Java application if you choose the former architecture.&lt;/p&gt;

&lt;p&gt;But, if you would like to design your architecture using a client-server approach, you need to start Hazelcast member instances. Before the Hazelcast CLI, you had to perform multiple steps to run a Hazelcast member standalone.&lt;/p&gt;

&lt;h3&gt;Install Java&lt;/h3&gt;

&lt;p&gt;Since Hazelcast member is a Java application, it requires a JRE to be installed in the environment. If you are not familiar with Java, it might be difficult to find the proper version and install it.&lt;/p&gt;

&lt;h3&gt;Download Hazelcast distribution&lt;/h3&gt;

&lt;p&gt;Hazelcast is available for download at &lt;a href="https://hazelcast.com/get-started/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://hazelcast.com/get-started/" rel="noopener noreferrer"&gt;https://hazelcast.com/get-started/&lt;/a&gt;. You had to visit this page and download the Hazelcast version distribution that you would like to install.&lt;/p&gt;

&lt;h3&gt;Run the instance using start.sh script&lt;/h3&gt;

&lt;p&gt;After downloading the distribution, you had to extract it to a proper location and then run the &lt;em&gt;“start.sh”&lt;/em&gt; script that resides in the &lt;em&gt;“bin/”&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;After all these steps complete successfully, you (finally) have a running Hazelcast member instance.&lt;/p&gt;

&lt;p&gt;However, this method is a manual process. There is support for neither package managers nor version control. Moreover, installing &lt;a href="https://hazelcast.org/imdg/download/#hazelcast-management-center" rel="noopener noreferrer"&gt;Hazelcast Management Center&lt;/a&gt; requires the same steps again.&lt;/p&gt;

&lt;h2&gt;The easy way: using Hazelcast Command Line&lt;/h2&gt;

&lt;p&gt;To make the Hazelcast installation easier, we developed Hazelcast Command Line. Please note that it is only targeted at developers and &lt;em&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/em&gt; recommended for usage in production environments for the time being. Now, you only need to use your favourite package manager to install Hazelcast, and then run the &lt;code&gt;hz start&lt;/code&gt; command to start a Hazelcast member instance!&lt;/p&gt;

&lt;p&gt;Even better, we have deployed the CLI in the most common repository managers.&lt;/p&gt;

&lt;h3&gt;Install with Homebrew&lt;/h3&gt;

&lt;p&gt;To install with Homebrew, you first need to tap the &lt;em&gt;hazelcast/hz&lt;/em&gt; repository. Once you’ve tapped the repo, you can use brew install to install:&lt;/p&gt;

&lt;pre&gt;$ brew tap hazelcast/hz
$ brew install hazelcast&lt;/pre&gt;

&lt;h3&gt;Install with yum/dnf&lt;/h3&gt;

&lt;p&gt;The RPM packages for Hazelcast Command Line are kept in Hazelcast's RPM repository. Just run the following commands to install it using &lt;em&gt;yum/dnf&lt;/em&gt;:&lt;/p&gt;

&lt;pre&gt;$ wget https://repository.hazelcast.com/rpm/hazelcast-rpm.repo -O hazelcast-rpm.repo
$ sudo mv hazelcast-rpm.repo /etc/yum.repos.d/
$ sudo yum install hazelcast&lt;/pre&gt;

&lt;h3&gt;Install with apt&lt;/h3&gt;

&lt;p&gt;You can find the Debian packages for Hazelcast Command Line in Hazelcast's Debian repository. Run the following commands to install it using &lt;em&gt;apt&lt;/em&gt;:&lt;/p&gt;

&lt;pre&gt;$ wget -qO - https://repository.hazelcast.com/api/gpg/key/public | sudo apt-key add -
$ echo "deb https://repository.hazelcast.com/debian stable main" | sudo tee -a /etc/apt/sources.list
$ sudo apt update &amp;amp;&amp;amp; sudo apt install hazelcast&lt;/pre&gt;

&lt;p&gt;All these package managers will handle the Java dependencies for you. Also, you can pick the previous versions by using the proper commands for each package manager.&lt;/p&gt;

&lt;p&gt;After the installation, run the following command to see everything is completed successfully:&lt;/p&gt;

&lt;pre&gt;$ hz
Hazelcast IMDG 4.1.1
Usage: hz [-hV] [COMMAND]
Utility for the Hazelcast operations.

Global options are:

  -h, --help Show this help message and exit.
  -V, --version Print version information and exit.
Commands:
  start Starts a new Hazelcast IMDG member
  mc Utility for Hazelcast Management Center operations.&lt;/pre&gt;

&lt;h2&gt;&lt;/h2&gt;

&lt;h2&gt;A quick intro to Hazelcast CLI&lt;/h2&gt;

&lt;p&gt;The main command of Hazelcast Command Line is &lt;code&gt;hz&lt;/code&gt;. To start a Hazelcast instance, just run &lt;code&gt;hz start&lt;/code&gt; and a new instance will run with the &lt;em&gt;default&lt;/em&gt; configuration:&lt;/p&gt;

&lt;pre&gt;$ 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'.
...&lt;/pre&gt;

&lt;p&gt;If you want to configure the instance with an external Hazelcast configuration file, use &lt;code&gt;-c&lt;/code&gt; option with the command as below:&lt;/p&gt;

&lt;pre&gt;$ hz start -c /full/path/to/config-file.yaml&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;-h&lt;/code&gt; option reveals further available options:&lt;/p&gt;

&lt;pre&gt;$ hz start -h
Usage: hz start [-hvV] [-vv] [-c=&amp;lt;file&amp;gt;] [-i=&amp;lt;interface&amp;gt;] [-p=&amp;lt;port&amp;gt;] [-j=&amp;lt;path&amp;gt;
                [,&amp;lt;path&amp;gt;...]]... [-J=&amp;lt;option&amp;gt;[,&amp;lt;option&amp;gt;...]]...
Starts a new Hazelcast IMDG member
  -h, --help Show this help message and exit.
  -V, --version Print version information and exit.
  -c, --config=&amp;lt;file&amp;gt; Use &amp;lt;file&amp;gt; for Hazelcast configuration. Accepted
      formats are XML and YAML.
  -p, --port=&amp;lt;port&amp;gt; Bind to the specified &amp;lt;port&amp;gt;. Please note that if the
      specified port is in use, it will auto-increment to
      the first free port. (default: 5701)
  -i, --interface=&amp;lt;interface&amp;gt;
      Bind to the specified &amp;lt;interface&amp;gt;.
  -j, --jar=&amp;lt;path&amp;gt;[,&amp;lt;path&amp;gt;...]
      Add &amp;lt;path&amp;gt; to Hazelcast classpath (Use ',' to separate
      multiple paths). You can add jars, classes, or the
      directories that contain classes/jars.
  -J, --JAVA_OPTS=&amp;lt;option&amp;gt;[,&amp;lt;option&amp;gt;...]
      Specify additional Java &amp;lt;option&amp;gt; (Use ',' to separate
      multiple options).
  -v, --verbose Output with FINE level verbose logging.
  -vv, --vverbose Output with FINEST level verbose logging.&lt;/pre&gt;

&lt;p&gt;As we mentioned above, you can also start a Hazelcast Management Center using Hazelcast Command Line. Please run the following command to start a Hazelcast Management Center instance:&lt;/p&gt;

&lt;pre&gt;$ hz mc start&lt;/pre&gt;

&lt;p&gt;If you would like to start a Hazelcast Management Center with custom context path and port, please run the following command:&lt;/p&gt;

&lt;pre&gt;$ hz mc start -c [new-context-path] -p [port]&lt;/pre&gt;

&lt;h2&gt;Future&lt;/h2&gt;

&lt;p&gt;Currently, Hazelcast CLI is only targeted at developers and &lt;em&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/em&gt; recommended for usage in production environments. Also, there is no support for Windows environments. We are working on them and will include more features in future releases.&lt;/p&gt;

&lt;p&gt;Your feedback as a user is very valuable to us. We would appreciate your thoughts and feedback with us by creating an issue on &lt;a href="https://github.com/hazelcast/hazelcast-command-line/issues" rel="noopener noreferrer"&gt;Hazelcast Command Line Github repository&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>hazelcast</category>
      <category>java</category>
      <category>cli</category>
      <category>distributedsystems</category>
    </item>
  </channel>
</rss>
