Book Image

Getting Started with Hazelcast, Second Edition

By : Matthew Johns
Book Image

Getting Started with Hazelcast, Second Edition

By: Matthew Johns

Overview of this book

Table of Contents (19 chapters)
Getting Started with Hazelcast Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Showing off straightaway


Within the Hazelcast JAR file, there is a very useful ConsoleApp utility class (this class was previously known as TestApp, but the name was a little deceptive as it can be used for operations beyond just testing). It is great in that it provides a simple text console for easy access to the distributed collections.

To fire this up, we need to run this class using the Hazelcast JAR file as the classpath. Alternatively, we can also use the console scripts that were provided in the demo/ directory.

$ java -cp hazelcast-3.5.jar com.hazelcast.console.ConsoleApp

This should bring up a fair amount of verbose logging, but a reassuring section to look for so that we can see that a cluster has been formed, is the following output:

Members [1] {
    Member [127.0.0.1]:5701 this
}

The output lets us know that a new cluster comprising a node has been created. The current node is indicated by this. The configuration, which is the default built-in JAR, was used to start up the instance...