Start Hazelcast standalone server

0
1279
Hazelcast
Hazelcast

Hazelcast can be started as a standalone server, not just being embeded into Java applications.

This can be done via execute the start up script inside the bin directory of the downloaded Hazelcast package.

If you’re on Windows, run the start.bat , or if you’re on Linux, run the start.sh, you will see something like following:


Aug 15, 2017 8:37:40 PM com.hazelcast.config.XmlConfigLocator
INFO: Loading 'hazelcast.xml' from working directory.
Aug 15, 2017 8:37:40 PM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.8.4] Prefer IPv4 stack is true.
Aug 15, 2017 8:37:40 PM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.8.4] Picked [192.168.1.5]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
Aug 15, 2017 8:37:40 PM com.hazelcast.system
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Hazelcast 3.8.4 (20170809 - 297a77e) starting at [192.168.1.5]:5701
Aug 15, 2017 8:37:40 PM com.hazelcast.system
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
Aug 15, 2017 8:37:40 PM com.hazelcast.system
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Configured Hazelcast Serialization version : 1
Aug 15, 2017 8:37:40 PM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Backpressure is disabled
Aug 15, 2017 8:37:41 PM com.hazelcast.instance.Node
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Creating MulticastJoiner
Aug 15, 2017 8:37:41 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Starting 8 partition threads
Aug 15, 2017 8:37:41 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Starting 5 generic threads (1 dedicated for priority tasks)
Aug 15, 2017 8:37:41 PM com.hazelcast.core.LifecycleService
INFO: [192.168.1.5]:5701 [dev] [3.8.4] [192.168.1.5]:5701 is STARTING
Aug 15, 2017 8:37:44 PM com.hazelcast.system
INFO: [192.168.1.5]:5701 [dev] [3.8.4] Cluster version set to 3.8
Aug 15, 2017 8:37:44 PM com.hazelcast.internal.cluster.impl.MulticastJoiner
INFO: [192.168.1.5]:5701 [dev] [3.8.4]


Members [1] {
        Member [192.168.1.5]:5701 - 97c2bc85-9aeb-4dfb-a4db-30f910614460 this
}

Aug 15, 2017 8:37:44 PM com.hazelcast.core.LifecycleService
INFO: [192.168.1.5]:5701 [dev] [3.8.4] [192.168.1.5]:5701 is STARTED

You will the part Members, which will list of all Hazelcast nodes on network with this keyword postfix to indicate the current machine.
So the log is saying, the Hazelcast server has been started successfully.

Another way to start Hazelcast server is to issue a Java execution command. The distribution package contains a JAR file named lib\hazelcast-all-x.x.x.jar.
What you need to do is to type the following command:


$ java -jar hazelcast-all-x.x.x.jar com.hazelcast.core.server.StartServer

and the server will start.

Note that, Hazelcast server will start with the config file in bin\hazelcast.xml, so make sure to update necessary information before starting the server.