问题
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?
回答1:
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.
回答2:
Szocske, we just tried this: http://blog.ilikeplaces.com/2012/05/hazelcast-starting-standalone-hazelcast.html
In summary,
java -cp hazelcast-2.0.3.jar com.hazelcast.examples.StartServer
回答3:
You can get it to run by calling {hazelcast-directory}/bin/server.sh
or 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.
回答4:
You can also simply run hazelcast/bin/start.sh
(the configuration file is hazelcast/bin/hazelcast.xml
).
来源:https://stackoverflow.com/questions/7205741/hazelcast-dedicated-nodes