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)
Re: Showing master/slave status on failover activemq
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.
Re: Showing master/slave status on failover activemq
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.
Re: Showing master/slave status on failover activemq
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.
Re: Showing master/slave status on failover activemq
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:
Re: Showing master/slave status on failover activemq
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)