本文主要是介绍达梦数据库MPP顺序备集群搭建,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
达梦MPP集群搭建
- 集群介绍
- 部署步骤
- 1 .集群规划
- 2.配置A机器-MPP1_01库
- 2.1实例、备份数据
- 2.2配置 dm.ini
- 2.3配置 dmarch.ini
- 2.4配置 dmmal.ini
- 2.5配置 dmmpp.ini
- 2.6配置 dmmpp.ctl
- 2.7配置 dmwatcher.ini
- 2.8拷贝实例
- 2.9注册服务
- 3.配置B机器-MPP1_02库
- 3.1实例、备份数据
- 3.2配置 dm.ini
- 3.3配置 dmarch.ini
- 3.4配置 dmmal.ini
- 3.5配置 dmmpp.ini
- 3.6配置 dmmpp.ctl
- 3.7配置 dmwatcher.ini
- 3.8拷贝实例
- 3.9注册服务
- 4.配置B机器-MPP1_01B库
- 4.1配置 dm.ini
- 4.2配置 dmarch.ini
- 4.3相同配置项
- 4.4注册服务
- 4.5恢复数据
- 5.配置A机器-MPP1_02B库
- 5.1配置 dm.ini
- 5.2配置 dmarch.ini
- 5.3配置相同项
- 5.5恢复数据
- 6.配置监视器
- 6.1配置 dmmonitor.ini
- 6.2注册服务
- 7.启动服务及查看信息
- 7.1启动数据库并修改参数
- 7.2启动守护进程
- 7.3启动监视器
- 7.4启停集群
- 8.配置dm_svc.conf文件
- 8.1dm_svc.conf配置内容
- 8.2应用连接
集群介绍
达梦大规模并行处理 MPP(DM Massively Parallel Processing,缩写 DM MPP)
是基于达梦数据库管理系统研发的完全对等无共享式集群组件,支持将多个 DM 数据库实例
组织为一个并行计算网络,对外提供统一的数据库服务。
在海量数据分析的应用场景中,经常会遇到以下问题:
- 大量的复杂查询操作需要较高的系统性能支持;
- 数据库响应能力受到硬件的束缚;
- 小型机虽然能在垂直领域提供较好的单个节点性能,但是价格较高。
为了支持上述海量数据存储和处理、高性价比等方面的需求, 提供高端数据仓库解决方
案,达梦数据库提供了大规模并行处理 MPP 架构,以极低的成本代价,为客户提供业界领
先的计算性能。
部署步骤
1 .集群规划
MPP各节点拥有一个备实例 MPP1_01–>MPP1_01B MPP1_02–MPP1_02B
2.配置A机器-MPP1_01库
前提:已在AB机器上完成数据库软件安装
2.1实例、备份数据
–初始化实例
[dmdba@~]# /opt/dmdbms/bin/dminit PATH=/opt/dmdbms/data/ DB_NAME=MPP1_01 INSTANCE_NAME=MPP1_01 PORT_NUM=5236 PAGE_SIZE=32 LOG_SIZE=2048 LENGTH_IN_CHAR=1
–启动服务
[dmdba@~]# /opt/dmdbms/bin/dmserver /opt/dmdbms/data/MPP1_01/dm.ini
–开启归档
[dmdba@~]# /opt/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.1:5236
SQL> ALTER DATABASE MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE ADD ARCHIVELOG 'DEST=/opt/dmdbms/data/MPP1_01/arch, TYPE=LOCAL, FILE_SIZE=2048, SPACE_LIMIT=51200';
SQL> ALTER DATABASE OPEN;
--备份数据
SQL> BACKUP DATABASE BACKUPSET '/opt/dmdbms/data/MPP1_01/bak/BACKUP_FILE';
–修改dm.ini
SQL> SP_SET_PARA_VALUE (2,'PORT_NUM',5236);
#端口号
SQL> SP_SET_PARA_VALUE (2,'DW_INACTIVE_INTERVAL',60);
#接收守护进程消息超时时间
SQL> SP_SET_PARA_VALUE (2,'ALTER_MODE_STATUS',0);
#是否允许手工修改服务器的模式、 状态和 OGUID, 1: 允许; 0: 不允许。
注: 数据守护环境下建议配置为 0,实例处于主机或备机模式后,不允许用户直接通过 SQL 语句修改服务器的模式、状态和 OGUID
SQL> SP_SET_PARA_VALUE (2,'ENABLE_OFFLINE_TS',2);
#是否允许 OFFLINE 表空间, 0:不允许; 1:允许; 2:备库不允许。
注:数据守护环境下建议配置为 2
SQL> SP_SET_PARA_VALUE (2,'MAL_INI',1);
#是否启用 MAL 系统, 0:不启用; 1:启用
SQL> SP_SET_PARA_VALUE (2,'MPP_INI',1);
#是否启用 MPP 系统, 0:不启用; 1:启用
SQL> SP_SET_PARA_VALUE (2,'RLOG_SEND_APPLY_MON',64);
#数据守护中, 对于主库,用于指定统计最近 N 次主库到每个备库的归档发送时间;对于备库,用于指定统计最近 N 次备库重
演日志的时间, N 为此参数设置的值。有效值范围(1~1024)
SQL> exit
[dmdba@~]# exit
2.2配置 dm.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_01/dm.ini
INSTANCE_NAME = MPP1_01 #数据库实例名
2.3配置 dmarch.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_01/dmarch.ini
[ARCHIVE_MARCH1]ARCH_TYPE = REALTIME #实时归档类型ARCH_DEST = MPP1_01B #实时归档目标实例名
[ARCHIVE_LOCAL1]ARCH_TYPE = LOCAL #本地归档类型ARCH_DEST = /opt/dmdbms/data/MPP1_01/arch/ #本地归档存放路径ARCH_FILE_SIZE = 2048 #单位MB,本地单个归档最大值ARCH_SPACE_LIMIT = 51200 #单位MB,0表示无限制
2.4配置 dmmal.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_01/dmmal.ini
MAL_CHECK_INTERVAL = 30 #MAL链路检测时间间隔
MAL_CONN_FAIL_INTERVAL = 60 #判定MAL链路断开的时间
MAL_TEMP_PATH = /opt/dmdbms/data/malpath/MPP1_01/ #临时文件目录
MAL_BUF_SIZE = 512 #单个MAL缓存大小限制,单位MB
MAL_SYS_BUF_SIZE = 2048 #MAL系统总内存大小限制,单位MB
MAL_COMPRESS_LEVEL = 0 #MAL消息压缩等级,0表示不压缩[MAL_INST1]MAL_INST_NAME = MPP1_01 #实例名,和 dm.ini中INSTANCE_NAME一致MAL_HOST = 192.168.238.101 #MAL系统监听TCP连接的IP地址MAL_PORT = 5336 #MAL系统监听TCP连接的端口MAL_INST_HOST = 192.168.238.101 #实例的对外服务IP地址MAL_INST_PORT = 5236 #实例对外服务端口,和dm.ini中PORT_NUM一致MAL_DW_PORT = 5436 #实例对应的守护进程监听TCP连接的端口MAL_INST_DW_PORT = 5536 #实例监听守护进程TCP连接的端口
[MAL_INST2]MAL_INST_NAME = MPP1_01BMAL_HOST = 192.168.238.102MAL_PORT = 5337MAL_INST_HOST = 192.168.238.102MAL_INST_PORT = 5237MAL_DW_PORT = 5437MAL_INST_DW_PORT = 5537
[MAL_INST3]MAL_INST_NAME = MPP1_02MAL_HOST = 192.168.238.102MAL_PORT = 5336MAL_INST_HOST = 192.168.238.102MAL_INST_PORT = 5236MAL_DW_PORT = 5436MAL_INST_DW_PORT = 5536
[MAL_INST4]MAL_INST_NAME = MPP1_02BMAL_HOST = 192.168.238.101MAL_PORT = 5337MAL_INST_HOST = 192.168.238.101MAL_INST_PORT = 5237MAL_DW_PORT = 5437MAL_INST_DW_PORT = 5537
2.5配置 dmmpp.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_01/dmmpp.ini
[service_name1]mpp_seq_no = 0mpp_inst_name = MPP1_01
[service_name2]mpp_seq_no = 1mpp_inst_name = MPP1_02
2.6配置 dmmpp.ctl
[dmdba@~]# /opt/dmdbms/bin/dmctlcvt t2c /opt/dmdbms/data/MPP1_01/dmmpp.ini /opt/dmdbms/data/MPP1_01/dmmpp.ctl
2.7配置 dmwatcher.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_01/dmwatcher.ini
[GMPP1_01]DW_TYPE = GLOBAL #全局守护类型DW_MODE = MANUAL #故障手动切换模式DW_ERROR_TIME = 30 #远程守护进程故障认定时间INST_ERROR_TIME = 30 #本地实例故障认定时间INST_RECOVER_TIME = 60 #主库守护进程启动恢复的间隔时间INST_OGUID = 45331 #守护系统唯一OGUID值INST_INI = /opt/dmdbms/data/MPP1_01/dm.ini #dm.ini文件路径INST_AUTO_RESTART = 1 #打开实例的自动启动功能INST_STARTUP_CMD = /opt/dmdbms/bin/dmserver #命令行方式启动RLOG_SEND_THRESHOLD = 0 #指定主库发送日志到备库的时间阀值,默认关闭RLOG_APPLY_THRESHOLD = 0 #指定备库重演日志的时间阀值,默认关闭
[GMPP1_02]DW_TYPE = GLOBALDW_MODE = MANUALDW_ERROR_TIME = 30INST_ERROR_TIME = 30INST_RECOVER_TIME = 60INST_OGUID = 45332INST_INI = /opt/dmdbms/data/MPP1_02/dm.iniINST_AUTO_RESTART = 1INST_STARTUP_CMD = /opt/dmdbms/bin/dmserverRLOG_SEND_THRESHOLD = 0RLOG_APPLY_THRESHOLD = 0
2.8拷贝实例
–拷贝实例到B机器
[dmdba@~]# scp -r /opt/dmdbms/data/MPP1_01 dmdba@192.168.238.102:/opt/dmdbms/data/
2.9注册服务
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmserver -p MPP1_01 -dm_ini /opt/dmdbms/data/MPP1_01/dm.ini -m mount
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p MPP1_01 -watcher_ini /opt/dmdbms/data/MPP1_01/dmwatcher.ini
3.配置B机器-MPP1_02库
3.1实例、备份数据
–初始化实例
[dmdba@~]# /opt/dmdbms/bin/dminit PATH=/opt/dmdbms/data/ DB_NAME=MPP1_02 INSTANCE_NAME=MPP1_02 PORT_NUM=5236 PAGE_SIZE=32 LOG_SIZE=2048 LENGTH_IN_CHAR=1
–启动服务
[dmdba@~]# /opt/dmdbms/bin/dmserver /opt/dmdbms/data/MPP1_02/dm.ini
–开启归档
[dmdba@~]# /opt/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.2:5236
SQL> ALTER DATABASE MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE ADD ARCHIVELOG 'DEST=/opt/dmdbms/data/MPP1_02/arch, TYPE=LOCAL, FILE_SIZE=2048, SPACE_LIMIT=51200';
SQL> ALTER DATABASE OPEN;
--备份数据
SQL> BACKUP DATABASE BACKUPSET '/opt/dmdbms/data/MPP1_02/bak/BACKUP_FILE';
–修改dm.ini
SQL> SP_SET_PARA_VALUE (2,'PORT_NUM',5236);
SQL> SP_SET_PARA_VALUE (2,'DW_INACTIVE_INTERVAL',60);
SQL> SP_SET_PARA_VALUE (2,'ALTER_MODE_STATUS',0);
SQL> SP_SET_PARA_VALUE (2,'ENABLE_OFFLINE_TS',2);
SQL> SP_SET_PARA_VALUE (2,'MAL_INI',1);
SQL> SP_SET_PARA_VALUE (2,'MPP_INI',1);
SQL> SP_SET_PARA_VALUE (2,'RLOG_SEND_APPLY_MON',64);
SQL> exit
[dmdba@~]# exit
3.2配置 dm.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_02/dm.ini
INSTANCE_NAME = MPP1_02 #数据库实例名
3.3配置 dmarch.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_02/dmarch.ini
[ARCHIVE_MARCH1]ARCH_TYPE = REALTIME #实时归档类型ARCH_DEST = MPP1_02B #实时归档目标实例名
[ARCHIVE_LOCAL1]ARCH_TYPE = LOCAL #本地归档类型ARCH_DEST = /opt/dmdbms/data/MPP1_02/arch/ #本地归档存放路径ARCH_FILE_SIZE = 2048 #单位MB,本地单个归档最大值ARCH_SPACE_LIMIT = 51200 #单位MB,0表示无限制
3.4配置 dmmal.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_02/dmmal.ini
MAL_CHECK_INTERVAL = 30 #MAL链路检测时间间隔
MAL_CONN_FAIL_INTERVAL = 60 #判定MAL链路断开的时间
MAL_TEMP_PATH = /opt/dmdbms/data/malpath/MPP1_02/ #临时文件目录
MAL_BUF_SIZE = 512 #单个MAL缓存大小限制,单位MB
MAL_SYS_BUF_SIZE = 2048 #MAL系统总内存大小限制,单位MB
MAL_COMPRESS_LEVEL = 0 #MAL消息压缩等级,0表示不压缩[MAL_INST1]MAL_INST_NAME = MPP1_01 #实例名,和 dm.ini中INSTANCE_NAME一致MAL_HOST = 192.168.238.101 #MAL系统监听TCP连接的IP地址MAL_PORT = 5336 #MAL系统监听TCP连接的端口MAL_INST_HOST = 192.168.238.101 #实例的对外服务IP地址MAL_INST_PORT = 5236 #实例对外服务端口,和dm.ini中PORT_NUM一致MAL_DW_PORT = 5436 #实例对应的守护进程监听TCP连接的端口MAL_INST_DW_PORT = 5536 #实例监听守护进程TCP连接的端口
[MAL_INST2]MAL_INST_NAME = MPP1_01BMAL_HOST = 192.168.238.102MAL_PORT = 5337MAL_INST_HOST = 192.168.238.102MAL_INST_PORT = 5237MAL_DW_PORT = 5437MAL_INST_DW_PORT = 5537
[MAL_INST3]MAL_INST_NAME = MPP1_02MAL_HOST = 192.168.238.102MAL_PORT = 5336MAL_INST_HOST = 192.168.238.102MAL_INST_PORT = 5236MAL_DW_PORT = 5436MAL_INST_DW_PORT = 5536
[MAL_INST4]MAL_INST_NAME = MPP1_02BMAL_HOST = 192.168.238.101MAL_PORT = 5337MAL_INST_HOST = 192.168.238.101MAL_INST_PORT = 5237MAL_DW_PORT = 5437MAL_INST_DW_PORT = 5537
3.5配置 dmmpp.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_02/dmmpp.ini
[service_name1]mpp_seq_no = 0mpp_inst_name = MPP1_01
[service_name2]mpp_seq_no = 1mpp_inst_name = MPP1_02
3.6配置 dmmpp.ctl
[dmdba@~]# /opt/dmdbms/bin/dmctlcvt t2c /opt/dmdbms/data/MPP1_02/dmmpp.ini /opt/dmdbms/data/MPP1_02/dmmpp.ctl
3.7配置 dmwatcher.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_02/dmwatcher.ini
[GMPP1_01]DW_TYPE = GLOBAL #全局守护类型DW_MODE = MANUAL #故障手动切换模式DW_ERROR_TIME = 30 #远程守护进程故障认定时间INST_ERROR_TIME = 30 #本地实例故障认定时间INST_RECOVER_TIME = 60 #主库守护进程启动恢复的间隔时间INST_OGUID = 45331 #守护系统唯一OGUID值INST_INI = /opt/dmdbms/data/MPP1_01/dm.ini #dm.ini文件路径INST_AUTO_RESTART = 1 #打开实例的自动启动功能INST_STARTUP_CMD = /opt/dmdbms/bin/dmserver #命令行方式启动RLOG_SEND_THRESHOLD = 0 #指定主库发送日志到备库的时间阀值,默认关闭RLOG_APPLY_THRESHOLD = 0 #指定备库重演日志的时间阀值,默认关闭
[GMPP1_02]DW_TYPE = GLOBALDW_MODE = MANUALDW_ERROR_TIME = 30INST_ERROR_TIME = 30INST_RECOVER_TIME = 60INST_OGUID = 45332INST_INI = /opt/dmdbms/data/MPP1_02/dm.iniINST_AUTO_RESTART = 1INST_STARTUP_CMD = /opt/dmdbms/bin/dmserverRLOG_SEND_THRESHOLD = 0RLOG_APPLY_THRESHOLD = 0
3.8拷贝实例
–拷贝实例到A机器
[dmdba@~]# scp -r /opt/dmdbms/data/MPP1_02 dmdba@192.168.1.1:/opt/dmdbms/data/
3.9注册服务
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmserver -p MPP1_02 -dm_ini /opt/dmdbms/data/MPP1_02/dm.ini -m mount
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p MPP1_02 -watcher_ini /opt/dmdbms/data/MPP1_02/dmwatcher.ini
4.配置B机器-MPP1_01B库
4.1配置 dm.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_01/dm.ini
INSTANCE_NAME = MPP1_01B #数据库实例名
PORT_NUM = 5237 #数据库实例监听端口
4.2配置 dmarch.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_01/dmarch.ini
[ARCHIVE_MARCH1]ARCH_TYPE = REALTIME #实时归档类型ARCH_DEST = MPP1_01 #实时归档目标实例名
[ARCHIVE_LOCAL1]ARCH_TYPE = LOCAL #本地归档类型ARCH_DEST = /opt/dmdbms/data/MPP1_01/arch/ #本地归档存放路径ARCH_FILE_SIZE = 2048 #单位MB,本地单个归档最大值ARCH_SPACE_LIMIT = 51200 #单位MB,0表示无限制
4.3相同配置项
与A机器MPP1_01的dmmal.ini、dmmpp.ini、dmmpp.ctl相同
4.4注册服务
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmserver -p MPP1_01B -dm_ini /opt/dmdbms/data/MPP1_01/dm.ini -m mount
4.5恢复数据
`
[dmdba@~]# /opt/dmdbms/bin/dmrman CTLSTMT="RESTORE DATABASE '/opt/dmdbms/data/MPP1_01/dm.ini' FROM BACKUPSET '/opt/dmdbms/data/MPP1_01/bak/BACKUP_FILE'"
[dmdba@~]# /opt/dmdbms/bin/dmrman CTLSTMT="RECOVER DATABASE '/opt/dmdbms/data/MPP1_01/dm.ini' FROM BACKUPSET '/opt/dmdbms/data/MPP1_01/bak/BACKUP_FILE'"
[dmdba@~]# /opt/dmdbms/bin/dmrman CTLSTMT="RECOVER DATABASE '/opt/dmdbms/data/MPP1_01/dm.ini' UPDATE DB_MAGIC"
5.配置A机器-MPP1_02B库
5.1配置 dm.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_02/dm.ini
INSTANCE_NAME = MPP1_02B #数据库实例名
PORT_NUM = 5237 #数据库实例监听端口
5.2配置 dmarch.ini
[dmdba@~]# vi /opt/dmdbms/data/MPP1_02/dmarch.ini
[ARCHIVE_MARCH1]ARCH_TYPE = REALTIME #实时归档类型ARCH_DEST = MPP1_02 #实时归档目标实例名
[ARCHIVE_LOCAL1]ARCH_TYPE = LOCAL #本地归档类型ARCH_DEST = /opt/dmdbms/data/MPP1_02/arch/ #本地归档存放路径ARCH_FILE_SIZE = 2048 #单位MB,本地单个归档最大值ARCH_SPACE_LIMIT = 51200 #单位MB,0表示无限制
5.3配置相同项
与B机器MPP1_02的dmmal.ini、dmmpp.ini、dmmpp.ctl相同
5.4注册服务
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmserver -p MPP1_02B -dm_ini /opt/dmdbms/data/MPP1_02/dm.ini -m mount
5.5恢复数据
[dmdba@~]# /opt/dmdbms/bin/dmrman CTLSTMT="RESTORE DATABASE '/opt/dmdbms/data/MPP1_02/dm.ini' FROM BACKUPSET '/opt/dmdbms/data/MPP1_02/bak/BACKUP_FILE'"
[dmdba@~]# /opt/dmdbms/bin/dmrman CTLSTMT="RECOVER DATABASE '/opt/dmdbms/data/MPP1_02/dm.ini' FROM BACKUPSET '/opt/dmdbms/data/MPP1_02/bak/BACKUP_FILE'"
[dmdba@~]# /opt/dmdbms/bin/dmrman CTLSTMT="RECOVER DATABASE '/opt/dmdbms/data/MPP1_02/dm.ini' UPDATE DB_MAGIC"
6.配置监视器
①在确认监视器机器上 注册确认监视器自启服务。
②在各节点数据库的bin目录中 存放非/确认监视器配置文件。
6.1配置 dmmonitor.ini
[dmdba@~]# vi /opt/dmdbms/bin/dmmonitor.ini
MON_DW_CONFIRM = 1 #0为非确认,1为确认
MON_LOG_PATH = ../log #监视器日志文件存放路径
MON_LOG_INTERVAL = 60 #每隔 60s 定时记录系统信息到日志文件
MON_LOG_FILE_SIZE = 512 #单位MB,范围1~2048MB
MON_LOG_SPACE_LIMIT = 2048 #日志文件总占用2048MB[GMPP1_01]MON_INST_OGUID = 45331 #组GMPP1_01的唯一OGUID 值MON_DW_IP = 192.168.238.101:5436 #IP对应MAL_HOST,PORT对应MAL_DW_PORTMON_DW_IP = 192.168.238.102:5437
[GMPP1_02]MON_INST_OGUID = 45332 #组GMPP1_02的唯一OGUID 值MON_DW_IP = 192.168.238.102:5436MON_DW_IP = 192.168.238.101:5437
6.2注册服务
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmmonitor -p Monitor -monitor_ini /opt/dmdbms/bin/dmmonitor.ini
7.启动服务及查看信息
7.1启动数据库并修改参数
A机器-MPP1_01
[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_01 start
[dmdba@~]# /opt/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.1:5236
SQL> SP_SET_OGUID(45331);
SQL> ALTER DATABASE PRIMARY;
B机器-MPP1_02
[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_02 start
[dmdba@~]# /opt/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.2:5236
SQL> SP_SET_OGUID(45332);
SQL> ALTER DATABASE PRIMARY;
A机器-MPP1_02B
[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_02B start
[dmdba@~]# /opt/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.1:5237
SQL> SP_SET_OGUID(45332);
SQL> SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
SQL> ALTER DATABASE STANDBY;
SQL> SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
B机器-MPP1_01B
[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_01B start
[dmdba@~]# /opt/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.2:5237
SQL> SP_SET_OGUID(45331);
SQL> SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
SQL> ALTER DATABASE STANDBY;
SQL> SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
7.2启动守护进程
A机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceMPP1_01 start
B机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceMPP1_02 start
7.3启动监视器
[dmdba@~]# /opt/dmdbms/bin/DmMonitorServiceMonitor start
前台启动:[dmdba@~]# /opt/dmdbms/bin/dmmonitor /opt/dmdbms/bin/dmmonitor.ini
MPP集群正常
7.4启停集群
启动:A/B机器守护进程
A机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceMPP1_01 start
B机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceMPP1_02 start停止:A/B机器守护进程→A机器MPP1_01主库→B机器MPP1_02主库→B机器MPP1_01B备库→A机器MPP1_02B备库
A机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceMPP1_01 stop
B机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceMPP1_02 stop
A机器:[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_01 stop
B机器:[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_02 stop
B机器:[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_01B stop
A机器:[dmdba@~]# /opt/dmdbms/bin/DmServiceMPP1_02B stop
8.配置dm_svc.conf文件
8.1dm_svc.conf配置内容
MPP1=(192.168.238.101:5236,192.168.238.102:5236,192.168.238.102:5237,192.168.238.101:5237)
TIME_ZONE=(480)
LANGUAGE=(cn)
LOGIN_ENCRYPT=(0)
LOGIN_MODE=(1)
8.2应用连接
文件存放
Linux:将dm_svc.conf文件放在应用服务器/etc目录下。
Windows32位:将dm_svc.conf文件放在应用服务器system32目录下。
Windows64位:将dm_svc.conf文件放在应用服务器system32和syswow64目录下。
配置应用连接串
dm.jdbc.driver.DmDriver
jdbc:dm://MPP1?
如果你还有其他问题,欢迎到达梦社区来提问~
社区地址:https://eco.dameng.com
这篇关于达梦数据库MPP顺序备集群搭建的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!