During the operation of DM MPP system, if an EP node fails and stops, the whole MPP system will be in a state of abnormal service. All current user sessions will be disconnected by the system. Global login is not allowed, but local login is only allowed. Therefore, in order to ensure the high availability of MPP system, it is strongly recommended to adopt the deployment scheme of combining DM MPP and data guard.
1, Cluster planning
The whole server cluster needs three servers, of which A and B servers are the main and standby servers, and C server is the monitor to realize the automatic failover of the cluster.
The server | Service IP | System monitoring IP | Instance name | OGUID | Instance port | MAL port | MAL daemon port | Daemon port |
---|---|---|---|---|---|---|---|---|
A server | 192.168.177.129 | 192.168.177.129 | 45331 | MPP1_01 | 5236 | 5336 | 5436 | 5536 |
B server | 192.168.177.130 | 192.168.177.130 | 45332 | MPP1_02 | 5236 | 5336 | 5436 | 5536 |
A server | 192.168.177.129 | 192.168.177.129 | 45332 | MPP1_02B | 5237 | 5337 | 5437 | 5537 |
B server | 192.168.177.130 | 192.168.177.130 | 45331 | MPP1_01B | 5237 | 5337 | 5437 | 5537 |
C server | 192.168.177.131 | Confirm monitoring |
Installation directory / dm8
Instance directory / dm8/data/
2, Cluster deployment
1. Configure machine A - MPP1_01 Library
– initialize instance
[dmdba@~]# /dm8/bin/dminit PATH=/dm8/data/ DB_NAME=MPP1_01 INSTANCE_NAME=MPP1_01 PORT_NUM=5236 PAGE_SIZE=32 LOG_SIZE=2048
– start service
[dmdba@~]# /dm8/bin/dmserver /dm8/data/MPP1_01/dm.ini
– open archive
[dmdba@~]# /dm8/bin/disql SYSDBA/SYSDBA@172.16.1.1:5236 SQL> ALTER DATABASE MOUNT; SQL> ALTER DATABASE ARCHIVELOG; SQL> ALTER DATABASE ADD ARCHIVELOG 'DEST=/dm8/data/MPP1_01/arch, TYPE=LOCAL, FILE_SIZE=1024, SPACE_LIMIT=51200'; SQL> ALTER DATABASE OPEN;
– backup data
SQL> BACKUP DATABASE BACKUPSET '/dm8/data/MPP1_01/BACKUP_FILE';
– modify DM ini
SP_SET_PARA_VALUE (2,'PORT_NUM',5236); SP_SET_PARA_VALUE (2,'DW_INACTIVE_INTERVAL',60); SP_SET_PARA_VALUE (2,'ALTER_MODE_STATUS',0); SP_SET_PARA_VALUE (2,'ENABLE_OFFLINE_TS',2); SP_SET_PARA_VALUE (2,'MAL_INI',1); SP_SET_PARA_VALUE (2,'ARCH_INI',1); SP_SET_PARA_VALUE (2,'RLOG_SEND_APPLY_MON',64); SP_SET_PARA_VALUE (2,'MPP_INI',1);
– configure dmarch ini
[dmdba@~]# vi /dm8/data/MPP1_01/dmarch.ini [ARCHIVE_LOCAL] ARCH_TYPE = LOCAL #Local archive type ARCH_DEST = /dm8/data/MPP1_01/arch/ #Local archive storage path ARCH_FILE_SIZE = 1024 #Single archive size in MB ARCH_SPACE_LIMIT = 51200 #Archive upper limit in MB [ARCHIVE_REALTIME] ARCH_TYPE = REALTIME #Real time archive type ARCH_DEST = MPP1_01B #Real time archive target instance name
– create dmmal ini
[dmdba@~]# vi /dm8/data/MPP1_01/dmmal.ini MAL_CHECK_INTERVAL = 10 #MAL link detection interval MAL_CONN_FAIL_INTERVAL = 10 #Determine the disconnection time of MAL link MAL_TEMP_PATH = /dm8/data/malpath/MPP1_01/ #Temporary file directory MAL_BUF_SIZE = 512 #Single MAL cache size in MB MAL_SYS_BUF_SIZE = 2048 #MAL total size limit in MB MAL_COMPRESS_LEVEL = 0 #MAL message compression level, 0 means no compression [MAL_INST1] MAL_INST_NAME = MPP1_01 #Instance name, and DM Instance in ini_ Name consistent MAL_HOST = 192.168.177.129 #The MAL system listens to the IP address of the TCP connection MAL_PORT = 5336 #MAL system listens to the port of TCP connection MAL_INST_HOST = 192.168.177.129 #External service IP address of the instance MAL_INST_PORT = 5236 #Instance external service port, and DM Port in ini_ Num consistent MAL_DW_PORT = 5436 #The daemon corresponding to the instance listens to the port of the TCP connection MAL_INST_DW_PORT = 5536 #The port on which the instance listens for daemon TCP connections [MAL_INST2] MAL_INST_NAME = MPP1_01B MAL_HOST = 192.168.177.130 MAL_PORT = 5337 MAL_INST_HOST = 192.168.177.130 MAL_INST_PORT = 5237 MAL_DW_PORT = 5437 MAL_INST_DW_PORT = 5537 [MAL_INST3] MAL_INST_NAME = MPP1_02 MAL_HOST = 192.168.177.130 MAL_PORT = 5336 MAL_INST_HOST = 192.168.177.130 MAL_INST_PORT = 5236 MAL_DW_PORT = 5436 MAL_INST_DW_PORT = 5536 [MAL_INST4] MAL_INST_NAME = MPP1_02B MAL_HOST = 192.168.177.129 MAL_PORT = 5337 MAL_INST_HOST = 192.168.177.129 MAL_INST_PORT = 5237 MAL_DW_PORT = 5437 MAL_INST_DW_PORT = 5537
– create dmmpp ini
[dmdba@~]# vi /dm8/data/MPP1_01/dmmpp.ini [service_name1] mpp_seq_no = 0 mpp_inst_name = MPP1_01 [service_name2] mpp_seq_no = 1 mpp_inst_name = MPP1_02
– create dmmpp ctl
[dmdba@~]# /dm8/bin/dmctlcvt t2c /dm8/data/MPP1_01/dmmpp.ini /dm8/data/MPP1_01/dmmpp.ctl
– create dmwatcher ini
[dmdba@~]# vi /dm8/data/MPP1_01/dmwatcher.ini [GMPP1_01] DW_TYPE = GLOBAL #Global daemon type DW_MODE = MANUAL #Manual failover mode DW_ERROR_TIME = 20 #Remote daemon failure determination time INST_ERROR_TIME = 20 #Local instance fault determination time INST_RECOVER_TIME = 60 #The interval between the main library daemon starting recovery INST_OGUID = 45331 #Unique OGUID value of daemon INST_INI = /dm8/data/MPP1_01/dm.ini #dm.ini file path INST_AUTO_RESTART = 1 #Turn on the auto start function of the instance INST_STARTUP_CMD = /dm8/bin/dmserver #Command line startup RLOG_SEND_THRESHOLD = 0 #Specifies the time threshold for sending logs from the primary database to the standby database. It is closed by default RLOG_APPLY_THRESHOLD = 0 #Specifies the time threshold of the backup database replay log. It is off by default [GMPP1_02] DW_TYPE = GLOBAL DW_MODE = MANUAL DW_ERROR_TIME = 20 INST_ERROR_TIME = 20 INST_RECOVER_TIME = 60 INST_OGUID = 45332 INST_INI = /dm8/data/MPP1_02/dm.ini INST_AUTO_RESTART = 1 INST_STARTUP_CMD = /dm8/bin/dmserver RLOG_SEND_THRESHOLD = 0 RLOG_APPLY_THRESHOLD = 0
– copy the instance to machine B
[dmdba@~]# scp -r /dm8/data/MPP1_01 dmdba@192.168.177.139:/dm8/data/
– registration services
[root@~]# /dm8/script/root/dm_service_installer.sh -t dmserver -p MPP1_01 -dm_ini /dm8/data/MPP1_01/dm.ini -m mount [root@~]# /dm8/script/root/dm_service_installer.sh -t dmwatcher -p MPP1_01 -watcher_ini /dm8/data/MPP1_01/dmwatcher.ini Note: delete auto start [root@~]# /dm8/script/root/dm_service_uninstaller.sh -n DmServiceMPP1_01 [root@~]# /dm8/script/root/dm_service_uninstaller.sh -n DmWatcherServiceMPP1_01
2. Configure machine B - MPP1_02 Library
– initialize instance
[dmdba@~]# /dm8/bin/dminit PATH=/dm8/data/ DB_NAME=MPP1_02 INSTANCE_NAME=MPP1_02 PORT_NUM=5236 PAGE_SIZE=32 LOG_SIZE=2048
– start service
[dmdba@~]# /dm8/bin/dmserver /dm8/data/MPP1_02/dm.ini
– open archive
[dmdba@~]# /dm8/bin/disql SYSDBA/SYSDBA@172.16.1.2:5236 SQL> ALTER DATABASE MOUNT; SQL> ALTER DATABASE ARCHIVELOG; SQL> ALTER DATABASE ADD ARCHIVELOG 'DEST=/dm8/data/MPP1_02/arch, TYPE=LOCAL, FILE_SIZE=1024, SPACE_LIMIT=51200'; SQL> ALTER DATABASE OPEN;
– backup data
SQL> BACKUP DATABASE BACKUPSET '/dm8/data/MPP1_02/bak/BACKUP_FILE';
– modify 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);
- replace dmarch ini
[dmdba@~]# vi /dm8/data/MPP1_02/dmarch.ini [ARCHIVE_LOCAL] ARCH_TYPE = LOCAL #Local archive type ARCH_DEST = /dm8/data/MPP1_02/arch/ #Local archive storage path ARCH_FILE_SIZE = 1024 #Single archive size in MB ARCH_SPACE_LIMIT = 51200 #Archive upper limit in MB [ARCHIVE_REALTIME] ARCH_TYPE = REALTIME #Real time archive type ARCH_DEST = MPP1_02B #Real time archive target instance name
- create dmmal ini
[dmdba@~]# vi /dm8/data/MPP1_01/dmmal.ini MAL_CHECK_INTERVAL = 10 #MAL link detection interval MAL_CONN_FAIL_INTERVAL = 10 #Determine the disconnection time of MAL link MAL_TEMP_PATH = /dm8/data/malpath/MPP1_01/ #Temporary file directory MAL_BUF_SIZE = 512 #Single MAL cache size in MB MAL_SYS_BUF_SIZE = 2048 #MAL total size limit in MB MAL_COMPRESS_LEVEL = 0 #MAL message compression level, 0 means no compression [MAL_INST1] MAL_INST_NAME = MPP1_01 #Instance name, and DM Instance in ini_ Name consistent MAL_HOST = 192.168.177.129 #The MAL system listens to the IP address of the TCP connection MAL_PORT = 5336 #MAL system listens to the port of TCP connection MAL_INST_HOST = 192.168.177.129 #External service IP address of the instance MAL_INST_PORT = 5236 #Instance external service port, and DM Port in ini_ Num consistent MAL_DW_PORT = 5436 #The daemon corresponding to the instance listens to the port of the TCP connection MAL_INST_DW_PORT = 5536 #The port on which the instance listens for daemon TCP connections [MAL_INST2] MAL_INST_NAME = MPP1_01B MAL_HOST = 192.168.177.130 MAL_PORT = 5337 MAL_INST_HOST = 192.168.177.130 MAL_INST_PORT = 5237 MAL_DW_PORT = 5437 MAL_INST_DW_PORT = 5537 [MAL_INST3] MAL_INST_NAME = MPP1_02 MAL_HOST = 192.168.177.130 MAL_PORT = 5336 MAL_INST_HOST = 192.168.177.130 MAL_INST_PORT = 5236 MAL_DW_PORT = 5436 MAL_INST_DW_PORT = 5536 [MAL_INST4] MAL_INST_NAME = MPP1_02B MAL_HOST = 192.168.177.129 MAL_PORT = 5337 MAL_INST_HOST = 192.168.177.129 MAL_INST_PORT = 5237 MAL_DW_PORT = 5437 MAL_INST_DW_PORT = 5537
- create dmmpp ini
[dmdba@~]# vi /dm8/data/MPP1_02/dmmpp.ini [service_name1] mpp_seq_no = 0 mpp_inst_name = MPP1_01 [service_name2] mpp_seq_no = 1 mpp_inst_name = MPP1_02
- create dmmpp ctl
[dmdba@~]# /dm8/bin/dmctlcvt t2c /dm8/data/MPP1_02/dmmpp.ini /dm8/data/MPP1_02/dmmpp.ctl
- create dmwatcher ini
[dmdba@~]# vi /dm8/data/MPP1_02/dmwatcher.ini [GMPP1_01] DW_TYPE = GLOBAL #Global daemon type DW_MODE = MANUAL #Manual failover mode DW_ERROR_TIME = 20 #Remote daemon failure determination time INST_ERROR_TIME = 20 #Local instance fault determination time INST_RECOVER_TIME = 60 #The interval between the main library daemon starting recovery INST_OGUID = 45331 #Unique OGUID value of daemon INST_INI = /dm8/data/MPP1_01/dm.ini #dm.ini file path INST_AUTO_RESTART = 1 #Turn on the auto start function of the instance INST_STARTUP_CMD = /dm8/bin/dmserver #Command line startup RLOG_SEND_THRESHOLD = 0 #Specifies the time threshold for sending logs from the primary database to the standby database. It is closed by default RLOG_APPLY_THRESHOLD = 0 #Specifies the time threshold of the backup database replay log. It is off by default [GMPP1_02] DW_TYPE = GLOBAL DW_MODE = MANUAL DW_ERROR_TIME = 20 INST_ERROR_TIME = 20 INST_RECOVER_TIME = 60 INST_OGUID = 45332 INST_INI = /dm8/data/MPP1_02/dm.ini INST_AUTO_RESTART = 1 INST_STARTUP_CMD = /dm8/bin/dmserver RLOG_SEND_THRESHOLD = 0 RLOG_APPLY_THRESHOLD = 0
– copy the instance to machine A
[dmdba@~]# scp -r /dm8/data/MPP1_02 dmdba@192.168.177.129:/dm8/data/
- registration services
[root@~]# /dm8/script/root/dm_service_installer.sh -t dmserver -p MPP1_02 -dm_ini /dm8/data/MPP1_02/dm.ini -m mount [root@~]# /dm8/script/root/dm_service_installer.sh -t dmwatcher -p MPP1_02 -watcher_ini /dm8/data/MPP1_02/dmwatcher.ini Note: delete auto start [root@~]# /dm8/script/root/dm_service_uninstaller.sh -n DmServiceMPP1_02 [root@~]# /dm8/script/root/dm_service_uninstaller.sh -n DmWatcherServiceMPP1_02
3. Configure machine B - MPP1_01B Library
----Modify DM ini
[dmdba@~]# vi /dm8/data/MPP1_01/dm.ini INSTANCE_NAME = MPP1_01B #Database instance name PORT_NUM = 5237 #Database instance listening port
- replace dmarch ini
[dmdba@~]# vi /dm8/data/MPP1_01/dmarch.ini [ARCHIVE_LOCAL] ARCH_TYPE = LOCAL #Local archive type ARCH_DEST = /dm8/data/MPP1_01/arch/ #Local archive storage path ARCH_FILE_SIZE = 1024 #Single archive size in MB ARCH_SPACE_LIMIT = 51200 #Archive upper limit in MB [ARCHIVE_REALTIME] ARCH_TYPE = REALTIME #Real time archive type ARCH_DEST = MPP1_01 #Real time archive target instance name
- same configuration item
And A machine MPP1_01 of dmmal.ini,dmmpp.ini,dmmpp.ctl identical
- registration services
[root@~]# /dm8/script/root/dm_service_installer.sh -t dmserver -p MPP1_01B -dm_ini /dm8/data/MPP1_01/dm.ini -m mount Note: delete auto start [root@~]# /dm8/script/root/dm_service_uninstaller.sh -n DmServiceMPP1_01B
- recover data
[dmdba@~]# /dm8/bin/dmrman CTLSTMT="RESTORE DATABASE '/dm8/data/MPP1_01/dm.ini' FROM BACKUPSET '/dm8/data/MPP1_01/bak/BACKUP_FILE'" [dmdba@~]# /dm8/bin/dmrman CTLSTMT="RECOVER DATABASE '/dm8/data/MPP1_01/dm.ini' FROM BACKUPSET '/dm8/data/MPP1_01/bak/BACKUP_FILE'" [dmdba@~]# /dm8/bin/dmrman CTLSTMT="RECOVER DATABASE '/dm8/data/MPP1_01/dm.ini' UPDATE DB_MAGIC"
4. Configure machine A - MPP1_02B Library
- modify DM ini
[dmdba@~]# vi /dm8/data/MPP1_02/dm.ini INSTANCE_NAME = MPP1_02B #Database instance name PORT_NUM = 5237 #Database instance listening port
- replace dmarch ini
[dmdba@~]# vi /dm8/data/MPP1_02/dmarch.ini [ARCHIVE_LOCAL] ARCH_TYPE = LOCAL #Local archive type ARCH_DEST = /dm8/data/MPP1_02/arch/ #Local archive storage path ARCH_FILE_SIZE = 1024 #Single archive size in MB ARCH_SPACE_LIMIT = 51200 #Archive upper limit in MB [ARCHIVE_REALTIME] ARCH_TYPE = REALTIME #Real time archive type ARCH_DEST = MPP1_02 #Real time archive target instance name
----Configure the same item
And B machine MPP1_02 of dmmal.ini,dmmpp.ini,dmmpp.ctl identical
- registration services
[root@~]# /dm8/script/root/dm_service_installer.sh -t dmserver -p MPP1_02B -dm_ini /dm8/data/MPP1_02/dm.ini -m mount Note: delete auto start [root@~]# /dm8/script/root/dm_service_uninstaller.sh -n DmServiceMPP1_02B
- recover data
[dmdba@~]# /dm8/bin/dmrman CTLSTMT="RESTORE DATABASE '/dm8/data/MPP1_02/dm.ini' FROM BACKUPSET '/dm8/data/MPP1_02/bak/BACKUP_FILE'" [dmdba@~]# /dm8/bin/dmrman CTLSTMT="RECOVER DATABASE '/dm8/data/MPP1_02/dm.ini' FROM BACKUPSET '/dm8/data/MPP1_02/bak/BACKUP_FILE'" [dmdba@~]# /dm8/bin/dmrman CTLSTMT="RECOVER DATABASE '/dm8/data/MPP1_02/dm.ini' UPDATE DB_MAGIC"
5. Configure monitor
– create dmmonitor ini
[dmdba@~]# vi /dm8/bin/dmmonitor.ini MON_DW_CONFIRM = 0 #0 is not confirmed and 1 is confirmed MON_LOG_PATH = ../log #Monitor log file storage path MON_LOG_INTERVAL = 60 #Regularly record the system information to the log file every 60s MON_LOG_FILE_SIZE = 512 #Single log size in MB MON_LOG_SPACE_LIMIT = 2048 #Maximum log size in MB [GMPP1_01] MON_INST_OGUID = 45331 #Group gmpp1_ Unique OGUID value for 01 MON_DW_IP = 192.168.177.129:5436 #Mal corresponding to IP_ Host and port correspond to MAL_DW_PORT MON_DW_IP = 192.168.177.130:5437 [GMPP1_02] MON_INST_OGUID = 45332 #Group gmpp1_ Unique OGUID value for 02 MON_DW_IP = 192.168.177.130:5436 MON_DW_IP = 192.168.177.129:5437
- Registration Service (optional)
[root@~]# /dm8/script/root/dm_service_installer.sh -t dmmonitor -p Monitor -monitor_ini /dm8/bin/dmmonitor.ini Note: delete auto start [root@~]# /dm8/script/root/dm_service_uninstaller.sh -n DmMonitorServiceMonitor
5. Start service and view information
----Start the database and modify the parameters
-----A machine - MPP1_01
[dmdba@~]# /dm8/bin/DmServiceMPP1_01 start [dmdba@~]# /dm8/bin/disql SYSDBA/SYSDBA SQL> SP_SET_OGUID(45331); SQL> ALTER DATABASE PRIMARY;
----B machine - MPP1_02
[dmdba@~]# /dm8/bin/DmServiceMPP1_02 start [dmdba@~]# /dm8/bin/disql SYSDBA/SYSDBA SQL> SP_SET_OGUID(45332); SQL> ALTER DATABASE PRIMARY;
-----A machine - MPP1_02B
[dmdba@~]# /dm8/bin/DmServiceMPP1_02B start [dmdba@~]# /dm8/bin/disql SYSDBA/SYSDBA@192.168.177.129: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 machine - MPP1_01B
[dmdba@~]# /dm8/bin/DmServiceMPP1_01B start [dmdba@~]# /dm8/bin/disql SYSDBA/SYSDBA@@192.168.177.130: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);
-----Start daemon
A machine:
[dmdba@~]# /dm8/bin/DmWatcherServiceMPP1_01 start
B machine:
[dmdba@~]# /dm8/bin/DmWatcherServiceMPP1_02 start
-----Start monitor
[dmdba@~]# /dm8/bin/DmMonitorServiceMonitor start Foreground start: [dmdba@~]# /dm8/bin/dmmonitor /dm8/bin/dmmonitor.ini
----Stop
A Machine:[dmdba@~]# /dm8/bin/DmWatcherServiceMPP1_01 stop B Machine:[dmdba@~]# /dm8/bin/DmWatcherServiceMPP1_02 stop A Machine:[dmdba@~]# /dm8/bin/DmServiceMPP1_01 stop B Machine:[dmdba@~]# /dm8/bin/DmServiceMPP1_02 stop B Machine:[dmdba@~]# /dm8/bin/DmServiceMPP1_01B stop A Machine:[dmdba@~]# /dm8/bin/DmServiceMPP1_02B stop
3, Configure app connection
Linux environment: dm_svc.conf is placed in the / etc directory of the application server.
Windows32 environment: dm_svc.conf is placed in the System32 directory of the application server.
Windows64 environment: dm_svc.conf is placed in the application server System32 and SysWOW64 directories.
-----Create dm_svc.conf
[root@~]# vi /etc/dm_svc.conf TIME_ZONE=(+8:00) LANGUAGE=(cn) MPP1=(192.168.177.129:5236,192.168.177.130:5236,192.168.177.129:5237,192.168.177.130:5237) [MPP1] LOGIN_MODE=(1) SWITCH_TIME=(300) SWITCH_INTERVAL=(200)
------Application connection
<DRIVER>dm.jdbc.driver.DmDriver</DRIVER> <URL>jdbc:dm://MPP1</URL>
Dameng technology community address: https://eco.dameng.com