Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hazelcast dedicated nodes

Tags:

java

hazelcast

What is the simplest way to run Hazelcast nodes on dedicated servers?

We have a web application that uses a Hazelcast distributed map. Currently the Hazelcast nodes are configured to run in the Servlet Container nodes.

As we scale up, we'd like to add dedicated hardware as Hazelcast nodes.

Then we won't need full Hazelcast nodes in the Servlet Containers anymore, those can be clients. (There are licensing costs associated with the Servlet Containers, so getting load off them is good, don't ask...)

So the question is, what's a minimal Hazelcast node installation? Something analogous to a memcached installation. All it needs to do is read configuration and start up, no local clients.

I see it supports Jetty, but is that needed at all, or is there some simple class in those jars I could execute on a JVM raw?

like image 300
Szocske Avatar asked Aug 26 '11 13:08

Szocske


People also ask

What is Hazelcast node?

js Client. Hazelcast is an open-source distributed in-memory data store and computation platform that provides a wide variety of distributed data structures and concurrency primitives. Hazelcast Node. js client is a way to communicate to Hazelcast clusters and access the cluster data.

How much memory does Hazelcast use?

A grand total of 12 bytes for the Integer object.

Is Hazelcast a load balancer?

Using a load balancer is perfect for traffic distribution across stateless services; however, Hazelcast is not stateless. Actually, Hazelcast is more like a sharded database in which each member contains a different part of the data. That is why it's suboptimal to randomly load balance the traffic.

How do you make a cluster on Hazelcast?

Create a Cluster of 3 Members. Start the Hazelcast Management Center. Add data to the cluster using a sample client in the language of your choice. Add and remove some cluster members to demonstrate automatic rebalancing of data and back-ups.


3 Answers

Just create a simple class that calls HazelCast.init

There are a number of test classes in the com.hazelcast.examples package which can be run from the bin directory of the hazelcast distribution.

like image 50
bstick12 Avatar answered Oct 14 '22 11:10

bstick12


TL;DR

Newer version:

java -cp hazelcast-3.7.2.jar com.hazelcast.core.server.StartServer

Older version:

java -cp hazelcast-2.0.3.jar com.hazelcast.examples.StartServer

This will start a standalone Hazelcast instance


If you're using maven:

mvn -DgroupId=com.hazelcast -DartifactId=hazelcast -Dversion=3.7.2 dependency:get

cd ~/.m2/repository/com/hazelcast/hazelcast/3.7.2

will get you to the folder with the jar

like image 20
Ravindranath Akila Avatar answered Oct 14 '22 12:10

Ravindranath Akila


You can get it to run by calling {hazelcast-directory}/bin/server.shor on Windows {hazelcast-directory}/bin/server.bat.

The configuration file can still be found in {hazelcast-directory}/bin/hazelcast.xml

This is an update to thSoft's answer as that way is no longer valid.

like image 24
DavidR Avatar answered Oct 14 '22 12:10

DavidR