Running Clusters - padogrid/padogrid GitHub Wiki

◀️ Understanding Clusters 🔗 Default Port Numbers ▶️


Let's experiment some of the cluster specific commands in the default myws workspace. Keep in mind that PadoGrid unifies all the supported products, i.e., the same commands apply to all the products.

  1. Create a new cluster. When you created a workspace, you also created the default cluster such as mycoherence, mygeode, mygemfire, myhadoop, myhz, myjet, mykafka, 'mymosquitto, myredis, mysnappy, or myspark. Instead of using the default cluster, let's create a new cluster named finance`.
# Create a Hazelcast cluster
create_cluster -product hazelcast -cluster finance

🔑 If you have not entered the license key when you created the workspace with Hazelcast Enterprise or Jet Enterprise distribution then the above command displays the following message.

WORKSPACE
   /home/dpark/Padogrid/workspaces/myrwe/myws

-----------------------------------------------------------------------------------
LICENSE KEY WARNING:
It seems you have not entered the enterprise license key. You can enter it in any
of the following files. The higher in the list the wider it is applied. For example,
setting it in '.hazecastenv.sh', applies to all workspaces in that directory.

   /Users/dpark/workspace/myrwe/.hazelcastenv.sh
   /home/dpark/workspaces/myrwe/myws/setenv.sh
   /home/dpark/workspaces/myrwe/myws/clusters/finance/bin_sh/setenv.sh

The following is the recommended file to place your license key(s). This allows
all workspaces to inherit the license key(s).

/Users/dpark/Padogrid/workspaces/myrwe/.hazelcastenv.sh
-----------------------------------------------------------------------------------

🔑 If you see the above message, then you should enter your license key in one of the listed files. You won't be able to run the cluster without a valid license key. This message appears only if you have Hazelcast Enterprise or Jet Enterprise installed.

  1. By default, the create_cluster command adds two (2) members. If you want a member to the cluster then execute the add_member command. Let's add three (3) more members.
add_member -cluster finance -count 3
  1. The above command adds three (3) additional members making the cluster size of five (5) members. The show_cluster command will display each member's status.
show_cluster -cluster finance
  1. If you are tired of typing the -cluster option then you can switch clusters.
switch_cluster finance
  1. With the switch_cluster command executed, if you execute any commands without the -cluster option, then they will only apply to the finance cluster. Try the show_cluster command, for example.
show_cluster
  1. The create_cluster command generates the cluster.properties file in the cluster's etc directory. You can edit this file to configure member specific properties such as the heap min and max sizes.
# First, change directory to the finance cluster directory
cd_cluster
cat etc/cluster.properties
  1. Similarly, create_cluster places the default data grid configuration file in the etc or run directory. You can edit or replace it with your configuration file.
# Coherence
cat etc/cache-config.xml
cat etc/pof-config.xml
cat etc/tangosol-coherence-override.xml

# Geode/GemFire
cat etc/gemfire.properties
cat etc/cache.xml

# Hadoop
ls etc/<cluster>-datanode-*/

# Hazelcast/Jet
cat etc/hazelcast.xml
cat etc/hazelcast-jet.xml

# Kafka
cat etc/server*.properties

# Mosquitto
cat etc/mosquitto-*.conf

# Redis
cat run/<member_name>/redis.conf

# SnappyData/ComputeDB
cat bin_sh/setenv.sh
cat etc/gemfire.properties

# Spark
cat etc/master.properties
cat etc/worker.properties
  1. If you have application jar files that need to be in the cluster (member) class path, then place them in the any of the plugins directory. See the CLASSPATH section for the class path order.
# View plugins directories
cd_cluster; ls plugins
cd_workspace; ls plugins

# The above commands can also be executed as follows
ls $PADOGRID_WORKSPACE/clusters/$CLUSTER/plugins/
ls $PADOGRID_WORKSPACE/plugins/
  1. Once you are satisfied with the cluster configuration, you can now start the cluster using the start_cluster command.
start_cluster
  1. You can execute the show_cluster command to see the cluster status. Let's supply the -long option to see details.
show_cluster -long
  1. To view member log files, run the show_log command.
# "tail -f" the first member log (-num 1)
show_log

# "tail -f" the second member log
show_log -num 2

# "less" the first meber log
show_log -full
  1. If you are running Hazelcast then you can also start the Management Center by running the start_mc command.
# For Hazelcast IMDG and Jet only
start_mc
  1. You can execute the show_cluster -long command to see the detailed cluster status including the Geode/GemFire Pulse or Hazelcast Management Center URL.
show_cluster -long
  1. You can stop the cluster by executing the stop_cluster command.
# To stop members only
stop_cluster

# To stop members, leaders and locators (Geode/GemFire, SnappyData/ComputeDB only)
stop_cluster -all
  1. Similarly, you can stop the Hazelcast Management Center by executing the stop_mc command.
stop_mc

◀️ Understanding Clusters 🔗 Default Port Numbers ▶️

⚠️ **GitHub.com Fallback** ⚠️