Install ZMIRROR Routine
Hi,
Question about ZMIRROR routine.
I analyze a problem with the label NotifyBecomePrimary. It seems not performed after a switch.
After installing ZMIRROR routine in %SYS, is a restart required?
If It's required, It could be explain my problem.
Thank you.
Comments
Solved.
Finally, It was simple.
The routine has been installed after the switch, but before my investigation.
So, I thought the routine was there and not performed.
@Lorenzo Scalese
How did you configure/install ZMIRROR? Where does it need to be put for the system to recognize it needs to run? I understand what ZMIRROR does, just looking for examples.
Hi @Scott Roth ,
The routine ZMIRROR.MAC must be installed in the namespace "%SYS" on each failover member. It needs the IRISLIB database mounted in RW for installation.
I use ZMIRROR.MAC to execute code when a node becomes primary, in my example I just implement "NotifyBecomePrimary" label :
ZMIRROR
Quit
NotifyBecomePrimary()
New; https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GHA_mirror#GHA_mirror_set_tunable_params_zmirror_routineTry {
Set ns = "MYAPPNAMESPACE"If##class(Config.Namespaces).Exists(ns) {
JOB##class(pkg.Class).ClassMethod():(ns):2
}
} Catch(ex) { } ; just a securityQuit:$Quit1QuitThere are many events available, we can see the list on this documentation page .
What event mirror are you interested in?
Thanks this gives me some guidance along with other examples I have gotten. NotifyBecomesPrimary is the one I’m most looking at right now. Once that hits then I’m going to call a shell script through $ZF to execute.