0
votes

I am trying to run hazelcast-man center with following configuration

   Config config = new Config();
    config.getManagementCenterConfig().setEnabled(true);
 config.getManagementCenterConfig()
      .setUrl("http://localhost:8080/mancenter/");
    HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);

then console output is :-

`Jun 03, 2018 12:25:07 PM com.hazelcast.instance.Node WARNING: [192.168.43.9]:5705 [dev] [3.8.1] Config seed port is 5701 and cluster size is 1. Some of the ports seem occupied! Jun 03, 2018 12:25:07 PM com.hazelcast.internal.management.ManagementCenterService INFO: [192.168.43.9]:5705 [dev] [3.8.1] Hazelcast will connect to Hazelcast Management Center on address: http://localhost:8080/mancenter/ Jun 03, 2018 12:25:07 PM com.hazelcast.core.LifecycleService INFO: [192.168.43.9]:5705 [dev] [3.8.1] [192.168.43.9]:5705 is STARTED Jun 03, 2018 12:25:08 PM com.hazelcast.internal.partition.impl.PartitionStateManager INFO: [192.168.43.9]:5705 [dev] [3.8.1] Initializing cluster partition table arrangement... Jun 03, 2018 12:25:08 PM com.hazelcast.internal.management.ManagementCenterService INFO: [192.168.43.9]:5705 [dev] [3.8.1] Failed to pull tasks from management center Jun 03, 2018 12:25:08 PM com.hazelcast.internal.management.ManagementCenterService WARNING: [192.168.43.9]:5705 [dev] [3.8.1] Failed to send response, responseCode:404 url:http://localhost:8080/mancenter/collector.do

`

2
Can you please check if your Management Center deployed at "localhost:8080/mancenter"? It looks like Hazelcast cluster cannot find Management Center at the configured address.Alparslan Avci
I deployed man-center war in tomcat webapps. it is getting extracted and there is no error log of tomcat server but "localhost:8080/mancenter/" is giving 404.user1221
if I remove war from tomcat and i start hazelcast from terminal using this command java -jar /path/to/war 8080 mancenter , then it says address already in useuser1221
Can you try to clear port 8080 and try again with java -jar ... command? Or you can try a different port altogethersertug
What is the import associated with the Config class? Can't seem to find reference to this in documentation(?). Can this configuration somehow be integrated/combined with JCache's MutableConfiguration?sairn

2 Answers

0
votes

When you run the Hazelcast Management Center WAR file directly java -jar hazelcast-mancenter-[version].war

then an embedded Jetty is used and the URL is

  • http://localhost:8080/hazelcast-mancenter/ in newer versions (3.10+)
  • http://localhost:8080/mancenter/ in older versions (3.9 and older)

If you deploy the WAR file into a application server or a servlet container of your choice, then

  • either use the default path - usually just copy the WAR name without suffix into URL (E.g. if you have hazelcast-mancenter-3.10.1.war, then the URL will be http://localhost:8080/hazelcast-mancenter-3.10.1/)
  • or use your server native way to change the context path.

Tomcat

When you are deploying into Tomcat container, you can change the context path by editing [TOMCAT_INSTALLATION]/conf/server.xml file. For instance if you want to deploy hazelcast-mancenter-3.10.1.war under /hazelcast-mancenter/ path, then

  • copy the WAR into [TOMCAT_INSTALLATION]/webapps/ directory
  • add a new <context/> element under the <host/> element in server.xml:
<Server ...>
  <!-- ... -->
  <Service ...>
    <!-- ... -->
    <Engine ...>
      <!-- ... -->
      <Host ...>
        <!-- ... -->
        <Context docBase="hazelcast-mancenter-3.10.1.war" path="/hazelcast-mancenter"/>
      </Host>
    </Engine>
  </Service>
</Server>
0
votes

As far as I can see the problem is that you are running both the your hazelcast-mancenter and your project in same ports i.e 8080. I would recommend you to change the port in tomcat configuration.