Dameng mpp+ active and standby cluster deployment

Damon massively parallel processing MPP is a completely peer-to-peer shared-nothing cluster component developed based on Damon database management system. It supports the organization of multiple DM database instances into a parallel computing network and provides unified database services to the outside world.

Preparation before installation:

This article shares how to deploy mpp+ active and standby clusters, prepare 3 virtual machines, and configure dual IP s for each node, two nodes are cross-configured with active and standby, and one is configured with a monitor.

node

Heartbeat IP

Service IP

EP01/EP12 (EP02 backup library)

193.168.33.128

193.168.23.128

EP02/EP11 (EP01 backup library)

193.168.33.129

193.168.23.129

monitor

193.168.33.131

Install and deploy:

1. Install the data and initialize the instance, and initialize the main library EP01 and EP12 (the standby library of EP02) on node 1. The main database EP02 and EP11 (the standby database of EP01) are initialized on node 2, the database installation steps are omitted, and you can refer to previous blogs

./dminit path=/dm/dmdata PAGE_SIZE=32 LOG_SIZE=1024 CASE_SENSITIVE=N CHARSET=1 PORT_NUM=5236 DB_NAME=EP01 INSTANCE_NAME=EP01
./dminit path=/dm/dmdata PAGE_SIZE=32 LOG_SIZE=1024 CASE_SENSITIVE=N CHARSET=1 PORT_NUM=5237 DB_NAME=EP12 INSTANCE_NAME=EP12
./dminit path=/dm/dmdata PAGE_SIZE=32 LOG_SIZE=1024 CASE_SENSITIVE=N CHARSET=1 PORT_NUM=5236 DB_NAME=EP02 INSTANCE_NAME=EP02
./dminit path=/dm/dmdata PAGE_SIZE=32 LOG_SIZE=1024 CASE_SENSITIVE=N CHARSET=1 PORT_NUM=5237 DB_NAME=EP11 INSTANCE_NAME=EP11

2. Modify the dm.ini files of EP01 and EP02

DW_INACTIVE_INTERVAL = 60 #Timeout for receiving daemon messages
ENABLE_OFFLINE_TS = 2 #Standby OFFLINE tablespace is not allowed
MAL_INI = 1 #Open MAL system
ARCH_INI = 1 #Open archive configuration
MPP_INI = 1 #Enable MPP configuration

3. Configure dmmal.ini, the dmmal.ini configuration of each master and backup library must be exactly the same

MAL_CHECK_INTERVAL = 30 #MAL link detection interval
MAL_CONN_FAIL_INTERVAL = 30 #Determine when the MAL link is down
[MAL_INST1]
 MAL_INST_NAME = EP01 #Instance name, consistent with INSTANCE_NAME in dm.ini
 MAL_HOST = 192.168.33.128 #The IP address on which the MAL system listens for TCP connections
 MAL_PORT = 5337 #The port on which the MAL system listens for TCP connections
 MAL_INST_HOST = 192.168.23.128 #The external service IP address of the instance
 MAL_INST_PORT = 5236 #The external service port of the instance, which is the same as PORT_NUM in dm.ini
 MAL_DW_PORT = 5253 #The port on which the daemon corresponding to the instance listens for TCP connections
 MAL_INST_DW_PORT = 5243 #The port on which the instance listens for daemon TCP connections
[MAL_INST2]
 MAL_INST_NAME = EP02
 MAL_HOST = 192.168.33.129
 MAL_PORT = 5337
 MAL_INST_HOST = 192.168.23.129
 MAL_INST_PORT = 5236
 MAL_DW_PORT = 5253
MAL_INST_DW_PORT = 5243
[MAL_INST3]
 MAL_INST_NAME = EP11
 MAL_HOST = 192.168.33.129
 MAL_PORT = 5338
 MAL_INST_HOST = 192.168.23.129
 MAL_INST_PORT = 5237
 MAL_DW_PORT = 5254
MAL_INST_DW_PORT = 5244
[MAL_INST4]
 MAL_INST_NAME = EP12
 MAL_HOST = 192.168.33.128
 MAL_PORT = 5338
 MAL_INST_HOST = 192.168.23.128
 MAL_INST_PORT = 5237
 MAL_DW_PORT = 5254
MAL_INST_DW_PORT = 5244

4. Configure dmarch.ini of EP01, set real-time archive, EP02 is the same, ARCH_DEST points to the respective standby database

[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm/dmarch/EP01
ARCH_FILE_SIZE = 256
ARCH_SPACE_LIMIT = 4096
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME #real-time archive type
ARCH_DEST = EP11 #Real-time archive target instance name

5. Generate dmmpp.ctl, configure dmmpp.ini first, mpp_seq_no cannot be the same, and then use the dmctlcvt tool to convert, the tool is in the bin path of the Dameng database installation directory

[service_name1]
mpp_seq_no = 0
mpp_inst_name = EP01
[service_name2] 
mpp_seq_no = 1
mpp_inst_name = EP02

Convert: ./dmctlcvt type=2 src=/dm/dmdata/EP01/dmmpp.ini dest=/dm/dmdata/EP01/dmmpp.ctl

6. Start the EP01 main library in the mount mode and set the oguid and modification mode. Note that the oguid of EP01 and EP11 are the same, and the oguid of EP02 and EP12 are the same.

sp_set_oguid(20210818);
alter DATABASE PRIMARY;
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);

7. Send dmmal.ini and dmmpp.ctl to EP02 and configure the archive

[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm/dmarch/EP01
ARCH_FILE_SIZE = 256
ARCH_SPACE_LIMIT = 4096
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME #real-time archive type
ARCH_DEST = EP12 #Real-time archive target instance name

8. Start EP02 in the mount mode, and set the oguid and mode, note that the oguid is different

sp_set_oguid(20210819);
alter DATABASE PRIMARY;
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);

9. For the standby database EP11 configured on the EP02 node, edit dm.ini

DW_INACTIVE_INTERVAL = 60 #Timeout for receiving daemon messages
ENABLE_OFFLINE_TS = 2 #Standby OFFLINE tablespace is not allowed
MAL_INI = 1 #Open MAL system
ARCH_INI = 1 #Open archive configuration
MPP_INI = 1 #Enable MPP configuration

10. Send dmmal.ini and dmmpp.ctl to EP11 and configure the archive

[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm/dmarch/EP11
ARCH_FILE_SIZE = 256
ARCH_SPACE_LIMIT = 4096
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME #real-time archive type
ARCH_DEST = EP01#Real-time archive target instance name

11. Start the standby database EP11 in mount mode and set the oguid and database mode. Note that the oguid is the same as EP01

sp_set_oguid(20210818);
alter DATABASE STANDBY;
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);

12. For standby database EP12 configured on node EP01, edit dm.ini

DW_INACTIVE_INTERVAL = 60 #Timeout for receiving daemon messages
ENABLE_OFFLINE_TS = 2 #Standby OFFLINE tablespace is not allowed
MAL_INI = 1 #Open MAL system
ARCH_INI = 1 #Open archive configuration
MPP_INI = 1 #Enable MPP configuration

13. Copy dmmal.ini and dmmpp.ctl to EP12 and configure the archive

[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm/dmarch/EP12
ARCH_FILE_SIZE = 256
ARCH_SPACE_LIMIT = 4096
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME #real-time archive type
ARCH_DEST = EP02#Real-time archive target instance name

14. Start the standby database EP12 in mount mode, and set the oguid and database mode

sp_set_oguid(20210819);
alter DATABASE STANDBY;
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);

15. Configure data guarding, first configure it on EP01

[GRP1]
DW_TYPE = GLOBAL #Global Guardian Type
DW_MODE = AUTO #Auto switch mode
DW_ERROR_TIME = 10 #Remote daemon failure identification time
INST_RECOVER_TIME = 60 #The interval between the start and recovery of the main library daemon
INST_ERROR_TIME = 10 #Local instance failure identification time
INST_OGUID = 20210818 #The unique OGUID value of the daemon system
INST_INI = /dm/dmdata/EP01/dm.ini #dm.ini configuration file path
INST_AUTO_RESTART = 1 #Turn on autostart for instances
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver #Start from the command line
RLOG_SEND_THRESHOLD = 0 #Specifies the time threshold for the primary database to send logs to the standby database, which is disabled by default
RLOG_APPLY_THRESHOLD = 0 #Specifies the time threshold for the standby database to replay the log, which is disabled by default
[GRP2]
DW_TYPE = GLOBAL #Global Guardian Type
DW_MODE = AUTO #Auto switch mode
DW_ERROR_TIME = 10 #Remote daemon failure identification time
INST_RECOVER_TIME = 60 #The interval between the start and recovery of the main library daemon
INST_ERROR_TIME = 10 #Local instance failure identification time
INST_OGUID = 20210819 #The unique OGUID value of the daemon system
INST_INI = /dm/dmdata/EP12/dm.ini #dm.ini configuration file path
INST_AUTO_RESTART = 1 #Turn on autostart for instances
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver #Start from the command line
RLOG_SEND_THRESHOLD = 0 #Specifies the time threshold for the primary database to send logs to the standby database, which is disabled by default
RLOG_APPLY_THRESHOLD = 0 #Specifies the time threshold for the standby database to replay the log, which is disabled by default

16. Configuration on EP02

[GRP1]
DW_TYPE = GLOBAL #Global Guardian Type
DW_MODE = AUTO #Auto switch mode
DW_ERROR_TIME = 10 #Remote daemon failure identification time
INST_RECOVER_TIME = 60 #The interval between the start and recovery of the main library daemon
INST_ERROR_TIME = 10 #Local instance failure identification time
INST_OGUID = 20210818 #The unique OGUID value of the daemon system
INST_INI = /dm/dmdata/EP11/dm.ini #dm.ini configuration file path
INST_AUTO_RESTART = 1 #Turn on autostart for instances
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver #Start from the command line
RLOG_SEND_THRESHOLD = 0 #Specifies the time threshold for the primary database to send logs to the standby database, which is disabled by default
RLOG_APPLY_THRESHOLD = 0 #Specifies the time threshold for the standby database to replay the log, which is disabled by default
[GRP2]
DW_TYPE = GLOBAL #Global Guardian Type
DW_MODE = AUTO #Auto switch mode
DW_ERROR_TIME = 10 #Remote daemon failure identification time
INST_RECOVER_TIME = 60 #The interval between the start and recovery of the main library daemon
INST_ERROR_TIME = 10 #Local instance failure identification time
INST_OGUID = 20210819 #The unique OGUID value of the daemon system
INST_INI = /dm/dmdata/EP02/dm.ini #dm.ini configuration file path
INST_AUTO_RESTART = 1 #Turn on autostart for instances
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver #Start from the command line
RLOG_SEND_THRESHOLD = 0 #Specifies the time threshold for the primary database to send logs to the standby database, which is disabled by default
RLOG_APPLY_THRESHOLD = 0 #Specifies the time threshold for the standby database to replay the log, which is disabled by default

17. Configure two monitors on the third virtual machine, one confirming monitor and one non-confirming monitor, which is convenient for operation and maintenance

MON_DW_CONFIRM = 1 #1 is to confirm monitor mode
MON_LOG_PATH = /dm8/dmdba/dmdbms/log #Monitor log file storage path
MON_LOG_INTERVAL = 60 #Regularly record system information to the log file every 60s
MON_LOG_FILE_SIZE = 32 #Maximum 32M per log file
MON_LOG_SPACE_LIMIT = 0 #Unlimited total space occupied by log files
[GRP1]
MON_INST_OGUID = 20210818 #Unique OGUID value for group GRP1
#The following configuration is the connection information of the monitor to the daemon of group GRP1, configured in the form of --IP:PORT
#IP corresponds to MAL_HOST in dmmal.ini, PORT corresponds to MAL_DW_PORT in dmmal.ini
MON_DW_IP = 192.168.33.128:5253
MON_DW_IP = 192.168.33.129:5254
[GRP2]
MON_INST_OGUID = 20210819 #Unique OGUID value for group GRP2
#The following configuration is the connection information of the monitor to the daemon of group GRP2, configured in the form of --IP:PORT?
#IP corresponds to MAL_HOST in dmmal.ini, PORT corresponds to MAL_DW_PORT in dmmal.ini
MON_DW_IP = 192.168.33.129:5253
MON_DW_IP = 192.168.33.128:5254

18. Register the daemon service on EP01 and EP02 respectively

./dm_service_installer.sh -t dmwatcher -p EP1 -watcher_ini /dm/dmdata/EP01/dmwatcher.ini
./dm_service_installer.sh -t dmwatcher -p EP2 -watcher_ini /dm/dmdata/EP02/dmwatcher.ini

19. Start the daemon process separately, and confirm whether the cluster status is normal by observing the ordinary monitor

20. After confirming that it is normal, register the monitor service and start it as a service

./dm_service_installer.sh -t dmmonitor -p EP -monitor_ini /dm8/dmdba/dmdbms/bin/dmmonitor0.ini
Systemctl start DmMonitorEP

At this point, the dmmpp+ active and standby cluster deployment sharing is completed

---------------------------------------------------------------------------------------------------------------------------------

For more technical dry goods, please visit the Dameng Technology Community:

https://eco.dameng.com

Posted by drunkenfury on Thu, 02 Jun 2022 18:47:20 +0530