Cache map not showing up on Hazelcast Management Center

1,087 views
Skip to first unread message

Manish Kumar

unread,
Oct 12, 2016, 6:07:39 PM10/12/16
to Hazelcast
Hey Guys,

When I set the cache config as given below, that cache map doesn't show up on Hazelcast Management Center. I tried accessing the cache map at later stage and I was successfully able to read/write the data to the map.

hazelcastConfig.getMapConfigs().put("myMap", new MapConfig("Map1").setBackupCount(0).setAsyncBackupCount(0));

If I don't do it as mentioned above(basically not set any MapConfig) then it shows up on  Hazelcast Management Center.

Highly appreciate your help!!!

Ahmet Mircik

unread,
Oct 13, 2016, 3:43:54 AM10/13/16
to Hazelcast
Hi,

What were the hazelcast and management-center versions in use? Are you setting map config after hazelcast instance creation? Dynamic config is not supported for imap .

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/25cc9aaf-a151-441d-823b-c0c34a121360%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Manish Kumar

unread,
Oct 13, 2016, 10:17:42 AM10/13/16
to Hazelcast
Hazelcast version 3.6.3
Management Center Version - 3.7

No, we are creating the MapConfig before Hazelcast instance creation.

Hasan Çelik

unread,
Oct 13, 2016, 10:41:27 AM10/13/16
to Hazelcast
Hi Manish,

As expected, if you create map config but you do not touch map(put,get etc) , this map does not show up on management center.

Manish Kumar

unread,
Oct 13, 2016, 11:37:44 AM10/13/16
to Hazelcast
We did write/read on the same map in other places of our codebase, and it never showed up.

Please let me know if you guys want me to add a reproducer. 
Message has been deleted

Hasan Çelik

unread,
Oct 14, 2016, 5:34:53 AM10/14/16
to Hazelcast
I tried with multiple nodes but i could not reproduce this issue. It would be great if you add reproducer.

Manish Kumar

unread,
Oct 14, 2016, 9:52:36 AM10/14/16
to Hazelcast
Actually I was using Vertx + Hazelcast, where Vertx will initialize Hazelcast while I just pass the config object.

When I created a standalone Hazelcast project then I was able to see the maps on management center. So, I will look into what's going on with Vertx based project.

With standalone Hazelcast project, even though I had set the backup count to zero, on management center it was still showing the backup. I have added reproducer https://github.com/manish-panwar/hazelcast-map-not-showing-on-mancenter

Manish Kumar

unread,
Oct 14, 2016, 10:50:54 AM10/14/16
to Hazelcast
I also noticed one thing, if you put the map config using the same key as "map config name" then also it doesn't show on Management Center.

e.g. config.getMapConfigs().put("ABC", new MapConfig().setName("ABC").setStatisticsEnabled(false).setBackupCount(0).setAsyncBackupCount(0));

Hasan Çelik

unread,
Oct 17, 2016, 5:38:06 AM10/17/16
to Hazelcast
This problem is not related to map name or config name, is directly related to setStatisticsEnabled(falseconfig. Here is the my reproducer:

public class MapConfigDoesNotShowUp {
public static void main(String[] args) throws InterruptedException {

....
config.getMapConfigs().put("map1",new MapConfig("1").setStatisticsEnabled(false).setBackupCount(0).setAsyncBackupCount(0));
config.getMapConfigs().put("map2",new MapConfig("2").setBackupCount(0).setAsyncBackupCount(0));

HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
instance.getMap("map1").put("test","test");
instance.getMap("map2").put("test","test");
}
}

In the current status, management center starts to show map2 but it does not show map1. setStatisticsEnabled's default value is true for map.

14 Ekim 2016 Cuma 17:50:54 UTC+3 tarihinde Manish Kumar yazdı:

Manish Kumar

unread,
Oct 17, 2016, 11:41:18 AM10/17/16
to Hazelcast
Hasan,

Thanks a lot for looking into it! I am doing the code same as yours; surprisingly when I deploy this code on multiple node, I still see the backup for ABC & XYZ, on management center, but map1 & map2 there is not back up. How come it could be possible. Can you please take a look at my code?


public static void main(String[] args) {
Config config = new Config();

// Create Join Config with TCP.
config.getNetworkConfig().setJoin(new JoinConfig()
.setMulticastConfig(
new MulticastConfig().setEnabled(false))
.setTcpIpConfig(
new TcpIpConfig().setEnabled(true)
.addMember(getNetworkInterfaces().get(0)).addMember(getNetworkInterfaces().get(1))));
config.setManagementCenterConfig(
new ManagementCenterConfig()
.setEnabled(true)
.setUrl("http://1.1.1.1:8080/mancenter"));

config.getMapConfigs().put("map1",new MapConfig("1").setBackupCount(0).setAsyncBackupCount(0));

config.getMapConfigs().put("map2",new MapConfig("2").setBackupCount(0).setAsyncBackupCount(0));

    // If we remove below line then MAP start showing on Management Center.
config.getMapConfigs().put("111", new MapConfig("ABC").setBackupCount(0).setAsyncBackupCount(0));
config.getMapConfigs().put("222", new MapConfig("XYZ").setBackupCount(0).setAsyncBackupCount(0));

HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config);

hazelcastInstance.getMap("map1").put("test","test");
hazelcastInstance.getMap("map2").put("test","test");
hazelcastInstance.getMap("ABC").put("name", "manish");
hazelcastInstance.getMap("XYZ").put("name", "manish");
}

public static List<String> getNetworkInterfaces() {
try {
return list(NetworkInterface.getNetworkInterfaces()).stream()
.flatMap(ni -> list(ni.getInetAddresses()).stream())
.filter(address -> !address.isAnyLocalAddress())
.filter(address -> !address.isMulticastAddress())
.filter(address -> !address.isLoopbackAddress())
.filter(address -> !(address instanceof Inet6Address))
.map(InetAddress::getHostAddress)
.collect(Collectors.toList());
} catch (final SocketException ex) {
throw new RuntimeException("Unable to determine network interfaces for this node.", ex);
}
}

Hasan Çelik

unread,
Oct 18, 2016, 3:37:34 AM10/18/16
to Hazelcast
Manish,

config.getMapConfigs().put("111", new MapConfig("ABC").setBackupCount(0).setAsyncBackupCount(0));
                             |                    |
                        map name          config name
In this config, map name is 111 not ABC. So if you want to get this map (111), you should change your config like this:
hazelcastInstance.getMap("111").put("name", "manish");
And map 111's backup count will be 0.
----------

When you try to get map via this code, 
hazelcastInstance.getMap("ABC").put("name", "manish");
hazelcast creates new map its name is ABC and returns it. This map's backup is 1 because of default value of backup count.


For more options, visit https://groups.google.com/d/optout.
--

Hasan Celik
Software Engineer
Mahir İz Cad. No:35 34662 İstanbul

Manish Kumar

unread,
Oct 18, 2016, 11:55:36 AM10/18/16
to Hazelcast
Thanks a lot for your help, Hasan!!!
Reply all
Reply to author
Forward
0 new messages