作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
I am using hazelCast-3.0 jars . I am able to create vertical cluster(on the same System where only port no. differ from one server to other Ip remains the same.) and its working pretty good.But i want to create horizontal cluster(where i can use any ip address along with any port no. depending on the configuration). If this is possible in hazelCast then please share how. i went through several links like http://www.hazelcast.com/docs/1.9.4/manual/multi_html/ch11.html
if this link is useful the suggest me how. I made only change to hazelcast.xml.
<tcp-ip enabled="true">
<hostname>172.22.65.111</hostname>
<hostname>172.22.68.19</hostname>
<interface>172.22.*.*</interface>
</tcp-ip>
在两个系统上都使用相同的 jar 文件。我创建一个 map 名称“xyz”并向其存储一些值。然后它应该可用于具有相同 map 名称“xyz”的其他系统。 这是我在我的系统上使用的代码 clientConfig.addAddress("172.22.65.111:5701"); System.out.println("p2"); HazelcastInstance 客户端 = HazelcastClient .newHazelcastClient(clientConfig);
IMap<Integer, String> map = client.getMap("m");
map.put(1,"ram");
除了 IP 和端口之外,第二个系统上也有相同的代码。相反,我正在尝试进入其他系统。
最佳答案
您的链接引用的是过时版本的手册。如果您按照
上的入门指南进行操作http://www.hazelcast.com/docs/3.0/manual/single_html/#GettingStarted
您应该能够通过在两台单独的计算机上启动示例代码来形成水平集群。
当前的 hazelcast 发行版还包含一个包含示例应用程序的 bin 文件夹。
关于java - 使用 HazelCast 进行水平聚类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18863686/
我是一名优秀的程序员,十分优秀!