HDR Implementation
Posted in 2017
Topics: High Availability & Replication, Backup & Restore, Installation, Setup & Upgrades, Storage & Space Management, Error Codes & Troubleshooting, Server Administration, Security, Permissions & Auditing, Logging & Checkpoints, Networking & sqlhosts Configuration, Versions, Editions & End-of-Life
Hi All
While HDR implementation on Unix
My scenario:
1. Two different servers with identical hardware and software.
2. Installed IDS on both servers.
3. Created Instances manually with all onconfig, sqlhost, environment
variables set.
4. set all HDR related parameters in onconfig on both servers identical.
5.set below parameters on both servers
- DBSERVERNAME
- MSGPATH
- ROOTNAME
- ROOTPATH
- ROOTSIZE
- DBSPACETEMP
- SBSPACETEMP
- SBSPACENAME
- DRAUTO
- DRINTERVAL
- HDR_TXN_SCOPE
- DRTIMEOUT
- LTAPEDEV
- TAPEDEV
6. set the sqlhost same on both servers.
7. connection between both servers are trusted.
8. On server A, ontape backup is generated
and onmode -d primary <secondary_servername>
is executed.
9.on server B restored the backup, ontape -p
and onmode -d secondary <primary_servername>
is executed.
on secondary if we check the state of the server:
[root@localhost storage]# onstat -
IBM Informix Dynamic Server Version 12.10.FC8AEE -- Quiescent -- Up 00:21:56
-- 148084 Kbytes
find the online.log below.
11:18:47 IBM Informix Dynamic Server Started.
11:18:47 Requested shared memory segment size rounded from 4308KB to 4796KB
Tue Jun 13 11:18:48 2017
11:18:48 Requested shared memory segment size rounded from 110629KB to 110632KB
11:18:49 Successfully added a bufferpool of page size 2K.
11:18:49 Event alarms enabled. ALARMPROG =
'/mnt/informix/hdr_secondary/etc/alarmprogram.sh'
11:18:49 Booting Language <c> from module <>
11:18:49 Loading Module <CNULL>
11:18:49 Booting Language <builtin> from module <>
11:18:49 Loading Module <BUILTINNULL>
11:18:54 DR: DRAUTO is 0 (Off)
11:18:54 DR: ENCRYPT_HDR is 0 (HDR encryption Disabled)
11:18:54 Event notification facility epoll enabled.
11:18:54 Trusted host cache successfully built:/etc/hosts.equiv.
11:18:54 CCFLAGS2 value set to 0x200
11:18:54 SQL_FEAT_CTRL value set to 0x8008
11:18:54 SQL_DEF_CTRL value set to 0x4b0
11:18:54 IBM Informix Dynamic Server Version 12.10.FC8AEE Software Serial
Number AAA#B000000
11:18:54 Warning: stat() failed for chunk file
/mnt/informix/storage/tmpsbspaces
11:18:54 Cannot Open Primary Chunk '/mnt/informix/storage/tmpsbspaces', errno
= 2
11:18:54 oninit: Cannot open chunk '/mnt/informix/storage/tmpsbspaces'. errno
= 2
11:18:55 IBM Informix Dynamic Server Initialized -- Shared Memory Initialized.
11:18:55 Started 1 B-tree scanners.
11:18:55 B-tree scanner threshold set at 5000.
11:18:55 B-tree scanner range scan size set to -1.
11:18:55 B-tree scanner ALICE mode set to 6.
11:18:55 B-tree scanner index compression level set to med.
11:18:55 DR: Reservation of the last logical log for log backup turned on
11:18:55 Data replication type and state information reset. To start DR, use
the 'onmode -d' command and wait for the pair to be operational,
before shutting down the database server
11:18:55 Warning: Invalid (non-existent/blobspace/disabled) dbspace listed
in DBSPACETEMP: 'tmpdbspaces'
11:18:55 Dataskip is now OFF for all dbspaces
11:18:55 Restartable Restore has been ENABLED
11:18:55 Recovery Mode
11:18:57 Physical Restore of rootdbs, dbspaces, plogs, llogs, sbspaces started.
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14cf
Interval: 147
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14d8
Interval: 148
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14e1
Interval: 149
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14ea
Interval: 150
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:50 Checkpoint Completed: duration was 0 seconds.
11:21:50 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14f1
Interval: 151
11:21:50 Maximum server connections 0
11:21:50 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:51 Physical Restore of rootdbs, dbspaces, plogs, llogs, sbspaces
Completed.
11:21:51 Checkpoint Completed: duration was 0 seconds.
11:21:51 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a1509
Interval: 151
11:21:51 Maximum server connections 0
11:22:44 No logical log restore will be performed.
11:22:44 Clearing the physical and logical logs has started
11:23:22 Cleared 1006 MB of the physical and logical logs in 37 seconds
11:23:22 Dropping temporary TBLspace 0x101010, recovering 25 pages.
11:23:22 Physical Recovery Started at Page (1:20021).
11:23:22 Physical Recovery Complete: 0 Pages Examined, 0 Pages Restored.
11:23:22 Logical Recovery Started.
11:23:22 10 recovery worker threads will be started.
11:23:22 Logical Recovery has reached the transaction cleanup phase.
11:23:22 Logical Recovery Complete.
0 Committed, 0 Rolled Back, 0 Open, 0 Bad Locks
11:23:23 Assert Warning: recreate of temporary sbspsace failed sbsnum:6, err=0
11:23:23 IBM Informix Dynamic Server Version 12.10.FC8AEE
11:23:23 Who: Session(1, informix@localhost.localdomain, 0, 0x44c42028)
Thread(7, main_loop(), 44bfb028, 1)
File: rstbs.c Line: 4899
11:23:23 Results: Downing sbspace.
11:23:23 Action: Please notify IBM Informix Technical Support.
11:23:23 stack trace for pid 5910 written to
/mnt/informix/hdr_secondary/tmp/af.3ef7dd3
11:23:23 See Also: /mnt/informix/hdr_secondary/tmp/af.3ef7dd3
11:23:23 recreate of temporary sbspsace failed sbsnum:6, err=0
11:23:23 Bringing system to Quiescent Mode with no Logical Restore.
11:23:24 Quiescent Mode
11:23:24 Checkpoint Completed: duration was 0 seconds.
11:23:24 Tue Jun 13 - loguniq 41, logpos 0x2644018, timestamp: 0x5a152b
Interval: 152
11:23:24 Maximum server connections 0
11:23:24 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 1
11:23:26 Defragmenter cleaner thread now running
11:23:26 Defragmenter cleaner thread cleaned:0 partitions
11:23:49 DR: Error - Server must be in recovery mode
There is something wrong in your setup. The state of the secondary should not
be Quiescent.
The state after a ontape -p restore is always "fast recovery".
After executing onmode -d secondary <primary name> the state
will switch to Read-Only (sec).
First, make sure the sqlhosts entries are correct on both sides
and you can access the primary server with dbaccess from the secondary node
without giving login credentials. (independent if the secondary instance is
running).
- set INFORMIXSERVER env var to the name of the primary service.
- execute dbaccess sysmaster
Maybe you mix here the shared memory listeners and TCP listeners.
Be sure to use the INFORMIXSERVER name which is bound to a TCP
listener.
(our HDR setups always have a local name and a name for remote communication
e.g.
DBSERVERNAME primaryDBSERVERALIASAS primary_tcp
The sqlhosts entries look like this:
primary onipcshm db_primary primary
primary_tcp onsoctcp db_primary 1600(db_primary is the hostname, primary is the servicename, 1600 is the TCP Port)
Same for secondary. The servicename to connect to would be primary_typ.
primary can only be reached locally.
In order to have that setup, check sqlhosts, /etc/hosts, /etc/hosts.equiv.
You need to have a running listener on a reachable network interface. Check
with netstat -an | grep <portno> on your primary if the service is reachable.
If you have a non-numeric service port for your listeners, you need to have it
resolved
in /etc/services.
The ports on the secondary can be the same as on the primary. Also here check
if
you have a listener running after the ontape -p process did finish.
Pls note that the onmode -d primary/secondary commands need to have a
functional
instance name as second parameter which is resolved in sqlhosts.
(not the hostname, but the first column in the sqlhosts file).
After ontape -p, do not perform any onmode commands other than onmode -d
secondary,
or you will lose the intermediate state which is necessary to roll forward to
the primary
state.
Especially, do not shutdown the secondary instance before executing the onmode
-d secondary
command.
Marcus Haarmann
Von: "MUKESH TANUKU" <mukeshbt1328@gmail.com>
An: "ids" <ids@iiug.org>
Gesendet: Dienstag, 13. Juni 2017 08:10:13
Betreff: HDR Implementation [39351]
Hi All
While HDR implementation on Unix
My scenario:
1. Two different servers with identical hardware and software.
2. Installed IDS on both servers.
3. Created Instances manually with all onconfig, sqlhost, environment
variables set.
4. set all HDR related parameters in onconfig on both servers identical.
5.set below parameters on both servers
- DBSERVERNAME
- MSGPATH
- ROOTNAME
- ROOTPATH
- ROOTSIZE
- DBSPACETEMP
- SBSPACETEMP
- SBSPACENAME
- DRAUTO
- DRINTERVAL
- HDR_TXN_SCOPE
- DRTIMEOUT
- LTAPEDEV
- TAPEDEV
6. set the sqlhost same on both servers.
7. connection between both servers are trusted.
8. On server A, ontape backup is generated
and onmode -d primary <secondary_servername>
is executed.
9.on server B restored the backup, ontape -p
and onmode -d secondary <primary_servername>
is executed.
on secondary if we check the state of the server:
[root@localhost storage]# onstat -
IBM Informix Dynamic Server Version 12.10.FC8AEE -- Quiescent -- Up 00:21:56
-- 148084 Kbytes
find the online.log below.
11:18:47 IBM Informix Dynamic Server Started.
11:18:47 Requested shared memory segment size rounded from 4308KB to 4796KB
Tue Jun 13 11:18:48 2017
11:18:48 Requested shared memory segment size rounded from 110629KB to
110632KB
11:18:49 Successfully added a bufferpool of page size 2K.
11:18:49 Event alarms enabled. ALARMPROG =
'/mnt/informix/hdr_secondary/etc/alarmprogram.sh'
11:18:49 Booting Language <c> from module <>
11:18:49 Loading Module <CNULL>
11:18:49 Booting Language <builtin> from module <>
11:18:49 Loading Module <BUILTINNULL>
11:18:54 DR: DRAUTO is 0 (Off)
11:18:54 DR: ENCRYPT_HDR is 0 (HDR encryption Disabled)
11:18:54 Event notification facility epoll enabled.
11:18:54 Trusted host cache successfully built:/etc/hosts.equiv.
11:18:54 CCFLAGS2 value set to 0x200
11:18:54 SQL_FEAT_CTRL value set to 0x8008
11:18:54 SQL_DEF_CTRL value set to 0x4b0
11:18:54 IBM Informix Dynamic Server Version 12.10.FC8AEE Software Serial
Number AAA#B000000
11:18:54 Warning: stat() failed for chunk file
/mnt/informix/storage/tmpsbspaces
11:18:54 Cannot Open Primary Chunk '/mnt/informix/storage/tmpsbspaces', errno
= 2
11:18:54 oninit: Cannot open chunk '/mnt/informix/storage/tmpsbspaces'. errno
= 2
11:18:55 IBM Informix Dynamic Server Initialized -- Shared Memory Initialized.
11:18:55 Started 1 B-tree scanners.
11:18:55 B-tree scanner threshold set at 5000.
11:18:55 B-tree scanner range scan size set to -1.
11:18:55 B-tree scanner ALICE mode set to 6.
11:18:55 B-tree scanner index compression level set to med.
11:18:55 DR: Reservation of the last logical log for log backup turned on
11:18:55 Data replication type and state information reset. To start DR, use
the 'onmode -d' command and wait for the pair to be operational,
before shutting down the database server
11:18:55 Warning: Invalid (non-existent/blobspace/disabled) dbspace listed
in DBSPACETEMP: 'tmpdbspaces'
11:18:55 Dataskip is now OFF for all dbspaces
11:18:55 Restartable Restore has been ENABLED
11:18:55 Recovery Mode
11:18:57 Physical Restore of rootdbs, dbspaces, plogs, llogs, sbspaces
started.
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14cf
Interval: 147
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14d8
Interval: 148
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14e1
Interval: 149
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:04 Checkpoint Completed: duration was 0 seconds.
11:21:04 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14ea
Interval: 150
11:21:04 Maximum server connections 0
11:21:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0,
Plog used 0, Llog used 0
11:21:50 Checkpoint Completed: duration was 0 seconds.
11:21:50 Tue Jun 13 - loguniq 41, logpos 0x2642278, timestamp: 0x5a14f1
Interval: 151
11:21:50 Maximum server connections 0
11:21:50 Checkpoint Statistics - Avg. Txn B
Thanks a lot. the issue is resolved and the HDR is up and both servers are in sync. Thank you all