BetaRide
BetaRide

Reputation: 16834

How to make Hazelcast Management Center find its Nodes in docker?

I'm trying to set-up hazelcast and the management center for developement using docker. Unfortunately the management center does not find the hazelcast node.

I startet hazelcast and the management center on my machine as instructed here https://hub.docker.com/r/hazelcast/hazelcast

I do geht the following message when I enter the management center:

enter image description here

I tried to enter the missing information in the form like this:

enter image description here

but I don't find the correct values to get this working. Any ideas whats wrong?

I used this commands to start docker:

docker run -e JAVA_OPTS="-Dhazelcast.local.publicAddress=162.168.1.136:5701" -p 5701:5701 hazelcast/hazelcast:3.12.5
docker run -e MC_INIT_CMD="./mc-conf.sh cluster add -H=/data -ma 192.168.1.136:5701 -cn dev" -p 8080:8080 hazelcast/management-center:3.12.5

This gives the following output, which looks fine to me:

ue73011@K57176 ~                                                                                                                                                                                                                           
$ docker run -e JAVA_OPTS="-Dhazelcast.local.publicAddress=162.168.1.136:5701" -p 5701:5701 hazelcast/hazelcast:3.12.5                                                                                                                     
+ exec java -server -Dhazelcast.mancenter.enabled=false -Djava.net.preferIPv4Stack=true -Djava.util.logging.config.file=/opt/hazelcast/logging.properties -Dhazelcast.local.publicAddress=162.168.1.136:5701 com.hazelcast.core.server.Star
tServer                                                                                                                                                                                                                                    
########################################                                                                                                                                                                                                   
# JAVA_OPTS=-Dhazelcast.mancenter.enabled=false -Djava.net.preferIPv4Stack=true -Djava.util.logging.config.file=/opt/hazelcast/logging.properties -Dhazelcast.local.publicAddress=162.168.1.136:5701                                       
# CLASSPATH=/opt/hazelcast/*:/opt/hazelcast/lib/*                                                                                                                                                                                          
# starting now....                                                                                                                                                                                                                         
########################################                                                                                                                                                                                                   
Apr 29, 2020 4:15:20 AM com.hazelcast.config.AbstractConfigLocator                                                                                                                                                                         
INFO: Loading 'hazelcast.xml' from the working directory.                                                                                                                                                                                  
Apr 29, 2020 4:15:21 AM com.hazelcast.config.ConfigReplacerHelper                                                                                                                                                                          
WARNING: Could not find a replacement for '${hazelcast.mancenter.url}' on node 'null'                                                                                                                                                      
Apr 29, 2020 4:15:21 AM com.hazelcast.config.AbstractXmlConfigHelper                                                                                                                                                                       
WARNING: Name of the hazelcast schema location is incorrect, using default                                                                                                                                                                 
Apr 29, 2020 4:15:21 AM com.hazelcast.instance.AddressPicker                                                                                                                                                                               
INFO: [LOCAL] [dev] [3.12.5] Prefer IPv4 stack is true, prefer IPv6 addresses is false                                                                                                                                                     
Apr 29, 2020 4:15:21 AM com.hazelcast.instance.AddressPicker                                                                                                                                                                               
INFO: [LOCAL] [dev] [3.12.5] Picked [172.17.0.2]:5701, using socket ServerSocket[addr=/0.0.0.0,localport=5701], bind any local is true                                                                                                     
Apr 29, 2020 4:15:21 AM com.hazelcast.instance.AddressPicker                                                                                                                                                                               
INFO: [LOCAL] [dev] [3.12.5] Using public address: [162.168.1.136]:5701                                                                                                                                                                    
Apr 29, 2020 4:15:21 AM com.hazelcast.system                                                                                                                                                                                               
INFO: [162.168.1.136]:5701 [dev] [3.12.5] Hazelcast 3.12.5 (20191210 - 294ff46) starting at [162.168.1.136]:5701                                                                                                                           
Apr 29, 2020 4:15:21 AM com.hazelcast.system                                                                                                                                                                                               
INFO: [162.168.1.136]:5701 [dev] [3.12.5] Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.                                                                                                                                    
Apr 29, 2020 4:15:21 AM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator                                                                                                                                                 
INFO: [162.168.1.136]:5701 [dev] [3.12.5] Backpressure is disabled                                                                                                                                                                         
Apr 29, 2020 4:15:22 AM com.hazelcast.instance.Node                                                                                                                                                                                        
INFO: [162.168.1.136]:5701 [dev] [3.12.5] Creating MulticastJoiner                                                                                                                                                                         
Apr 29, 2020 4:15:22 AM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl                                                                                                                                                
INFO: [162.168.1.136]:5701 [dev] [3.12.5] Starting 2 partition threads and 3 generic threads (1 dedicated for priority tasks)                                                                                                              
Apr 29, 2020 4:15:22 AM com.hazelcast.internal.diagnostics.Diagnostics                                                                                                                                                                     
INFO: [162.168.1.136]:5701 [dev] [3.12.5] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.                                                                                                   
Apr 29, 2020 4:15:22 AM com.hazelcast.core.LifecycleService                                                                                                                                                                                
INFO: [162.168.1.136]:5701 [dev] [3.12.5] [162.168.1.136]:5701 is STARTING                                                                                                                                                                 
Apr 29, 2020 4:15:25 AM com.hazelcast.internal.cluster.ClusterService                                                                                                                                                                      
INFO: [162.168.1.136]:5701 [dev] [3.12.5]                                                                                                                                                                                                  

Members {size:1, ver:1} [                                                                                                                                                                                                                  
        Member [162.168.1.136]:5701 - 84049f1a-2343-42ab-85b8-5edba08567b5 this                                                                                                                                                            
]                                                                                                                                                                                                                                          

Apr 29, 2020 4:15:25 AM com.hazelcast.core.LifecycleService                                                                                                                                                                                
INFO: [162.168.1.136]:5701 [dev] [3.12.5] [162.168.1.136]:5701 is STARTED                                                                                                                                                                  

ue73011@K57176 ~                                                                                                                                                                                                                           
$ docker run -e MC_INIT_CMD="./mc-conf.sh cluster add -H=/data -ma 192.168.1.136:5701 -cn dev" -p 8080:8080 hazelcast/management-center:3.12.5                                                                                              
########################################                                                                                                                                                                                                   
# JAVA_OPTS=-Dhazelcast.mancenter.home=/data -Djava.net.preferIPv4Stack=true                                                                                                                                                               
# MC_CLASSPATH=/opt/hazelcast/mancenter/hazelcast-mancenter-3.12.5.war                                                                                                                                                                     
# starting now....                                                                                                                                                                                                                         
########################################                                                                                                                                                                                                   
+ exec java --add-opens java.base/java.lang=ALL-UNNAMED -server -Dhazelcast.mancenter.home=/data -Djava.net.preferIPv4Stack=true -cp /opt/hazelcast/mancenter/hazelcast-mancenter-3.12.5.war Launcher 8080 8443 hazelcast-mancenter        
2020-04-29 04:16:51 [main] INFO  c.h.webmonitor.config.BuildInfo - Management Center 3.12.5                                                                                                                                                
2020-04-29 04:16:55 [main] INFO  c.h.w.storage.DiskUsageMonitor - Monitoring /data [mode=purge, interval=1000ms, limit=512 MB]                                                                                                             
2020-04-29 04:17:07 [main] INFO  c.h.webmonitor.config.SqlDbConfig - Checking DB for required migrations.                                                                                                                                  
2020-04-29 04:17:08 [main] INFO  c.h.webmonitor.config.SqlDbConfig - Number of applied DB migrations: 2.                                                                                                                                   
2020-04-29 04:17:08 [main] INFO  c.h.w.s.s.impl.DisableLoginStrategy - Login will be disabled for 5 seconds after 3 failed login attempts. For every 3 consecutive failed login attempts, disable period will be multiplied by 10.
2020-04-29 04:17:10 [main] INFO  Launcher - Hazelcast Management Center successfully started at http://localhost:8080/hazelcast-mancenter

Upvotes: 0

Views: 2183

Answers (1)

Rafał Leszko
Rafał Leszko

Reputation: 5531

You use the commands for Hazelcast (and Management Center) version 4.0, but you actually run images 3.12.5. The mechanism how Management Center is connected has changed. So you need to either use the most recent version or apply the instructions for 3.12.5, like this:

$ docker run -p 8080:8080 hazelcast/management-center:3.12.5
$ docker run -p 5701:5701 -e MANCENTER_URL="http://<host_ip>:8080/hazelcast-mancenter" -e JAVA_OPTS="-Dhazelcast.local.publicAddress=<host_ip>:5701" hazelcast/hazelcast:3.12.5

Upvotes: 3

Related Questions