Leandro carrasco
Leandro carrasco

Reputation: 111

Hazelcast localKeySet

I'm working with hazelcast version 3.10. I am trying to work with map localKeySet() and the following happens:

I configured the map with this function:

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;
    }

What I can be doing wrong?

Upvotes: 0

Views: 193

Answers (1)

Leandro carrasco
Leandro carrasco

Reputation: 111

I found the problem As expected, I had a Hazelcast configuration problem. In the interface that set the NetWorkConfig, it was setting 127.0.0.1 in all instances of the cluster.

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

Upvotes: 1

Related Questions