博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
informix HDR 配置
阅读量:2453 次
发布时间:2019-05-10

本文共 4451 字,大约阅读时间需要 14 分钟。

一,首先安装两台相同版本操作系统的服务器

二,服务器配置文件信息

主机名和ip地址信息

/etc/hosts
172.25.1.114 test01
172.25.1.115 test02

配置数据信任关系

/home/informix/.rhosts
test01
test02

三,配置操作系统rsh服务

四,安装数据库

informix的实例名配置如下:
ontest01 onsoctcp test01 6666
ontest02 onsoctcp test02 6666

数据库配置文件中主要的配置如下:

为了实现通过管道备份恢复,配置TAPEDEV和LTAPEDEV的值STDIO

企业复制的参数暂时按照默认设置

# Data Replication Variables
# DRAUTO: 0 manual, 1 retain type, 2 reverse type
DRAUTO 0 # DR automatic switchover
DRINTERVAL 30 # DR max time between DR buffer flushes (in sec)
DRTIMEOUT 30 # DR network timeout (in sec)
DRLOSTFOUND /home/informix/etc/dr.lostfound # DR lost+found file path
DRIDXAUTO 0 # DR automatic index repair. 0=off, 1=on

五,开始配置HDR
为了测试方便,在test01上面建立一个数据库做为主,test02服务器上的数据库做为从。

1,使用onmode -d 将test01的类型设置为主类型并指示相关联的辅助数据库服务器的名称(这个名称指的是从服务器的数据库的实例名)。

[informix@test01 informix]$ onmode -d primary ontest02

出现的日志信息为:

[informix@test01 informix]$ onstat -m

14:51:55 DR: Reservation of the last logical log for log backup turned on

14:51:55 DR: new type = primary, secondary server name = ontest02
14:51:55 DR: Trying to connect to secondary server = ontest02
14:51:55 DR: Cannot connect to secondary server
14:51:55 DR: Turned off on primary server

2,在test01上执行备份通过管道直接在test02上面执行物理恢复
[informix@test01 informix]$ ontape -s -L 0 -F | rsh test02 "ontape -p "

3,通过下面的日志信息可以看到test02上面的物理恢复已经完成
[informix@test02 informix]$ onstat -m

IBM Informix Dynamic Server Version 10.00.UC4 -- Fast Recovery -- Up 00:01:23 -- 229336 Kbytes

Message Log File: /home/informix/test02.log

14:54:02 DR: Reservation of the last logical log for log backup turned on

14:54:02 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

14:54:02 Dataskip is now OFF for all dbspaces

14:54:02 Restartable Restore has been ENABLED
14:54:02 Recovery Mode
14:54:04 Physical Restore of rootdbs started.

14:54:05 Checkpoint Completed: duration was 0 seconds.

14:54:05 Checkpoint loguniq 4, logpos 0x17c018, timestamp: 0xed4a

14:54:05 Maximum server connections 0

14:54:07 Physical Restore of rootdbs Completed.
14:54:07 Checkpoint Completed: duration was 0 seconds.
14:54:07 Checkpoint loguniq 4, logpos 0x17c018, timestamp: 0xed4e

14:54:07 Maximum server connections 0

[informix@test02 informix]$

4,在test02上执行:
[informix@test02 informix]$ onmode -d secondary ontest01

系统提示:

[informix@test02 informix]$ onstat -m
14:56:46 DR: Reservation of the last logical log for log backup turned off
14:56:46 DR: new type = secondary, primary server name = ontest01
14:56:46 DR: Trying to connect to primary server = ontest01
14:56:49 DR: Secondary server connected
14:56:49 DR: Secondary server needs failure recovery

5,此时数据库继续执行逻辑恢复,日志信息:

14:56:50 DR: Failure recovery from disk in progress ...
14:56:50 Logical Recovery Started.
14:56:50 10 recovery worker threads will be started.
14:56:50 Dynamically allocated new virtual shared memory segment (size 8192KB)
14:56:50 Start Logical Recovery - Start Log 4, End Log ?
14:56:50 Starting Log Position - 4 0x17c018
14:56:50 Clearing the physical and logical logs has started
14:56:51 Cleared 40 MB of the physical and logical logs in 0 seconds
14:56:56 DR: Secondary server operational
14:56:57 Checkpoint Completed: duration was 0 seconds.
14:56:57 Checkpoint loguniq 5, logpos 0x1018, timestamp: 0xedaa

14:56:57 Maximum server connections 0

而另外一台主服务器上面的日志信息为:
14:56:49 DR: Primary server connected
14:56:49 DR: Secondary server needs failure recovery

14:56:52 Logical Log 4 Complete, timestamp: 0xed84.

14:56:53 DR: Sending log 4, size 1000 pages, 38.30 percent used
14:56:53 DR: Sending log 5 (current), size 1000 pages, 0.00 percent used
14:56:55 DR: Sending Logical Logs Completed
14:56:56 DR: Primary server operational

从上面可以看到数据库之间的执行步骤。

6,此时数据库的状态为:
[informix@test02 informix]$ onstat -

IBM Informix Dynamic Server Version 10.00.UC4 -- Read-Only (Sec) -- Up 00:04:58 -- 237528 Kbytes

[informix@test02 informix]$

主服务器的数据库状态为:

[informix@test01 informix]$ onstat -

IBM Informix Dynamic Server Version 10.00.UC4 -- On-Line (Prim) -- Up 00:09:36 -- 229336 Kbytes

[informix@test01 informix]$

7,此时在test01上面执行的ontape -s -L 0 -F | rsh test02 "ontape -p " 命令还没有结束,在test02上面执行onmode -ky关闭数据库,然后重新启动,此时test01上面的任务完成退出。

8,在test01上面重新建立一个库,然后在test02上面查看是否有新的库,测试HDR是否成功。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/312079/viewspace-245838/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/312079/viewspace-245838/

你可能感兴趣的文章
gis计算各省河流长度_用河流和各方解释安全漏洞
查看>>
代码编写工具_我希望在开始编写代码时就已经知道的工具:已复习
查看>>
把转变为json_如何使用7行JSON将您的网站转变为移动应用程序
查看>>
如何使用TensorFlow对象检测API播放Quidditch
查看>>
交付方式 saas_我在全职工作时如何交付我的第一个SaaS副项目
查看>>
instagram技术_Instagram9位科技女孩进行技术采访的主要技巧
查看>>
系统在此应用程序堆栈溢出_从部署我的第一个完整堆栈Web应用程序中学到的经验教训...
查看>>
angular面试题及答案_关于最流行的Angular问题的StackOverflow上的48个答案
查看>>
zeppelin连接数据源_使用开放源代码合同(open-zeppelin)创建以太坊令牌
查看>>
ai人工智能程序_简单解释:一个AI程序如何掌握Go的古老游戏
查看>>
以下是ECMAScript 2016、2017和2018中所有新增功能的示例
查看>>
初创团队最重要的是什么_我从一家出色的初创公司工作中学到的最重要的教训...
查看>>
kafka应用于区块链_Apache Kafka的区块链实验
查看>>
elixir 规格_Elixir:一种高画质的编程语言
查看>>
vue.js 全局应用js_如何在不到7分钟的时间内测试您的Vue.js应用
查看>>
深度强化学习和强化学习_深度强化学习:从哪里开始
查看>>
小猪短租超棒新房_freeCodeCamp讲座简介:您可以免费观看的超棒技术讲座
查看>>
拜托了
查看>>
神秘的数组初始化_图像识别神秘化
查看>>
如何构建设计系统
查看>>