Dameng database is active and standby, with one active, two standby and one arbitration implementation step.

1, Environmental information

Internal communication IP
Main library: Real_IP.1.5
Standby database: Real_IP.1.6
Standby database: Real_IP.1.7
Arbitration: Real_IP.1.8

Database media path: / home/dmdba/DMSoft/
Mount path: / home/dmdba/DMSoft/dminst
Backup, archive, data file path / home/dmdba/{dmbak,dmarch,dmdata}

2, Configure the implementation environment (stand-alone deployment)

2.1 (four root users execute at the same time) configure the resource limit of Dameng

vi /etc/security/limits.conf
#add for DM
dmdba soft nproc 16384
dmdba hard nproc 16384
dmdba soft nofile 65536
dmdba hard nofile 65536
dmdba soft memlock 4000000
dmdba hard memlock 4000000

2.2 (4 simultaneous root users) create users

groupadd dinstall
useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba

2.3 (4 simultaneous root users) mount the Damon image disk

mount -o loop /home/dmdba/DMSoft/dm7_20210415_x86_rh6_64_ent_7.6.1.94.iso /home/dmdba/DMSoft/dminst

2.4 (4 root users execute authorization at the same time)

chown dmdba.dinstall /home/dmdba -R
chmod +x /home/dmdba/DMSoft/dminst/DMInstall.bin

2.5 (4 dmdba users execute at the same time) install database software

./DMInstall.bin -i Command line installation
 Please select the installation language(C/c:chinese E/e:english) [C/c]:[C]
Enter Key File path? (Y/y:yes N/n:no) [Y/y]:[Y]
Please enter Key Path address of the file [dm.key]:[/home/dmdba/DMSoft/dm.key]
Set time zone? (Y/y:yes N/n:no) [Y/y]:[Y]
Please select and set the time zone [21]:[21]
Please select a numeric sequence number for the installation type [1 Typical installation]:[1]
Please select the installation directory [/home/dmdba/dmdbms]:[/home/dmdba/dmdbms]
Confirm the installation path(/home/dmdba/dmdbms)? (Y/y:yes N/n:no)  [Y/y]:[Y]
Confirm installation? (Y/y:yes N/n:no):[Y]
Please take root System user execute command:

End of installation
After the installation is completed, you need to execute the script as root user according to the prompt

2.6 (executed by one dmdba user) initialize the database

In addition to the arbitration server, perform database initialization in the main database server in the other active and standby servers.

cd /home/dmdba/dmdbms/bin

./dminit PATH=/home/dmdba/dmdata/DAMENG/ extent_size=16 page_size=32 log_size=2048 case_sensitive=y charset=1 db_name=DM instance_name=DM1

Parameter Description:
CASE_SENSITIVE identifier case sensitive values: Y (sensitive), n (insensitive)
CHARSET character set options: 0 for GB18030, 1 for UTF-8, 2 for Korean character set EUC-KR, and the default is 0.

2.7 (three dmdba s, active and standby) configuration database service

Configuration service (3 sets are executed once respectively)

cp /home/dmdba/dmdbms/bin/service_template/DmService /home/dmdba/dmdbms/bin/DmServiceDM
cp /home/dmdba/dmdbms/bin/DmServiceDM /etc/init.d/DmServiceDMSERVER
chmod 755 /etc/init.d/DmServiceDMSERVER

Configuration service (modify 3 sets)

vim /home/dmdba/dmdbms/bin/DmServiceDM

Modify ini only_ Path is a parameter:


After completing [2.6 (executed by one dmdba user), initialize the database]
Perform database startup and shutdown test on the server in step:

Start database

/home/dmdba/dmdbms/bin/ DmServiceDM start

Stop database

/home/dmdba/dmdbms/bin/ DmServiceDM stop

3, Deploy active and standby

3.1 (executed by dmdba user) prepare the standby database environment

Send the data file of the primary database to the standby database 1

scp -r /home/dmdba/dmdata/DAMENG/DM/* dmdba@Real_IP.2.6:/home/dmdba/dmdata/DAMENG/DM/

Send the data file of the primary database to the secondary database 2

scp -r /home/dmdba/dmdata/DAMENG/DM/* dmdba@Real_IP.2.7:/home/dmdba/dmdata/DAMENG/DM/

3.2 configuration file upload

Upload and unzip all files, and copy the unzipped dm.ini, dmarch.ini, dmwatcher.ini, dmmal.ini and sqllog to / home/dmdba/dmdata/DAMENG/DM /
To download the configuration file, download the link: Download Dameng configuration file from Baidu online disk, extraction code: yif0

Main library

In the link, DM1_INI All files under

Spare warehouse 2

In the link, DM2_INI All files under

Spare warehouse 3

In the link, DM3_INI All files under

Upload and unzip all files and unzip the extracted dmmonitor.ini and dmmonitor_ Copy putong.ini to / home/dmdba/dmdbms/bin

In the link, DM_MON_INI All files under

3.3 (executed by one dmdba user) generate control file

cd /home/dmdba/dmdbms/bin

./dmctlcvt TYPE=3 SRC=/home/dmdba/dmdata/DAMENG/DM/dmwatcher.ini DEST=/home/dmdba/

Copy the generated control file to the / home/dmdba/dmdata/DAMENG/DM / directory (the dm.ctl storage directory is specified by the CTL_PATH configuration item of dm.ini)

cp /home/dmdba/GROUP_DM/dmwatcher.ctl /home/dmdba/dmdata/DAMENG/DM/dmwatcher.ctl

Send the control file to the other two database servers

scp  /home/dmdba/dmdbms/bin/dmwatcher.ctl dmdba@Real_IP.2.6: /home/dmdba/dmdbms/bin/

scp  /home/dmdba/dmdbms/bin/dmwatcher.ctl dmdba@Real_IP.2.7: /home/dmdba/dmdbms/bin/

3.4 (3 dmdba s for active and standby users) modify the active and standby database mode

Three database servers are started to mount state
(three sets) the commands are the same and executed in sequence (the active and standby are slightly different, which is marked below)

cd /home/dmdba/dmdbms/bin
./disql SYSDBA/SYSDBA:5238
alter database primary/standby;
Main library execution:
alter database primary;
2 Execution of multiple standby databases:
alter database standby;

3.5 (3 active and standby root users) registration service

Register the database daemon as a service

cd /home/dmdba/dmdbms/script/root/

./dm_service_installer.sh -t dmwatcher -p dmwatcher -i /home/dmdba/dmdata/DAMENG/DM/dmwatcher.ini

Start stop command

service DmWatcherServicedmwatcher start/stop

4, Deploy arbitration

4.1 (one root user performs arbitration) register monitor service

Register database monitor as a service

cd /home/dmdba/dmdbms/script/root/

./dm_service_installer.sh -t dmmonitor -p dmmon -i /home/dmdba/dmdbms/bin/dmmonitor.ini

Start stop command

cd /home/dmdba/dmdbms/bin
./DmMonitorServicedmmon start/stop

One active, two standby and one arbitration deployment is completed.

Keywords: Database Big Data

Added by mark s on Sat, 18 Sep 2021 13:42:27 +0300