Timesten复制配置

oracle timesten提供的复制也非常灵活,它的复制也是基于log的,所以配置复制logging需要打开(默认是打开的)。下面简单介绍一下active standby的配置和切换过程

 

环境:
两台机器IP地址分别为
xxx.xxx.57.79 im_cache_int1 (主)
xxx.xxx.57.80 im_cache_int2 (备)

一。配置atcive standby
在79机器上:
1.创建standby pair:
create active standby pair tt_mkt on "im_cache_int1", tt_mkt on "im_cache_int2" store tt_mkt on "im_cache_int1" port 10000 store tt_mkt on "im_cache_int2" port 10000;


2.设置和启动rep agent
ttadmin -reppolicy always tt_mkt;

3.设置该节点为active master角色
call ttRepStateSet('ACTIVE');


在80机器上:
1.复制data store
ttRepAdmin -duplicate -from tt_mkt -host im_cache_int1 tt_mkt

2.设置和启动rep agent
ttadmin -reppolicy always tt_mkt

3.等待该节点的状态变成standby状态
call ttrepstateget();

 

二。管理active standby
获取节点的状态
Command> CALL ttRepStateGet();
< STANDBY >

将一个节点设成active状态
CALL ttRepStateSet('ACTIVE');

将一个节点设成active standby状态
CALL ttRepDeactivate();

检查状态:

ttRepAdmin -showstatus tt_mkt

 

三。active standby切换:
假如说79那台机器(主机)宕掉了, 则在80(备机)上面执行下面语句,将standby角色改为active角色:
Command> CALL ttRepStateGet();
< STANDBY >
1 row found.
Command>
Command> CALL ttRepStateSet('ACTIVE');
Command> CALL ttRepStateGet();
< ACTIVE >
1 row found.

79(原来的主机端)机器不需要做任何动作。
等79机器恢复正常后,只要起来,它就自动会变成standby角色。

但是如果不想切换,那么等79机器恢复正常后需要执行下面两条命令:
ttadmin -reppolicy always tt_mkt;
call ttRepStateSet('ACTIVE');


四。注意事项:

1.在配置复制过程中采用主机名,采用IP地址有可能会报错。所以需要在/etc/hosts里面加入相应的hostname.

2.新加的表格不会被复制。
因此需要在一开始时就配置好。

3.在备机端相应的dsn要先配置好,但是不能存在相应的datastore。如果存在则需要
ttdestroy tt_mkt销毁掉。

4.在备机端的dsn中要配上autocreate=1,否则无法复制,会报下面的错误
TT16045: Failed to retrieve peer store ID for '' ON 'IM_CACHE_INT2' from data store. No definitions of replication store id for the specified data store.
TT16165: Failed to perform backup operation

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值