首页 > 数据库 >达梦数据库数据守护集群

达梦数据库数据守护集群

时间:2022-08-21 15:12:16浏览次数:75  
标签:数据库 DM01 PORT INST 达梦 dm8 MAL 守护 ini

  1.实验环境: 操作系统:银河麒麟V10 primary 192.168.17.7
standby 192.168.17.8
monitor 192.168.17.9   2.配置主机名: hostnamectl set-hostname primary hostnamectl set-hostname standby hostnamectl set-hostname monitor   3.检查防火墙 systemctl status firewalld 检查Selinux getenforce   4.安装DM8数据库   5.集群端口规划

数据库名  实例名 PORT_NUM MAL_HOST MAL_PORT MAL_DW_PORT MAL_INST_DW_PORT
DM01 DMSVR01 5236 192.168.17.7 55101 65101 45101
DM01 DMSVR02 5236 192.168.17.8 55121 65121 45121

 

 

 

 

6.初始化实例

 7.DMRMAN备份主库

./DmServiceDMSVR01 stop

mkdir /dm8/backup

备份主库

RMAN> backup database '/dm8/data/DM01/dm.ini' full to full_02 backupset '/dm8/backup/full_02'

主库备份文件传到备库/dm8/backup

scp -r /dm8/backup/full_02/ [email protected]:/dm8/backup/

备库恢复

RMAN> restore database '/dm8/data/DM01/dm.ini' from backupset '/dm8/backup/full_02'
restore database '/dm8/data/DM01/dm.ini' from backupset '/dm8/backup/full_02'
file dm.key not found, use default license!
[Percent:0.00%][Speed:0.00M/s][Cost:00:00:01][Remaining:00:00:00]Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
[Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00]
restore successfully.
time used: 00:00:02.272

RMAN> recover database '/dm8/data/DM01/dm.ini' from backupset '/dm8/backup/full_02'
recover database '/dm8/data/DM01/dm.ini' from backupset '/dm8/backup/full_02'
Database mode = 0, oguid = 0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[31459], file_lsn[31459]
备份集[/dm8/backup/full_02]备份过程中未产生日志
recover successfully!
time used: 264.016(ms)

RMAN> recover database '/dm8/data/DM01/dm.ini' update db_magic
recover database '/dm8/data/DM01/dm.ini' update db_magic
Database mode = 0, oguid = 0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[31459], file_lsn[31459]
recover successfully!
time used: 00:00:01.013

 

8.编辑主库配置文件

vim dm.ini

INSTANCE_NAME = DM01 
PORT_NUM = 5236
DW_INACTIVE_INTERVAL = 60 
ALTER_MODE_STATUS = 0 
ENABLE_OFFLINE_TS = 2 
MAL_INI = 1
ARCH_INI = 1
RLOG_SEND_APPLY_MON = 64
vim dmmal.ini
MAL_CHECK_INTERVAL = 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME = DMSVR01
MAL_HOST = 192.168.17.7
MAL_PORT = 55101
MAL_INST_HOST = 192.168.17.7
MAL_INST_PORT = 5236
MAL_DW_PORT = 65101
MAL_INST_DW_PORT = 45101
[MAL_INST2]
MAL_INST_NAME = DMSVR02
MAL_HOST = 192.168.17.8
MAL_PORT = 55121
MAL_INST_HOST = 192.168.17.8
MAL_INST_PORT = 5236
MAL_DW_PORT = 65121
MAL_INST_DW_PORT = 45121
vim dmarch.ini
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = DMSVR02
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm8/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
vim dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = AUTO
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 666666
INST_INI = /dm8/data/DM01/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /dm8/bin/dmserver
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0

启动主库到mount状态

[dmdba@primary bin]$ ./dmserver /dm8/data/DM01/dm.ini mount
file dm.key not found, use default license!
version info: develop
DM Database Server x64 V8 4-2-18-21.08.20-146029-10013-ENT  startup...
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Database mode = 0, oguid = 0
License will expire on 2022-09-04
file lsn: 31459
ndct db load finished
ndct fill fast pool finished
nsvr_startup end.
aud sys init success.
aud rt sys init success.
systables desc init success.
ndct_db_load_info success.
SYSTEM IS READY.

配置主库

SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
SQL> SP_SET_OGUID(666666);
SQL> ALTER DATABASE PRIMARY;
SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);

配置主库
[dmdba@primary bin]$ ./disql sysdba/DM01SYSDBA

服务器[LOCALHOST:5236]:处于普通配置状态
登录使用时间 : 1.081(ms)
disql V8
SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
DMSQL 过程已成功完成
已用时间: 3.782(毫秒). 执行号:0.
SQL> SP_SET_OGUID(666666);
DMSQL 过程已成功完成
已用时间: 1.234(毫秒). 执行号:1.
SQL> ALTER DATABASE PRIMARY;
操作已执行
已用时间: 2.789(毫秒). 执行号:0.
SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);
DMSQL 过程已成功完成
已用时间: 2.715(毫秒). 执行号:2.

[dmdba@primary bin]$ ./disql sysdba/DM01SYSDBA

服务器[LOCALHOST:5236]:处于主库配置状态
登录使用时间 : 0.843(ms)
disql V8
SQL>

9.编辑备库配置文件

vim dm.ini

INSTANCE_NAME = DM01 
PORT_NUM = 5236
DW_INACTIVE_INTERVAL = 60 
ALTER_MODE_STATUS = 0 
ENABLE_OFFLINE_TS = 2 
MAL_INI = 1
ARCH_INI = 1
RLOG_SEND_APPLY_MON = 64
[dmdba@standby DM01]$ cat dmmal.ini
MAL_CHECK_INTERVAL = 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME = DMSVR01
MAL_HOST = 192.168.17.7
MAL_PORT = 55101
MAL_INST_HOST = 192.168.17.7
MAL_INST_PORT = 5236
MAL_DW_PORT = 65101
MAL_INST_DW_PORT = 45101
[MAL_INST2]
MAL_INST_NAME = DMSVR02
MAL_HOST = 192.168.17.8
MAL_PORT = 55121
MAL_INST_HOST = 192.168.17.8
MAL_INST_PORT = 5236
MAL_DW_PORT = 65121
MAL_INST_DW_PORT = 45121
[dmdba@standby DM01]$ cat dmarch.ini
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = DMSVR01
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm8/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
[dmdba@standby DM01]$ cat dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = AUTO
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 666666
INST_INI = /dm8/data/DM01/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /dm8/bin/dmserver
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0

启动备库到mount状态

./dmserver /dm8/data/DMDW/dm.ini mount

[dmdba@standby bin]$ ./dmserver /dm8/data/DM01/dm.ini mount
file dm.key not found, use default license!
version info: develop
DM Database Server x64 V8 4-2-18-21.08.20-146029-10013-ENT  startup...
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Database mode = 0, oguid = 0
License will expire on 2022-09-04
file lsn: 31459
ndct db load finished
ndct fill fast pool finished
nsvr_startup end.
aud sys init success.
aud rt sys init success.
systables desc init success.
ndct_db_load_info success.
SYSTEM IS READY.

配置备库

SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
SQL> SP_SET_OGUID(666666);
SQL> ALTER DATABASE STANDBY;
SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);

配置备库
 [dmdba@standby bin]$ ./disql sysdba/DM01SYSDBA

服务器[LOCALHOST:5236]:处于普通配置状态
登录使用时间 : 1.081(ms)
disql V8
SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',1);
DMSQL 过程已成功完成
已用时间: 6.510(毫秒). 执行号:0.
SQL>  SP_SET_OGUID(666666);
DMSQL 过程已成功完成
已用时间: 1.372(毫秒). 执行号:1.
SQL> ALTER DATABASE STANDBY;
操作已执行
已用时间: 2.569(毫秒). 执行号:0.
SQL>
SQL> SP_SET_PARA_VALUE(1,'ALTER_MODE_STATUS',0);
DMSQL 过程已成功完成
已用时间: 2.717(毫秒). 执行号:2.
SQL> exit
[dmdba@standby bin]$ ./disql sysdba/DM01SYSDBA

服务器[LOCALHOST:5236]:处于备库配置状态
登录使用时间 : 1.063(ms)
disql V8
SQL>

 10.启动dmwatcher

主库启动

 ./dmwatcher /dm8/data/DM01/dmwatcher.ini
DMWATCHER[4.0] V8
DMWATCHER[4.0] IS READY

备库启动

./dmwatcher /dm8/data/DM01/dmwatcher.ini
DMWATCHER[4.0] V8
DMWATCHER[4.0] IS READY

11.配置监视器

vim dmmonitor.ini
MON_DW_CONFIRM = 1
MON_LOG_PATH = /dm8/data/log
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 0
[GRP1]
MON_INST_OGUID = 666666
MON_DW_IP = 192.168.17.7:65101
MON_DW_IP = 192.168.17.8:65121

启动监视器

./dmmonitor /dm8/dmmonitor.ini

启动监视器
 [dmdba@monitor bin]$ ./dmmonitor /dm8/dmmonitor.ini
[monitor]         2022-08-21 14:18:04: DMMONITOR[4.0] V8
[monitor]         2022-08-21 14:18:04: DMMONITOR[4.0] IS READY.

[monitor]         2022-08-21 14:18:04: 收到守护进程(DMSVR02)消息
                  WTIME                WSTATUS        INST_OK   INAME            ISTATUS     IMODE     RSTAT    N_O                                                                                           PEN   FLSN            CLSN
                  2022-08-21 14:18:04  OPEN           OK        DMSVR02          OPEN        STANDBY   NULL     4                                                                                                   33803           33803

[monitor]         2022-08-21 14:18:04: 收到守护进程(DMSVR01)消息
                  WTIME                WSTATUS        INST_OK   INAME            ISTATUS     IMODE     RSTAT    N_O                                                                                           PEN   FLSN            CLSN
                  2022-08-21 14:18:03  OPEN           OK        DMSVR01          OPEN        PRIMARY   VALID    4                                                                                                   33803           33803

主备库切换

LOGIN

SWITCHOVER

 

 11.注册服务

主库:[root@primary root]# ./dm_service_installer.sh -t dmwatcher -p DMWATCHER -watcher_ini /dm8/data/DM01/dmwatcher.ini

备库:[root@standby root]#  ./dm_service_installer.sh -t dmwatcher -p DMWATCHER -watcher_ini /dm8/data/DM01/dmwatcher.ini

监视器:[root@monitor root]# ./dm_service_installer.sh -t dmmonitor -p DMmonitor -monitor_ini /dm8/dmmonitor.ini

 

12.实时主备集群重启顺序要求:
1、关闭监视器
2、关闭主库守护进程
3、关闭备库守护进程
4、关闭主库实例
5、关闭备库实例
6、启动主库实例 (mount)
7、启动备库实例 (mount)
8、启动主库守护进程 (open)
9、启动备库守护进程 (open)
10、启动监视器

 

标签:数据库,DM01,PORT,INST,达梦,dm8,MAL,守护,ini
From: https://www.cnblogs.com/zongwen/p/16609848.html

相关文章

  • 数据库
    安装mysql下载安装压缩包在mysql目录下新建my.ini---my.ini[mysqld]basedir=安装目录\datadir=安装目录\data\default-storage-engine=INNODBport=3306#设置m......
  • 阿里云服务器ECS安装MySQL数据库、初始化密码修改,远程访问权限设置、开放服务器3306端
    1.修改配置文件/etc/my.cnf,在[mysqld]下面添加一行代码:skip-grant-tables2.servicemysqldrestart3.mysql-uroot-p //此时直接回车,既可以进入数据库。4.进数据库后......
  • Sqlite Expert Professional 如何打开加密数据库【转】
    最近要使用个安全的轻量级的数据库,最终选择了SQLITE,好不容上手了,突然发现查询的数据不对头。想着用个工具看看,就下载了SqliteExpertProfessional5.4试试。结果还是打不......
  • 【数据库】 C#利用System.Data.SQLite实现对SQLite的操作
      System.Data.SQLite的一个优点是它是由SQLite团队开发的,该团队已声明长期致力于支持它。支持多种数据类型,比较旧Microsoft.Data.Sqlite的一个优点是它是由Micro......
  • 纯真IP数据库转mysql方法详解
    纯真ip数据库转mysql_如何把纯真ip数据库导入到MySQL数据表中纯真中国IP地理位置  https://www.cz88.net一、下载最新版的QQWry.Dat二、下载IPLook使用IPLook把QQWry......
  • 通过supervisor管理laravel队列任务守护进程
    通过supervisor管理laravel队列任务守护进程背景:laravel队列,在调试使用时可以使用phpartisanqueue:work来启用队列,但是实际项目部署后,需要通过守护进程一直启动队列,在这......
  • 插件开发手册 — 数据库
    wordpress数据库数据表详细解说完整的WordPress 数据库有12张数据表,如果还有其它相关的数据库,那可能不是WordPress 自带的数据表,而可能是某些主题或插件需要而创建的......
  • 2022-8-20 数据库连接池
    1.概念:其实就是一个容器(集合),存放数据库连接的容器。当系统初始化好后,容器被创建,容器中会申请一些连接对象,当用户来访问数据库时,从容器中获取连接对象,用户访问完之......
  • 2022-08-20 第二小组 张晟源(数据库连接池,queryRunner)
    JDBC(数据库连接池,queryRunner)一,数据库连接池Connection是一个稀有资源,一个连接就创造了一个资源同时在线人很多,服务器可能崩溃1.设置只有自己2.服务器人数限制,设置排......
  • 基础复习——利用Room简化数据库操作——重点
       使用数据库帮助器编码的时候,开发者每次都得手工实现以下代码逻辑:(1)重写数据库帮助器的onCreate方法,添加该表的建表语句;(2)在插入记录之时,必须将数据实例的属性值逐......