Book Image

Getting Started with Hazelcast

By : Matthew Johns
Book Image

Getting Started with Hazelcast

By: Matthew Johns

Overview of this book

Table of Contents (18 chapters)
Getting Started with Hazelcast
About the Author
About the Reviewers

Showing off straightaway

Within the Hazelcast JAR, there is the very useful utility class TestApp. The class name is a little deceptive as it can be used in more ways than just testing, but its greatest offering is that it provides a simple text console for easy access to distributed collections.

To fire this up, we need to run this class using the Hazelcast JAR as the classpath.

$ java -cp hazelcast-2.6.jar com.hazelcast.examples.TestApp

This should bring up a fair amount of verbose logging, but a reassuring section to look for to show that a cluster has been formed is the following code:

Members [1] {
    Member []:5701 this

This lets us know that a new cluster of one node has been created with the node indicated by this. The configuration that was used to start up this instance is the default one built into the JAR. You can find a copy of it at bin/hazelcast.xml from within the unpacked archive that we downloaded in the previous section. We should now be presented with a basic...