Hazelcast 专用节点
在专用服务器上运行 Hazelcast 节点的最简单方法是什么?
我们有一个使用 Hazelcast 分布式地图的 Web 应用程序。 目前,Hazelcast 节点配置为在 Servlet 容器节点中运行。
随着规模的扩大,我们希望添加专用硬件作为 Hazelcast 节点。
然后我们将不再需要 Servlet 容器中的完整 Hazelcast 节点,这些节点可以是客户端。 (Servlet 容器有相关的许可成本,因此减轻它们的负载很好,不要问...)
所以问题是,最小的 Hazelcast 节点安装是什么?类似于 memcached 安装的东西。 它所需要做的就是读取配置并启动,无需本地客户端。
我看到它支持 Jetty,但是是否需要它,或者这些 jar 中有一些简单的类我可以在 JVM 原始上执行吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只需创建一个简单的类,调用 HazelCast.init
com.hazelcast.examples 包中有许多测试类,可以从 hazelcast 发行版的 bin 目录运行。
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.TL;DR
新版本:
java -cp hazelcast-3.7.2.jar com.hazelcast.core.server.StartServer
旧版本:
java -cp hazelcast- 2.0.3.jar com.hazelcast.examples.StartServer
这将启动一个独立的 Hazelcast 实例
如果您使用的是 Maven:
mvn -DgroupId=com.hazelcast -DartifactId=hazelcast -Dversion=3.7.2 dependency:get
cd ~/.m2/repository/com/hazelcast/hazelcast/3.7.2
将带您进入包含 jar 的文件夹
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
您可以通过调用
{hazelcast-directory}/bin/server.sh
或在 Windows{hazelcast-directory}/bin/server.bat
上运行它。配置文件仍然可以在
{hazelcast-directory}/bin/hazelcast.xml
中找到。这是对 thSoft 答案的更新,因为这种方式不再有效。
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.
您也可以简单地运行
hazelcast/bin/start.sh
(配置文件为hazelcast/bin/hazelcast.xml
)。You can also simply run
hazelcast/bin/start.sh
(the configuration file ishazelcast/bin/hazelcast.xml
).