简体   繁体   English

在hazelcast中自动聚类

[英]Auto clustering in hazelcast

I tested with the hazelcast-default.xml, 我用hazelcast-default.xml进行了测试,

What is happening is I have started a node 192.X.1.1 with port as 5701 and it becomes up and works like a fly, 发生的事情是我启动了一个端口为5701的节点192.X.1.1,它启动并像苍蝇一样运转,

Mean while, I started a node 192.X.1.2 with port 5701 and I wonder It does a mapping and join together, How to avoid that, 同时,我用端口5701启动了一个节点192.X.1.2,我想知道它是否进行了映射并连接在一起,如何避免这种情况,

Is the param cluster.min setting to '1', solves the problem??? 参数cluster.min设置为'1'可以解决问题吗???

I am assuming that by cluster min setting you mean hazelcast.initial.min.cluster.size . 我假设通过群集最小值设置,您的意思是hazelcast.initial.min.cluster.size。 That is unrelated to this issue. 那与这个问题无关。 This property simply requires an x number of nodes to join the cluster before starting your application. 在启动应用程序之前,此属性仅需要x个节点即可加入集群。

What you are looking for depends on whether you are using multicast or TCP-IP to discover nodes. 您要寻找的内容取决于您是使用多播还是使用TCP-IP来发现节点。 See this book for details: http://hazelcast.com/resources/mastering-hazelcast/ 有关详情,请参见本书: http : //hazelcast.com/resources/mastering-hazelcast/

In case of multicasting you need to set groups, and add the nodes to different groups. 如果是多播,则需要设置组,并将节点添加到不同的组。

You could also simply define interfaces such as: 192.168.24.* 您也可以简单地定义接口,例如:192.168.24。*

with the range of IP you want to by accepted by your cluster. 与群集要接受的IP范围。

Finally if you are using TCP-IP you need to define the ip of the nodes that will join your cluster. 最后,如果您使用的是TCP-IP,则需要定义将加入集群的节点的ip。 A simple example being : 一个简单的例子是:

            <hz:join>
                <hz:multicast enabled="false" />
                <hz:tcp-ip enabled="true">
                    <hz:members>192.168.0.1</hz:members>
                </hz:tcp-ip>
            </hz:join>

(Example shown are using spring configuration) (所示示例使用弹簧配置)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM