Detailed process of Dameng mpp + active and standby

1. Refer to DM for software installation steps_ dw. txt

First node           Second node
EP01 (main)         EP02 ((main)
EP12 (prepare)         EP11 ((standby)

2. Install mpp active / standby

--------------------First node 0.101

(1) Initialize instance
EP01 main library:

./dminit PATH=/dm8/dmdata DB_NAME=EP01 INSTANCE_NAME="EP01" PORT_NUM=5239

EP12 standby warehouse:

./dminit PATH=/dm8/dmdata DB_NAME=EP12 INSTANCE_NAME="EP12" PORT_NUM=5240

(2) After initialization, start and stop the warehouse respectively
EP01 main library:

./dmserver /dm8/dmdata/EP01/dm.ini

EP12 standby warehouse:

cd /dm8/dmdbms/bin
./dmserver /dm8/dmdata/EP12/dm.ini

--------------------Second node 0.102

(1) Initialize instance
EP02 main library:

cd /dm8/dmdbms/bin
./dminit PATH=/dm8/dmdata DB_NAME=EP02 INSTANCE_NAME="EP02" PORT_NUM=5239

EP11 spare warehouse:

cd /dm8/dmdbms/bin
./dminit PATH=/dm8/dmdata DB_NAME=EP11 INSTANCE_NAME="EP11" PORT_NUM=5240

(2) After initialization, start and stop the warehouse respectively
EP02 main library:

cd /dm8/dmdbms/bin
./dmserver /dm8/dmdata/EP02/dm.ini

EP11 spare warehouse:

cd /dm8/dmdbms/bin
./dmserver /dm8/dmdata/EP11/dm.ini

3. Backup restore

(1) Offline backup of main library EP01 on server dm01:

cd /dm8/dmdbms/bin
./dmrman ctlstmt="backup database '/dm8/dmdata/EP01/dm.ini' full to BACKUP_FILE_01 backupset '/dm8/dmdata/EP01/BACKUP_FILE_01'"

(2) Copy the backup to the server dm02 where the backup EP11 is located

cd /dm8/dmdata/EP01
scp -r BACKUP_FILE_01/ dmdba@192.168.1.102:/dm8/dmdata/EP11

(3) Perform offline restore recovery update on server dm02
Restore:

cd /dm8/dmdbms/bin
./dmrman CTLSTMT="RESTORE DATABASE '/dm8/dmdata/EP11/dm.ini' FROM BACKUPSET '/dm8/dmdata/EP11/BACKUP_FILE_01'"

Recovery:

cd /dm8/dmdbms/bin
./dmrman CTLSTMT="RECOVER DATABASE '/dm8/dmdata/EP11/dm.ini' FROM BACKUPSET '/dm8/dmdata/EP11/BACKUP_FILE_01'"

Update DB_MAGIC:

cd /dm8/dmdbms/bin
./dmrman CTLSTMT="RECOVER DATABASE '/dm8/dmdata/EP11/dm.ini' UPDATE DB_MAGIC"

6.4.2 back up EP02 data to EP12
(1) Offline backup of main library EP02 on server dm02:

cd /dm8/dmdbms/bin
./dmrman ctlstmt="backup database '/dm8/dmdata/EP02/dm.ini' full to BACKUP_FILE_11 backupset '/dm8/dmdata/EP02/BACKUP_FILE_11'"

(2) Transfer the backup copy to the server dm01 where the backup EP12 is located

cd /dm8/dmdata/EP02
scp -r BACKUP_FILE_11/ dmdba@192.168.1.101:/dm8/dmdata/EP12

(3) Perform offline restore recovery update on server dm01
Restore:

cd /dm8/dmdbms/bin
./dmrman CTLSTMT="RESTORE DATABASE '/dm8/dmdata/EP12/dm.ini' FROM BACKUPSET '/dm8/dmdata/EP12/BACKUP_FILE_11'"

Recovery:

cd /dm8/dmdbms/bin
./dmrman CTLSTMT="RECOVER DATABASE '/dm8/dmdata/EP12/dm.ini' FROM BACKUPSET '/dm8/dmdata/EP12/BACKUP_FILE_11'"

Update DB_MAGIC:

cd /dm8/dmdbms/bin
./dmrman CTLSTMT="RECOVER DATABASE '/dm8/dmdata/EP12/dm.ini' UPDATE DB_MAGIC"

4. DM MPP configuration

Configure ****** 4 instances on two servers
(1) Configure DM INI file

cd /dm8/dmdata/EP01/
vi dm.ini
INSTANCE_NAME        = EP01
PORT_NUM             = 5239         #Database instance listening port
DW_INACTIVE_INTERVAL = 60           #Timeout for receiving daemon messages
ALTER_MODE_STATUS    = 0            #Manual modification of instance mode / status / OGUID is not allowed
ENABLE_OFFLINE_TS    = 2            #OFFLINE tablespace of standby database is not allowed
MAL_INI              = 1            #Open MAL system
ARCH_INI             = 1            #Open archive configuration
MPP_INI              = 1            #Open MPP configuration
RLOG_SEND_APPLY_MON  = 64           #Count the log replay information of the last 64 times

cd /dm8/dmdata/EP12/
cd /dm8/dmdata/EP02/
cd /dm8/dmdata/EP11/

Two node inspection:
grep -E 'INSTANCE_NAME|PORT_NUM|DW_INACTIVE_INTERVAL|ALTER_MODE_STATUS|MAL_INI|ARCH_INI|MPP_INI|RLOG_SEND_APPLY_MON' /dm8/dmdata/EP*/dm.ini 

(2) Configure dmmal ini
Dmmal of each primary database and standby database Ini configuration must be completely consistent.

MAL_CHECK_INTERVAL     = 5              #MAL link detection interval
MAL_CONN_FAIL_INTERVAL = 5              #Determine the disconnection time of MAL link
[MAL_INST1]
MAL_INST_NAME          = EP01           #Instance name, and DM Instance in ini_ Name consistent
MAL_HOST               = 192.168.0.101  #MAL system monitors the IP address of TCP connection
MAL_PORT               = 5337           #MAL system listens to the port of TCP connection
MAL_INST_HOST          = 192.168.1.101  #External service IP address of the instance
MAL_INST_PORT          = 5239           #The external service port of the instance, and DM Port in ini_ Num consistent
MAL_DW_PORT            = 5253           #The daemon corresponding to the instance listens to the port of the TCP connection
MAL_INST_DW_PORT       = 5243           #The instance listens on the port of the daemon TCP connection

[MAL_INST2]
MAL_INST_NAME          = EP02
MAL_HOST               = 192.168.0.102
MAL_PORT               = 5337
MAL_INST_HOST          = 192.168.1.102
MAL_INST_PORT          = 5239
MAL_DW_PORT            = 5253
MAL_INST_DW_PORT       = 5243

[MAL_INST3]
MAL_INST_NAME          = EP12
MAL_HOST               = 192.168.0.101
MAL_PORT               = 5338
MAL_INST_HOST          = 192.168.1.101
MAL_INST_PORT          = 5240
MAL_DW_PORT            = 5254
MAL_INST_DW_PORT       = 5244

[MAL_INST4]
MAL_INST_NAME          = EP11
MAL_HOST               = 192.168.0.102
MAL_PORT               = 5338
MAL_INST_HOST          = 192.168.1.102
MAL_INST_PORT          = 5240
MAL_DW_PORT            = 5254
MAL_INST_DW_PORT       = 5244

cp /dm8/dmdata/EP01/dmmal.ini /dm8/dmdata/EP12/dmmal.ini
scp /dm8/dmdata/EP01/dmmal.ini 192.168.1.102:/dm8/dmdata/EP02/dmmal.ini
scp /dm8/dmdata/EP01/dmmal.inil 192.168.1.102:/dm8/dmdata/EP11/dmmal.ini

(3) Configure dmarch ini
Modify dmarch Ini to configure real-time archiving. In addition to local archiving, arch in other archiving configuration items_ Dest indicates the name of the target instance that needs to synchronize archived data when the instance is in Primary mode. The current instance EP01 is the Primary database and needs to synchronize data with the MPP standby database EP11, so arch is archived in real time_ Dest is configured as EP11.

cd /dm8/dmdata/EP01   *******4 Instances  *****

[ARCHIVE_REALTIME1]
ARCH_TYPE          =  REALTIME                 #Real time archive type
ARCH_DEST          =  EP11                     #Real time archiving target instance name ***********************************************************

[ARCHIVE_LOCAL1]
ARCH_TYPE          =  LOCAL                    #Local archive type
ARCH_DEST          =  /dm8/dmdata/EP01/bak    #Storage path of local archive file *******************************************************************
ARCH_FILE_SIZE     =  128                      #Unit Mb, maximum value of local single archive
ARCH_SPACE_LIMIT   =  1024                     #Unit Mb, 0 means unlimited, range 1024~4294967294M

cd /dm8/dmdata/EP12/       **********Pay attention to correspondence**************
cd /dm8/dmdata/EP02/
cd /dm8/dmdata/EP11/

(4) Configure dmmpp ctl
dmmpp.ctl is a binary file, which is created by dmmpp Ini text is converted by dmctlcvt tool, and dmmpp is configured first ini:

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

Convert dmmpp Ini is dmmpp CTL (under bin directory):

cd /dm8/dmdbms/bin
./dmctlcvt TYPE=2 SRC=/dm8/dmdata/EP01/dmmpp.ini DEST=/dm8/dmdata/EP01/dmmpp.ctl

cp /dm8/dmdata/EP01/dmmpp.ctl /dm8/dmdata/EP12/dmmpp.ctl
scp /dm8/dmdata/EP01/dmmpp.ctl 192.168.1.102:/dm8/dmdata/EP02/dmmpp.ctl
scp /dm8/dmdata/EP01/dmmpp.ctl 192.168.1.102:/dm8/dmdata/EP11/dmmpp.ctl

--------------------First node 0.101
-----Configure main library EP01
(1) Start the main library in mount mode

cd /dm8/dmdbms/bin
./dmserver /dm8/dmdata/EP01/dm.ini mount

(2) Configure OGUID
Start the command line tool dialql, use the MPP type as LOCAL mode, log in to the main database and set the OGUID value.

cd /dm8/dmdbms/bin
./disql SYSDBA/SYSDBA@192.168.1.101:5239#"{mpp_type=local}"

SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
sp_set_oguid(1393331);
SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);
alter database primary;

-----Configure standby EP12
(3) Start the standby database in mount mode

cd /dm8/dmdbms/bin
./dmserver /dm8/dmdata/EP12/dm.ini mount

(4) Configure OGUID
Start the command line tool dialql, use the MPP type as LOCAL mode, log in to the main database and set the OGUID value.

cd /dm8/dmdbms/bin
./disql SYSDBA/SYSDBA@192.168.1.101:5240#"{mpp_type=local}"

SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
sp_set_oguid(1393332);
SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);
ALTER DATABASE STANDBY;

--------------------Second node 0.102
-----Configure main library EP02
(1) Start the main library in mount mode

cd /dm8/dmdbms/bin
./dmserver /dm8/dmdata/EP02/dm.ini mount

(2) Configure OGUID
Start the command line tool dialql, use the MPP type as LOCAL mode, log in to the main database and set the OGUID value.

cd /dm8/dmdbms/bin
./disql SYSDBA/SYSDBA@192.168.1.102:5239#"{mpp_type=local}"

SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
sp_set_oguid(1393332);
SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);
alter database primary;

-----Configure main library EP11
(3) Start the standby database in mount mode

cd /dm8/dmdbms/bin
./dmserver /dm8/dmdata/EP11/dm.ini mount

(4) Configure OGUID
Start the command line tool dialql, use the MPP type as LOCAL mode, log in to the main database and set the OGUID value.

cd /dm8/dmdbms/bin
./disql SYSDBA/SYSDBA@192.168.1.102:5240#"{mpp_type=local}"

SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
sp_set_oguid(1393331);
SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);
ALTER DATABASE STANDBY;

------------------------------Daemon
dm01 dmwatcher.ini

vi /dm8/dmdata/EP01/dmwatcher.ini

[GRP1]
DW_TYPE              = GLOBAL                                #Global guard type
DW_MODE              = AUTO                                  #Automatic switching mode
DW_ERROR_TIME        = 10                                    #Remote daemon failure determination time
INST_RECOVER_TIME    = 60                                    #The interval between the main library daemon starting recovery
INST_ERROR_TIME      = 10                                    #Local instance fault determination time
INST_OGUID           = 1393331                               #Unique OGUID value of daemon
INST_INI             = /dm8/dmdata/EP01/dm.ini               #dm.ini configuration file path
INST_AUTO_RESTART    = 1                                     #Turn on the auto start function of the instance
INST_STARTUP_CMD     = /dm8/dmdbms/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

[GRP2]
DW_TYPE              = GLOBAL                                #Global guard type
DW_MODE              = AUTO                                  #Automatic switching mode
DW_ERROR_TIME        = 10                                    #Remote daemon failure determination time
INST_RECOVER_TIME    = 60                                    #The interval between the main library daemon starting recovery
INST_ERROR_TIME      = 10                                    #Local instance fault determination time
INST_OGUID           = 1393332                               #Unique OGUID value of daemon
INST_INI             = /dm8/dmdata/EP12/dm.ini               #dm.ini configuration file path
INST_AUTO_RESTART    = 1                                     #Turn on the auto start function of the instance
INST_STARTUP_CMD     = /dm8/dmdbms/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

dm02 dmwatcher.ini

vi /dm8/dmdata/EP02/dmwatcher.ini


[GRP1]
DW_TYPE              = GLOBAL                                #Global guard type
DW_MODE              = AUTO                                  #Automatic switching mode
DW_ERROR_TIME        = 10                                    #Remote daemon failure determination time
INST_RECOVER_TIME    = 60                                    #The interval between the main library daemon starting recovery
INST_ERROR_TIME      = 10                                    #Local instance fault determination time
INST_OGUID           = 1393331                               #Unique OGUID value of daemon
INST_INI             = /dm8/dmdata/EP11/dm.ini               #dm.ini configuration file path
INST_AUTO_RESTART    = 1                                     #Turn on the auto start function of the instance
INST_STARTUP_CMD     = /dm8/dmdbms/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

[GRP2]
DW_TYPE              = GLOBAL                                #Global guard type
DW_MODE              = AUTO                                  #Automatic switching mode
DW_ERROR_TIME        = 10                                    #Remote daemon failure determination time
INST_RECOVER_TIME    = 60                                    #The interval between the main library daemon starting recovery
INST_ERROR_TIME      = 10                                    #Local instance fault determination time
INST_OGUID           = 1393332                               #Unique OGUID value of daemon
INST_INI             = /dm8/dmdata/EP02/dm.ini               #dm.ini configuration file path
INST_AUTO_RESTART    = 1                                     #Turn on the auto start function of the instance
INST_STARTUP_CMD     = /dm8/dmdbms/bin/dmserver              #Command line startup mode
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


-----------------Start the daemon and automatically open the instance
dm01:

cd /dm8/dmdbms/bin
./dmwatcher /dm8/dmdata/EP01/dmwatcher.ini

dm02:

cd /dm8/dmdbms/bin
./dmwatcher /dm8/dmdata/EP02/dmwatcher.ini

---------------------Monitor

Third machine

vi /dm8/dmdata/dmmonitor.ini

MON_DW_CONFIRM      = 1                     #Confirm monitor mode
MON_LOG_PATH        =/dm8/dmdbms/log        #Storage path of monitor log file
MON_LOG_INTERVAL    = 60                    #Regularly record the system information to the log file every 60s
MON_LOG_FILE_SIZE   = 32                    #32M maximum per log file
MON_LOG_SPACE_LIMIT = 0                     #Unlimited total log file space

[GRP1]
MON_INST_OGUID      = 1393331               #Unique OGUID value for group GRP1

#The following configuration is the connection information from the monitor to the daemon of group GRP1, which is configured in the form of "IP:PORT"
#IP corresponds to dmmal Mal in ini_ Host and port correspond to dmmal Mal in ini_ DW_ PORT
MON_DW_IP          = 192.168.0.101:5253
MON_DW_IP          = 192.168.0.102:5254

[GRP2]
MON_INST_OGUID     = 1393332                #Unique OGUID value for group GRP2

#The following configuration is the connection information from the monitor to the daemon of group GRP2, which is configured in the form of "IP:PORT"
#IP corresponds to dmmal Mal in ini_ Host and port correspond to dmmal Mal in ini_ DW_ PORT
MON_DW_IP          = 192.168.0.101:5253
MON_DW_IP          = 192.168.0.102:5254

----------------Start monitor

cd /dm8/dmdbms/bin
./dmmonitor /dm8/dmdata/dmmonitor.ini

------------------------------------------------Register as a system service

/dm8/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p MPPWT01 -watcher_ini /dm8/dmdata/EP01/dmwatcher.ini
/dm8/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p MPPWT02 -watcher_ini /dm8/dmdata/EP02/dmwatcher.ini


------------------------------------------------Testing

disql SYSDBA/SYSDBA@192.168.1.101:5239

select name from v$instance;
create table DM_TEST_0604 as select * from sysobjects;
select count(*) from DM_TEST_0604;
create user DMTS identified by "DmTS#0614";
grant resource,public to DMTS;
select * from dba_role_privs where GRANTEE='DMTS';


disql SYSDBA/SYSDBA@192.168.1.102:5240
select name from v$instance;

select count(*) from DM_TEST_0604;
select * from dba_role_privs where GRANTEE='DMTS';



---------------------------Problems encountered

1. The password error is reported in the local login, and the global login is OK. Just installed, the password has not been changed.

[dmdba@dm1 ~]$ disql SYSDBA/SYSDBA*local@localhost:5236
[-2501]:Wrong user name or password.
disql V8
 user name:^C
[dmdba@dm1 ~]$
[dmdba@dm1 ~]$ disql SYSDBA/SYSDBA@localhost:5236

The server[localhost:5236]:In normal open state
 Login usage time : 11.294(ms)
disql V8
SQL>

Reason: DM7 and DM8 are written differently, and DM8 is more complex

./disql SYSDBA/SYSDBA@192.168.1.64:5236#"{mpp_type=local}"

2,./dmmonitor /dm8/dmdata/dmmonitor.ini
Monitor error:

dmmonitor(mid:1652601407) create link to dmwatcher(192.168.0.102:5253) error, code=-9402, please check configuration!!!
dmmonitor(mid:1652601407) create link to dmwatcher(192.168.0.102:5253) error, code=-6010, oguid or group_name mismatch, please check configuration!!!

reason:
Unique OGUID of group GRP does not match

The second host dmwatcher Ini is written like this,

[GRP1]
INST_OGUID           = 1393332                               #Unique OGUID value of daemon
INST_INI             = /dm8/dmdata/EP02/dm.ini               #dm.ini configuration file path

[GRP2]
INST_OGUID           = 1393331                               #Unique OGUID value of daemon
INST_INI             = /dm8/dmdata/EP11/dm.ini               #dm.ini configuration file path

Although the instance oguid can be aligned, it is ignored that "[GRP1] 1393332" should be "1393331"“

At the end of this article, there are deficiencies, welcome to correct!
For more information about Damon technology, please visit Damon technology community:
Dameng database - New generation large general relational database | Damon cloud adaptation Center
https://eco.dameng.com/

Tags: Operation & Maintenance Database server

Posted by shane07 on Sat, 21 May 2022 02:25:45 +0300