Hazelcast localKeySet

Hazelcast localKeySet

我正在使用 hazelcast 3.10 版。我正在尝试使用 map localKeySet() 并发生以下情况:

我用这个功能配置了地图:

private MapConfig mapConfigurationAux (Config config, String name, int backupCount, boolean statisticsEnabled, int mapStoreDelay,
        MapStore implementationMapStore) {

        MapConfig mapConfig = config.getMapConfig (name);
        mapConfig.setBackupCount(backupCount);
        mapConfig.setInMemoryFormat(InMemoryFormat.OBJECT);
        mapConfig.setStatisticsEnabled(statisticsEnabled);

        if (implementationMapStore! = null) {
            MapStoreConfig mapStoreConfig = new MapStoreConfig();
            mapStoreConfig.setEnabled(true);
            mapStoreConfig.setImplementation(implementationMapStore);
            mapStoreConfig.setWriteDelaySeconds(mapStoreDelay);
            mapStoreConfig.setWriteBatchSize(100);
            mapStoreConfig.setInitialLoadMode(InitialLoadMode.LAZY);
            mapConfig.setMapStoreConfig(mapStoreConfig);
        }
        return mapConfig;
    }

我可能做错了什么?

我发现了问题 不出所料,我遇到了 Hazelcast 配置问题。在设置 NetWorkConfig 的界面中,它在集群的所有实例中设置 127.0.0.1。

NetworkConfig network = cfg.getNetworkConfig();
network.setPort(port).setPortAutoIncrement(true);
network.setPublicAddress(publicAddress);
network.getInterfaces().addInterface("127.0.0.1").setEnabled(true);