Steps to set up MPP backup cluster for DM database

1. Introduction

MPP backup is to configure a set of real-time backup systems for each MPP node on the basis of MPP cluster. These real-time backup systems together constitute the MPP backup system. The MPP backup system consists of several daemon groups. Each daemon group is a relatively independent real-time backup system. It has the basic functions of real-time backup, and can perform such operations as master-backup switching and backup takeover.

2. Preparation

1. The Dream database is installed on all three Linux virtual machines

2. All three virtual machines can Ping each other

3. Planning

According to the introduction of MPP backup, we need to have an IP and port planning for the MPP backup cluster. The operating system default linux is as follows:

Machine NumberIP Addressstate
A192.168.18.1

Main Library GRP1_MPP_EP01:5236

Repository GRP2_MPP_EP22:5237

B192.168.18.3

Main Library GRP2_MPP_EP02:5236

Repository GRP1_MPP_EP11:5237

C192.168.18.4monitor

4. Build

1. To synchronize the data first, that is, to keep the four databases in the same state, you can refer to me for specific operation methods. Previous blogs

2. Configure the DM of the main library instance. INI file

INSTANCE_NAME = GRP1_MPP_EP01
PORT_NUM = 5236 #Database Instance Listening Port
DW_INACTIVE_INTERVAL = 60 #Receive daemon message timeout
ALTER_MODE_STATUS = 0 
ENABLE_OFFLINE_TS = 2 
MAL_INI = 1 #Open MAL System
ARCH_INI = 1 #Open Archive Configuration
MPP_INI = 1 #Enable MPP Configuration
RLOG_SEND_APPLY_MON = 64 

3. Configure dmmal.ini file, dmmal for each primary repository. The INI files are consistent.

MAL_CHECK_INTERVAL = 5 #MAL Link Detection Interval
MAL_CONN_FAIL_INTERVAL = 5 #Decide when MAL link is disconnected
[MAL_INST1]
 MAL_INST_NAME = GRP1_MPP_EP01 #Instance name, and dm. INSTANCE_in ini NAME Consistency
 MAL_HOST = 192.168.18.1 #MAL system listens for IP address of TCP connection
 MAL_PORT = 5337 #Port on which the MAL system listens for TCP connections
 MAL_INST_HOST = 192.168.18.1#External Service IP Address of Instance
 MAL_INST_PORT = 5236 #Instance's external service port, and dm. PORT_in ini NUM Consistency
 MAL_DW_PORT = 5253 #The port on which the daemon corresponding to the instance listens for TCP connections
MAL_INST_DW_PORT = 5243 #Port for instance listening daemon TCP connection
[MAL_INST2]
 MAL_INST_NAME = GRP2_MPP_EP02
 MAL_HOST = 192.168.18.3
 MAL_PORT = 5337
 MAL_INST_HOST = 192.168.18.3
 MAL_INST_PORT = 5236
 MAL_DW_PORT = 5253
MAL_INST_DW_PORT = 5243
[MAL_INST3]
 MAL_INST_NAME = GRP1_MPP_EP11
 MAL_HOST = 192.168.18.3
 MAL_PORT = 5338
 MAL_INST_HOST = 192.168.18.3
 MAL_INST_PORT = 5237
 MAL_DW_PORT = 5254
MAL_INST_DW_PORT = 5244
[MAL_INST4]
 MAL_INST_NAME = GRP2_MPP_EP22
 MAL_HOST = 192.168.18.1
 MAL_PORT = 5338
 MAL_INST_HOST = 192.168.18.1
 MAL_INST_PORT = 5237
 MAL_DW_PORT = 5254
MAL_INST_DW_PORT = 5244

4. Configure dmarch.ini, when the current instance is the primary library, data synchronization is required to the standby, so when the current instance is the primary library 01, ARCH_ Instance name for DEST parameter configuration as standby Library

[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME #Real-time archive type
ARCH_DEST = GRP1_MPP_EP11 #Real-time archiving target instance name
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL #Local archive type
ARCH_DEST = Installation Path/data/EP01/DAMENG/arch #Local Archive File Storage Path
ARCH_FILE_SIZE = 128 #Unit Mb
ARCH_SPACE_LIMIT = 0 #Unit Mb, 0 means unlimited

5. Configure dmmpp.ctl file, in dm. In ini, we will MPP_INI is set to 1, so dmmpp needs to be configured. CTL file, change file to binary file, need to pass dmmpp.ini file converted to dmmpp. The ini configuration is as follows:

[service_name1]
mpp_seq_no = 0
mpp_inst_name = GRP1_MPP_EP01
[service_name2] 
mpp_seq_no = 1
mpp_inst_name = GRP2_MPP_EP02

Each service_ The name option needs to contain the sequence number and the instance name of the node within the MPP system (primary library)

6. Will dmmpp. The INI file is converted using the dmctlcvt tool (in the bin directory).

./dmctlcvt TYPE=2 SRC=Installation Path/data/EP01/DAMENG/dmmpp.ini  DEST=Installation Path/data/EP01/DAMENG/dmmpp.ctl

7. Start the main library as mount to set OGUID and modify the database mode

./disql SYSDBA/SYSDBA@localhost:5236
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
SQL>sp_set_oguid(45330);
SQL>alter database primary;
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);

8. The configuration of the main library 02 is similar to 01, only need to modify dm. In ini

INSTANCE_NAME = GRP2_MPP_EP02

PORT_NUM = 5236 

That's it.

Similarly, dmarch. Simply modify ARCH_in ini DEST is the name of the standby instance corresponding to the primary library.

ARCH_DEST = GRP2_MPP_EP22 

The remaining dmmals. Ini and dmmpp.ctl can be copied directly from main library 01.

9. Start in mount mode, set OGUID and database mode in the same way as main library 01, modify OGUID to 45331, that is:

SQL>sp_set_oguid(45331);

10. The two repositories are configured in the same way as the main repository. Note dm. Instance name INSTANCE_in ini NAME and port number PORT_NUM should not write wrong.

11. dmarch of the repository. In ini, ARCH_ The DEST parameter is to fill in the corresponding main library, where 11 Repositories on machine B are exemplified:

[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME #Real-time archive type
ARCH_DEST = GRP1_MPP_EP01 #Real-time archiving target instance name
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL #Local archive type
ARCH_DEST = Installation Path/data/EP01/DAMENG/arch #Local Archive File Storage Path
ARCH_FILE_SIZE = 128 #Unit Mb,
ARCH_SPACE_LIMIT = 0 #Unit Mb, 0 means unlimited

12. The rest of the dmmals. Ini and dmmpp. Copy the CTL from the main library to this point.

13. The mode of modifying the two repositories is standby, and the OGUID is consistent with the corresponding primary library. For example, the OGUID of repository 11 on machine B is the same as that of primary library 01 on machine A.

./disql SYSDBA/SYSDBA@localhost:5236
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
SQL>sp_set_oguid(45330);
SQL>alter database standby;
SQL>SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);

14. Normally, each database instance uses a separate daemon, but in this case, each machine contains two instances, so you can configure only one daemon to guard two instances.

Machine A:

[GRP1]
DW_TYPE = GLOBAL #Global daemon type
DW_MODE = AUTO #Automatic switch mode
DW_ERROR_TIME = 10 #Remote Daemon Failure Recognition Time
INST_RECOVER_TIME = 60 #Time interval for the primary daemon to start recovery
INST_ERROR_TIME = 10 #Local instance failure determination time
INST_OGUID = 45330 #Daemon unique OGUID value
INST_INI = Installation Path/data/EP01/DAMENG/dm.ini #dm.ini Profile Path
INST_AUTO_RESTART = 1 #Turn on auto-start for instances
INST_STARTUP_CMD = Installation Path/bin/dmserver #Command Line Start
RLOG_SEND_THRESHOLD = 0 #Specify a time threshold for the primary library to send logs to the standby, shut down by default
RLOG_APPLY_THRESHOLD = 0 #Specify a time threshold for reproducing the log for the backup, and turn it off by default
[GRP2]
DW_TYPE = GLOBAL #Global daemon type
DW_MODE = AUTO #Automatic switch mode
DW_ERROR_TIME = 10 #Remote Daemon Failure Recognition Time
INST_RECOVER_TIME = 60 #Time interval for the primary daemon to start recovery
INST_ERROR_TIME = 10 #Local instance failure determination time
INST_OGUID = 45331 #Daemon unique OGUID value
INST_INI = Installation Path/data/EP02/DAMENG/dm.ini #dm.ini Profile Path
INST_AUTO_RESTART = 1 #Turn on auto-start for instances
INST_STARTUP_CMD = Installation Path/bin/dmserver #Command Line Start
RLOG_SEND_THRESHOLD = 0 #Specify a time threshold for the primary library to send logs to the standby, shut down by default
RLOG_APPLY_THRESHOLD = 0 #Specify a time threshold for reproducing the log for the backup, and turn it off by default

Machine B:

[GRP1]
DW_TYPE = GLOBAL #Global daemon type
DW_MODE = AUTO #Automatic switch mode
DW_ERROR_TIME = 10 #Remote Daemon Failure Recognition Time
INST_RECOVER_TIME = 60 #Time interval for the primary daemon to start recovery
INST_ERROR_TIME = 10 #Local instance failure determination time
INST_OGUID = 45330 #Daemon unique OGUID value
INST_INI = Installation Path/data/EP01/DAMENG/dm.ini #dm.ini Profile Path
INST_AUTO_RESTART = 1 #Turn on auto-start for instances
INST_STARTUP_CMD = /dm/bin/dmserver #Command Line Start
RLOG_SEND_THRESHOLD = 0 #Specify a time threshold for the primary library to send logs to the standby, shut down by default
RLOG_APPLY_THRESHOLD = 0 #Specify a time threshold for reproducing the log for the backup, and turn it off by default
[GRP2]
DW_TYPE = GLOBAL #Global daemon type
DW_MODE = AUTO #Automatic switch mode
DW_ERROR_TIME = 10 #Remote Daemon Failure Recognition Time
INST_RECOVER_TIME = 60 #Time interval for the primary daemon to start recovery
INST_ERROR_TIME = 10 #Local instance failure determination time
INST_OGUID = 45331 #Daemon unique OGUID value
INST_INI = Installation Path/data/EP02/DAMENG/dm.ini #dm.ini Profile Path
INST_AUTO_RESTART = 1 #Turn on auto-start for instances
INST_STARTUP_CMD = /dm/bin/dmserver #Command Line Start
RLOG_SEND_THRESHOLD = 0 #Specify a time threshold for the primary library to send logs to the standby, shut down by default
RLOG_APPLY_THRESHOLD = 0 #Specify a time threshold for reproducing the log for the backup, and turn it off by default

Note: INST_for both machines here INI is the same, but the actual process is modified based on the actual installation path of the database instance.

15. Configure Single Instance Monitor on Machine C

MON_DW_CONFIRM = 1 #Confirm monitor mode
MON_LOG_PATH = Installation Path/data/log #Monitor log file storage path
MON_LOG_INTERVAL = 60 #Timely record system information to log file every 60s
MON_LOG_FILE_SIZE = 32 #Maximum 32M per log file
MON_LOG_SPACE_LIMIT = 0 #Unlimited total log file space
[GRP1]
MON_INST_OGUID = 45330 #Unique OGUID value for group GRP1
#IP corresponds to dmmal. MAL_in ini HOST, PORT corresponds to dmmal. MAL_in ini DW_ PORT
MON_DW_IP = 192.168.18.1:5253
MON_DW_IP = 192.168.18.3:5254
[GRP2]
MON_INST_OGUID = 45331 #Unique OGUID value for group GRP2
#IP corresponds to dmmal. MAL_in ini HOST, PORT corresponds to dmmal. MAL_in ini DW_ PORT
MON_DW_IP = 192.168.18.1:5253
MON_DW_IP = 192.168.18.3:5254

16. Startup

Start the daemon on the AB machine first.

./dmwatcher Installation Path/data/EP01/DAMENG/dmwatcher.ini

Starting the daemon automatically pulls up the corresponding instance to open

Then start the monitor on machine C.

./dmmonitor Installation Path/data/dmmonitor.ini

After the monitor starts, you can see that all instances are open and the daemon is open, indicating that it is working properly.

 

5. Error Correction

If the database instance is mount ed after the daemon starts, check each daemon's INST_first AUTO_ Whether the RESTART parameter is 1.

If the configuration is okay, it is possible that the instance was started in a normal state rather than a mount state, causing the database instance to be out of sync, at which point you may need to stop the MPP cluster, restore the database instance, and then proceed with subsequent operations.

To learn more about the Dream Cloud Adaptation Center, please visit the Dream Cloud Adaptation Center: https://eco.dameng.com/

Keywords: Database

Added by logicopinion on Wed, 29 Dec 2021 00:12:54 +0200