Question
Phillip Wu · Aug 31

iris mirror nodes promote failover to primary

Hi,

I have this arrangement of mirror

Node 1: Primary

Node 2: Failover

Async member is DR server

There is also an arbiter on another server

 

I want to make 'Node 2' primary as 'Node 1' is to be taken down for some scheduled maintenance work.

I know that I can issue 'iris stop' on 'Node 1' and 'Node 2' should takeover as Primary.

Questions

1. Is this a reliable recommended way? I have had cases in the past when the Failover node did not take over as Primary

2. Is there a better way of promoting Failover to Primary?

0
0 92
Discussion (4)1
Log in or sign up to continue

Hi Philip,

You can do this from the irissession 

d ^MIRROR

2) Mirror Management

5) Try to make this the primary

1. Yes. Stopping primary makes backup a new primary. Before stopping you might want to validate that backup is caught up:

set sql = "SELECT CASE WHEN DatabaseLatency=? THEN 1 ELSE 0 END IsCaughtUp FROM SYS.Mirror_MemberStatusList() WHERE CurrentRole = ?"
set rs = ##class(%SQL.Statement).%ExecDirect(,sql, "Caught up", "Backup")
do rs.%Next()
if rs.IsCaughtUp {
	write "Caught up"
	halt
} else {
	write "Not caught up"
	do $system.Process.Terminate(,1)
}

Or at least is not too far behind (check this post).

2.  No. ^MIRROR does the same.

yes, I do this every 2 months for Red Hat Linux patches.  with the mirror monitor make sure transactions are caught up then do "iris stop <production> quietly".  backup server then becomes primary.  when patch is done on the former primary you do "iris start <production>" and it will become the backup.  then do "iris stop <production> quietly on the current primary and the previous primary and then become primary again.  then do "iris start <production>" on the original backup and it will become backup again.