从 3.5 升级到 3.8 后 Hazelcast 不工作

Hazelcast not working after upgrade from 3.5 to 3.8

一旦我将 hazelcast 从 3.5 升级到 3.8,缓存就不会发生。一旦我恢复到 3.5,它在使用 3.8 开始我的项目时工作正常,我得到 log as

Jul 02, 2018 10:02:00 AM com.hazelcast.config.XmlConfigLocator
INFO: Loading 'hazelcast.xml' from classpath.

当我恢复到 3.5 时,日志显示

Jul 02, 2018 10:07:58 AM com.hazelcast.config.XmlConfigLocator
INFO: Loading 'hazelcast.xml' from classpath.
Jul 02, 2018 10:07:58 AM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.5] Prefer IPv4 stack is true.
Jul 02, 2018 10:07:58 AM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.5] Picked Address[172.30.66.245]:5701, using socket ServerSocket[addr=/172.30.66.245,localport=5701], bind any local is false
Jul 02, 2018 10:07:58 AM com.hazelcast.spi.OperationService
INFO: [172.30.66.245]:5701 [dev] [3.5] Backpressure is disabled
Jul 02, 2018 10:07:58 AM com.hazelcast.spi.impl.operationexecutor.classic.ClassicOperationExecutor
INFO: [172.30.66.245]:5701 [dev] [3.5] Starting with 2 generic operation threads and 4 partition operation threads.
Jul 02, 2018 10:07:58 AM com.hazelcast.system
INFO: [172.30.66.245]:5701 [dev] [3.5] Hazelcast 3.5 (20150617 - 4270dc6) starting at Address[172.30.66.245]:5701
Jul 02, 2018 10:07:58 AM com.hazelcast.system
INFO: [172.30.66.245]:5701 [dev] [3.5] Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.
Jul 02, 2018 10:07:58 AM com.hazelcast.core.LifecycleService
INFO: [172.30.66.245]:5701 [dev] [3.5] Address[172.30.66.245]:5701 is STARTING
Jul 02, 2018 10:07:58 AM com.hazelcast.instance.Node
WARNING: [172.30.66.245]:5701 [dev] [3.5] No join method is enabled! Starting standalone.
Jul 02, 2018 10:07:58 AM com.hazelcast.core.LifecycleService
INFO: [172.30.66.245]:5701 [dev] [3.5] Address[172.30.66.245]:5701 is STARTED
Jul 02, 2018 10:07:58 AM com.hazelcast.internal.management.ManagementCenterService
INFO: [172.30.66.245]:5701 [dev] [3.5] Hazelcast will connect to Hazelcast Management Center on address: 
http://localhost:8080/mancenter

Hazelcast.xml

<?xml version="1.0" encoding="UTF-8"?>
<hazelcast
    xsi:schemaLocation="http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-config-3.8.xsd "
    xmlns="http://www.hazelcast.com/schema/config " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <network>
        <port>5701</port>
        <outbound-ports>
            <!-- Allowed port range when connecting to other nodes. 0 or * means use 
                system provided port. -->
            <ports>0</ports>
        </outbound-ports>
        <join>
            <multicast enabled="false" />
        </join>
    </network>

    <properties>
        <property name="hazelcast.health.monitoring.level">OFF</property>
        <property name="hazelcast.logging.type">log4j</property> 
    </properties>
</hazelcast>

有人,请帮助我。

@Prajeesh,我使用了你的配置并成功启动了一个成员:

INFO: [192.168.5.73]:5701 [dev] [3.8] [192.168.5.73]:5701 is STARTING
Jul 02, 2018 10:55:03 AM com.hazelcast.instance.Node
WARNING: [192.168.5.73]:5701 [dev] [3.8] No join method is enabled! Starting 
standalone.
Jul 02, 2018 10:55:03 AM com.hazelcast.system
INFO: [192.168.5.73]:5701 [dev] [3.8] Cluster version set to 3.8
Jul 02, 2018 10:55:03 AM com.hazelcast.core.LifecycleService
INFO: [192.168.5.73]:5701 [dev] [3.8] [192.168.5.73]:5701 is STARTED

我只删除了 log4j 属性。我相信您的类路径中有一个 log4j 配置并使用了一个文件,因此您看不到日志。我使用了 3.8 和 3.10,两者都运行良好。

我觉得你的XML不对。

你有

xmlns="http://www.hazelcast.com/schema/config "

这应该是

xmlns="http://www.hazelcast.com/schema/config"

即。没有尾随 space.

问题的解决方案是配置中有错字\

我有这个

xmlns="http://www.hazelcast.com/schema/config "

正确的应该是

xmlns="http://www.hazelcast.com/schema/config"