简体   繁体   English

Hazelcast:禁用集群

[英]Hazelcast: disable clustering

I'm using Hazelcast on a java project, but I only use a single node and do not want any clustering.我在 java 项目上使用 Hazelcast,但我只使用单个节点并且不需要任何集群。 It's actually causing us issues when several dev instances discover each other and form a cluster.当几个开发实例相互发现并形成一个集群时,它实际上给我们带来了问题。

Is there a way to fully disable clustering in the xml configuration?有没有办法在 xml 配置中完全禁用集群?

Edit: I'm using Hazelcast 3.8.4, I've tried disabling multicast like so, but it looks like it's still enabled:编辑:我正在使用 Hazelcast 3.8.4,我尝试过像这样禁用多播,但看起来它仍然处于启用状态:

    <hz:hazelcast id="hazelcast">
        <hz:config>
            <hz:group name="dev" password="password"/>
            <hz:properties>
                <hz:property name="hazelcast.logging.type">slf4j</hz:property>
            </hz:properties>
            <hz:network port="5701" port-auto-increment="true">
                <hz:join>
                    <hz:multicast enabled="false"/>
                </hz:join>
            </hz:network>
            <hz:topic name="topicStuff"/>
        </hz:config>
    </hz:hazelcast>

Logs:日志:

12:54:51,273 INFO  [com.hazelcast.hibernate.HazelcastLocalCacheRegionFactory] - Starting up HazelcastLocalCacheRegionFactory
12:54:51,284 INFO  [com.hazelcast.config.XmlConfigLocator] - Loading 'hazelcast-default.xml' from classpath.
12:54:51,398 INFO  [com.hazelcast.instance.DefaultAddressPicker] - [LOCAL] [dev] [3.8.4] Prefer IPv4 stack is true.
12:54:51,409 INFO  [com.hazelcast.instance.DefaultAddressPicker] - [LOCAL] [dev] [3.8.4] Picked [10.212.134.200]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true 
12:54:51,426 INFO  [com.hazelcast.system] - [10.212.134.200]:5701 [dev] [3.8.4] Hazelcast 3.8.4 (20170809 - 297a77e) starting at [10.212.134.200]:5701
12:54:51,426 INFO  [com.hazelcast.system] - [10.212.134.200]:5701 [dev] [3.8.4] Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
12:54:51,426 INFO  [com.hazelcast.system] - [10.212.134.200]:5701 [dev] [3.8.4] Configured Hazelcast Serialization version : 1
12:54:51,648 INFO  [com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator] - [10.212.134.200]:5701 [dev] [3.8.4] Backpressure is disabled
12:54:52,088 INFO  [com.hazelcast.instance.Node] - [10.212.134.200]:5701 [dev] [3.8.4] Creating MulticastJoiner
12:54:52,219 INFO  [com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl] - [10.212.134.200]:5701 [dev] [3.8.4] Starting 12 partition threads 
12:54:52,220 INFO  [com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl] - [10.212.134.200]:5701 [dev] [3.8.4] Starting 7 generic threads (1 dedicated for priority tasks)
12:54:52,241 INFO  [com.hazelcast.core.LifecycleService] - [10.212.134.200]:5701 [dev] [3.8.4] [10.212.134.200]:5701 is STARTING
12:54:54,286 INFO  [com.hazelcast.system] - [10.212.134.200]:5701 [dev] [3.8.4] Cluster version set to 3.8
12:54:54,289 INFO  [com.hazelcast.internal.cluster.impl.MulticastJoiner] - [10.212.134.200]:5701 [dev] [3.8.4] 


Members [1] {   Member [10.212.134.200]:5701 - 820072f4-f1ef-4a5e-9722-eb2bd038f37e this }

12:54:54,361 INFO  [com.hazelcast.core.LifecycleService] - [10.212.134.200]:5701 [dev] [3.8.4] [10.212.134.200]:5701 is STARTEDsdf

When no join method is enabled, Hazelcast starts in standalone mode.当未启用任何加入方法时,Hazelcast 以独立模式启动。 Prior to version 4.1, the default join method is multicast and when it's disabled, the member will start standalone:在 4.1 版本之前,默认加入方法是多播,当它被禁用时,成员将独立启动:

<network>
    <join>
        <multicast enabled="false"/>
    </join>
</network>

which yields the log:产生日志:

WARNING: [192.168.1.3]:5701 [dev] [4.0] No join method is enabled! Starting standalone.

With version 4.1, this becomes在 4.1 版中,这变成了

<network>
    <join>
        <auto-detection enabled="false"/>
    </join>
</network>

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

相关问题 在hazelcast中自动聚类 - Auto clustering in hazelcast 使用HazelCast的水平聚类 - Horizontal Clustering using HazelCast 使用Hazelcast而不是Web进行Shiro会话群集 - Shiro Session Clustering with Hazelcast, not on the Web 在 WildFly 18 上使用 Spring Session 和 HazelCast IMDG 进行会话复制和集群 - Session Replication and clustering using Spring Session and HazelCast IMDG on WildFly 18 如何禁用Spring / Hibernate / Hazelcast联合缓存? - How to disable Spring/Hibernate/Hazelcast joint cache? 用于Tomcat6 Web群集的P2P Hazelcast会话复制-会话同步失败 - P2P Hazelcast Session Replication for Tomcat6 Web Clustering - Session Synchronization Fails 如何在春季启动时禁用Hazelcast的默认关闭挂钩 - How to disable default shutdown hook of Hazelcast in spring boot 使用 ApplicationContext 运行 JUnit 测试时禁用 Hazelcast 实例 - Disable Hazelcast instance while running JUnit test with ApplicationContext 为了安全起见,如何在某些节点上禁用Hazelcast分布式IExecutorService? - How to disable Hazelcast distributed IExecutorService on certain nodes for security purposes? 使用Googles android-maps-utils以最大缩放级别禁用群集 - Disable clustering at max zoom level with Googles android-maps-utils
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM