Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • JAVA_HOME at the monitored hosts
  • MZ_HOME of containers
  • HA ports of pico instances

 


The HA script interface with the HA Monitor Server 


The monitor script interfaces the HA Monitor Server of a pico instance. By default, the scripts uses the following exit codes:

...

  1. The CMS executes the monitor script. 

    Code Block
    languagetext
    themeEclipse
    $ ./monitor <$JAVA_HOME> <$MZ_HOME> <username> <mz.ha.port> [host] [sec_timeout] [debug]

    The username argument is included for use in modified monitor scripts. 

    By default, the host argument is omitted, this will cause the HA Client to connect to localhost.

    Use the optional argument sec_timeout to specify a timeout threshold, for the response from the HA Monitor Server. For additional debug information on stdout add the argument debug.  


  2. The monitor script calls the HA Client to pull the HA monitor server for information about the pico instance. 

    Code Block
    languagetext
    themeEclipse
    ...
    # Execute the ping command
    
    $java_home/bin/java -cp $mz_home/lib/ha.jar com.digitalroute.ha.HAClient $port $@ 2>&1
    
    ...


  3. The monitor script uses the status from ha.jar to return the appropriate exit code to the CMS.

    Code Block
    languagetext
    themeEclipse
    ...
    # Collect the result
    
    result=$? 
    
    # If the result differ from "0" then the command failed.
    
    if [ "$result" != "0" ] ; then
    
        echo "FAILED"
    
        exit 100
    
    else
    
        echo "OK"
    
        exit 110
    
    fi
    ...


  4. The CMS acts upon this information. In case of failure (indicated by exit code), the offline scripts followed by the clean script should be executed. 

    Code Block
    languagetext
    themeEclipse
    $ ./offline <$JAVA_HOME> <$MZ_HOME> mzadmin <pico> ...
    $ ./clean <$JAVA_HOME> <$MZ_HOME> mzadmin <pico> ...

    The offline script is used to gracefully stop the pico instances. It must be executed when the Platform availability evaluation fails.

    The clean script is used to terminate the pico instances immediately and should always be used if the offline script fails. It will also attempt to remove any terminated SCs, from Akka clusters by calling the mzsh command akka down.    


  5. The CMS executes the online script to start a new pico instance, e g in a different container.

    Code Block
    languagetext
    themeEclipse
    $ ./online <$JAVA_HOME> <$MZ_HOME> mzadmin <pico> ...


...

You can communicate with a HA Monitor Server via telnet. The following commands are supported:

CommandDescription
helpLists the available commands
ping <pico_name>Checks the pico client(s) for availability.
quitCloses the connection
exitCloses the connection


Scroll ignore
scroll-viewportfalse
scroll-pdftrue
scroll-officefalse
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmlfalse


Next: