注册
达梦DCP学习感悟
专栏/培训园地/ 文章详情 /

达梦DCP学习感悟

DM_050596 2024/07/29 413 0 0
摘要

2024年年初由于公司使用等缘由,接触到了达梦数据库。随后学习越来越深入,学习的内容也越来越多,看到了作为中国新一代集中式数据库厂商的魄力和能力。在当前的背景下,达梦数据库有更加深远的发展前景,下面我将针对达梦的主备集群搭建讲一下具体的步骤:
dm.ini

INSTANCE_NAME = GRP1_RT_01
PORT_NUM = 5246
DW_INACTIVE_INTERVAL = 60
ALTER_MODE_STATUS = 0
ENABLE_OFFLINE_TS = 2
MAL_INI = 1
ARCH_INI = 1
RLOG_SEND_APPLY_MON = 64
dmmal.ini
MAL_CHECK_INTERVAL = 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME = GRP1_RT_01
MAL_HOST = 192.168.1.30
MAL_PORT = 55101
MAL_INST_HOST = 192.168.1.30
MAL_INST_PORT = 5246
MAL_DW_PORT = 65101
MAL_INST_DW_PORT = 45101
[MAL_INST2]
MAL_INST_NAME = GRP1_RT_03
MAL_HOST = 192.168.1.20
MAL_PORT = 55121
MAL_INST_HOST = 192.168.1.20
MAL_INST_PORT = 5246
MAL_DW_PORT = 65121
MAL_INST_DW_PORT = 45121
dmarch.ini
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_RT_03
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm8/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = AUTO
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 453331
INST_INI = /dm8/data/GRP1_RT_01/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /dm8/bin/dmserver
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0
启动主库
./dmserver /dm8/data/GRP1_RT_01/dm.ini mount
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
SQL>sp_set_oguid(453331);
SQL>alter database primary;
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
standby
dm.ini
INSTANCE_NAME = GRP1_RT_03
PORT_NUM = 5246
DW_INACTIVE_INTERVAL = 60
ALTER_MODE_STATUS = 0
ENABLE_OFFLINE_TS = 2
MAL_INI = 1
ARCH_INI = 1
RLOG_SEND_APPLY_MON = 64
dmmal.ini
MAL_CHECK_INTERVAL = 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME = GRP1_RT_01
MAL_HOST = 192.168.1.30
MAL_PORT = 55101
MAL_INST_HOST = 192.168.1.30
MAL_INST_PORT = 5246
MAL_DW_PORT = 65101
MAL_INST_DW_PORT = 45101
[MAL_INST2]
MAL_INST_NAME = GRP1_RT_03
MAL_HOST = 192.168.1.20
MAL_PORT = 55121
MAL_INST_HOST = 192.168.1.20
MAL_INST_PORT = 5246
MAL_DW_PORT = 65121
MAL_INST_DW_PORT = 45121
dmarch.ini
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_RT_01
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm8/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = AUTO
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 453331
INST_INI = /dm8/data/GRP1_RT_03/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /dm8/bin/dmserver
RLOG_APPLY_THRESHOLD = 0
以 Mount 方式启动备库
./dmserver /dm8/data/GRP1_RT_03/dm.ini mount
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
SQL>sp_set_oguid(453331);
SQL>alter database standby;
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
dmmonitor.ini
MON_DW_CONFIRM = 1
MON_LOG_PATH = /dm8/data/log
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 0
[GRP1]
MON_INST_OGUID = 453331
MON_DW_IP = 192.168.1.30:65101
MON_DW_IP = 192.168.1.20:6512

评论
后发表回复

作者

文章

阅读量

获赞

扫一扫
联系客服