Showing master/slave status on failover activemq

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Showing master/slave status on failover activemq

Russ
We have a glu script that is controlling a standalone activemq.   It monitors the status by checking the process status and checking the network ports.   This has been up and working for over a year.  We are in the process of extending that module to handle activemq in failover mode using a shared file system.  When activemq is in standby mode, the process is up but it is not listening on the desired ports.   Our glu script can take advantage of this behavior to determine the master and present that information.   I'd like to get some ideas on how best to manage and display this extra "state" (e.g. activemq running + master versus activemq up as standby)
Reply | Threaded
Open this post in threaded view
|

Re: Showing master/slave status on failover activemq

sodul
If I understand your question correctly, for the display part I can think of two options, both rely on the fact the the groovy script 'variables' are shared back to the console in real time through zookeeper.
- first option is to change the monitoring variable that get returned to be something else than 'running' and 'stopped', but you are overloading the meaning of this field.
- second option is to create a new variable to set to 'master' or 'slave', and add column in your default display. However you'll need to ask everyone to reset their view to clone the one in the groovy config or customize it by hand.
Reply | Threaded
Open this post in threaded view
|

Re: Showing master/slave status on failover activemq

Russ
Thank you for the ideas.   That is very helpful and will force us to upgrade.   We're using 4.7.1.   While a glu upgrade has been on the plate for some time, other things kept pre-empting the upgrade.  This will probably be the driver to implement the upgrade.
Reply | Threaded
Open this post in threaded view
|

Re: Showing master/slave status on failover activemq

frenchyan
Administrator
I don't think that what Stephane suggested required a glu upgrade (although you are free to spin it this way to your team if it can accelerate the upgrade as 4.7.1 is quite old now :).

I would suggest something similar to Stephane's proposal: you really have 2 states: health (up vs running) and role (slave vs master) => I would add a field to the glu script (something like activemqRole) which will have the value master or slave.

That way the field will make it all the way in the console and you can simply add a column in the dashboard to display this value.

Then in regards to health I would use the way you use now (at least I suppose is what you do) which is what is done in the example JettyGluScript: use the error state and state machine of the glu script to handle this => it gets reflected on the dashboard as a red row when not up (see example serverMonitor: https://github.com/pongasoft/glu/blob/master/scripts/org.linkedin.glu.script-jetty/src/main/groovy/JettyGluScript.groovy#L474)

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Showing master/slave status on failover activemq

Russ
Sorry to be dense, I've added the role and can see it set in zookeeper (which I missed earlier, so no upgrade required RATS).

I'm seeing the value in the scriptState.script.role field (I defined the field as role since we'll be using this concept again).   However, when I try to show the field in the dashboard using:

{
  "groupBy": "uniqueCountOrUniqueValue",
  "linkable": "true",
  "name": "role",
  "orderBy": "asc"
  "source": "scriptState.script.role",
  "visible": "true"
}

If I use initParameters.properties.home for the source, I see the value from zookeeper.

In fact, I can arbitrarily show any entries fro the scriptDefinition section.  How do I specify entries that aren't in the scriptDefinition section?

I'm trying to avoid the red row unless the process is down when it should be up (I'd llike to reserve the red row for immediate action required.
Reply | Threaded
Open this post in threaded view
|

Re: Showing master/slave status on failover activemq

frenchyan
Administrator
If you go to the "customize dashboard" page in the UI (accessible from the dashboard), there is a button called "View Possible Sources".. it will show you the name of all possible sources (should should see your role in it with its exact path)

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Showing master/slave status on failover activemq

Russ
Thank you.   One of the id-10t errors