-
- 集群规划
A机器 | B机器 | C机器 | |||
业务IP | 172.16.1.1 | 172.16.1.2 | 172.16.1.3 | ||
心跳IP | 192.168.1.1 | 192.168.1.2 | 192.168.1.3 | ||
实例名 | DSC0 | DSC1 | DW1_01 | ||
实例端口 | 5236 | 5236 | 5236 | ||
软件目录 | /opt/dsc/setup | /opt/dsc/setup | /opt/setup | ||
安装目录 | /opt/dsc/dmdbms | /opt/dsc/dmdbms | /opt/dmdbms | ||
配置文件目录 | /opt/dsc/config | /opt/dsc/config | /opt/dmdbms/data/DAMENG | ||
归档日志目录 | /opt/dsc/arch_0 | /opt/dsc/arch_1 | /opt/dmdbms/data/DAMENG/arch | ||
远程归档目录 | /opt/dsc/arch_0_remote | /opt/dsc/arch_1_remote | / | ||
备份目录 | /opt/dsc/bak | /opt/dsc/bak | /opt/dmdbms/data/DAMENG/bak | ||
dmdcr_cfg | CSS | DCR_EP_NAME | CSS0 | CSS1 | / |
DCR_EP_PORT | 5336 | 5337 | / | ||
ASM | DCR_EP_NAME | ASM0 | ASM1 | / | |
DCR_EP_PORT | 5436 | 5437 | / | ||
DB | DCR_EP_NAME | DSC0 | DSC1 | / | |
DCR_EP_PORT | 5236 | 5236 | / | ||
DCR_CHECK_PORT | 5536 | 5537 | / | ||
dmasvrmal | MAL_PORT | 5636 | 5637 | / | |
dmmal | MAL_PORT | 5736 | 5737 | 5738 | |
MAL_DW_PORT | 5836 | 5837 | 5838 | ||
MAL_INST_DW_PORT | 5936 | 5937 | 5938 | ||
归档上限 | 51200 | 51200 | 102400 | ||
DCR_OGUID | 45331 | ||||
INST_OGUID | 45332 |
- A机器
[root@~]# hostname dmdsc01
[root@~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=dmdsc01
[root@~]# vi /etc/hostsname
dmdsc01
- B机器
[root@~]# hostname dmdsc02
[root@~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=dmdsc02
[root@~]# vi /etc/hostsname
dmdsc02
- C机器
[root@~]# hostname dmdw01
[root@~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=dmdw01
[root@~]# vi /etc/hostsname
dmdw01
- A机器、B机器、C机器依次执行
[root@~]# systemctl stop firewalld
[root@~]# systemctl disable firewalld
[root@~]# systemctl status firewalld
- A机器:将数据库安装在/opt/dsc/dmdbms目录下
[root@~]# groupadd dinstall -g 2001;useradd -g dinstall dmdba -u 1001;passwd dmdba
[root@~]# <输入密码>
[root@~]# <再次输入密码>
[root@~]# mkdir -p /opt/dsc/setup /opt/dsc/dmdbms /opt/dsc/config /opt/dsc/arch_0 /opt/dsc/arch_0_remote /opt/dsc/bak
[root@~]# chown dmdba.dinstall /opt/dsc -R;chmod 777 /opt/dsc -R
[dmdba@~]# /opt/dsc/setup/DMInstall.bin -i
B机器:将数据库安装在/opt/dsc/dmdbms目录下
[root@~]# groupadd dinstall -g 2001;useradd -g dinstall dmdba -u 1001;passwd dmdba
[root@~]# <输入密码>
[root@~]# <再次输入密码>
[root@~]# mkdir -p /opt/dsc/setup /opt/dsc/dmdbms /opt/dsc/config /opt/dsc/arch_1 /opt/dsc/arch_1_remote /opt/dsc/bak
[root@~]# chown dmdba.dinstall /opt/dsc -R;chmod 777 /opt/dsc -R
[dmdba@~]# /opt/dsc/setup/DMInstall.bin -i
C机器:将数据库安装在/opt/dmdbms目录下
[root@~]# groupadd dinstall -g 2001;useradd -g dinstall dmdba -u 1001;passwd dmdba
[root@~]# <输入密码>
[root@~]# <再次输入密码>
[root@~]# mkdir -p /opt/setup /opt/dmdbms
[root@~]# chown dmdba.dinstall /opt/dmdbms -R;chown dmdba.dinstall /opt/setup -R;chmod 777 /opt/dmdbms -R;chmod 777 /opt/setup -R
[dmdba@~]# /opt/setup/DMInstall.bin -i
存储准备
-
- 划存储
用途 | 空间规划(总共6T) |
sdb1用于dcr信息 | 100M |
sdb2用于存放vote信息 | 100M |
sdb3用于存放redo log | 20480M |
sdb4用于存放data | 剩下的全部空间 |
- A机器:小于2TB的存储使用fdisk命令来划分
[root@~]# fdisk /dev/sdb
1) 依次输入 n p 1 回车 +100M,完成第一块磁盘划分
2) 依次输入 n p 2 回车 +100M,完成第二块磁盘划分
3) 依次输入 n p 3 回车 +20480M,完成第三块磁盘划分
4) 依次输入 n p 回车 回车 回车,完成第四块磁盘划分
5) 输入w命令,将裸设备划分的设置进行保存
- A机器:大于2TB的需要使用parted命令来划分
[root@~]# parted /dev/sdb
1) 输入 mklabel gpt 回车,将MBR磁盘磁盘转换为gpt格式
2) 输入 mkpart primary 0 100 回车,完成第一块磁盘划分
3) 输入 mkpart primary 100 200 回车,完成第二块磁盘划分
4) 输入 mkpart primary 200 20680 回车,完成第三块磁盘划分
5) 输入 mkpart primary 20680 5498G 回车,完成第四块磁盘划分
6) 输入 quit 回车,完成磁盘划分
- A机器、B机器依次执行
[root@~]# partprobe /dev/sdb
-
- 挂存储方法1:直接挂
- A机器、B机器依次修改
[root@~]# vi /etc/udev/rules.d/70-persistent-ipoib.rules
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdb4", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="raw[1-4]", OWNER="dmdba", GROUP="dinstall", MODE="660"
[root@~]# partprobe /dev/sdb
[root@~]# reboot
注意:可通过blockdev --getsize64 /dev/raw/raw*命令查看设备大小。
搭建DSC
- A机器、B机器配置相同
[dmdba@~]# vi /opt/dsc/config/dmdcr_cfg.ini
DCR_N_GRP = 3 #集群环境有多少个GROUP,范围:1~16
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 45331
[GRP] #新建一个GROUP
DCR_GRP_TYPE = CSS #组类型(CSS/ASM/DB)
DCR_GRP_NAME = GRP_CSS #组名
DCR_GRP_N_EP = 2 #组内节点个数
DCR_GRP_DSKCHK_CNT = 60 #磁盘心跳容错时间,单位:秒
[GRP_CSS]
DCR_EP_NAME = CSS0 #CSS节点名
DCR_EP_HOST = 192.168.1.1 #心跳地址
DCR_EP_PORT = 5336 #CSS端口
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.1.2
DCR_EP_PORT = 5337
[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = GRP_ASM
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_ASM]
DCR_EP_NAME = ASM0 #ASM节点名,和dmasvrmal的MAL_INST_NAME一致
DCR_EP_SHM_KEY = 93360 #共享内存标识
DCR_EP_SHM_SIZE = 10 #共享内存大小
DCR_EP_HOST = 192.168.1.1 #心跳地址
DCR_EP_PORT = 5436 #ASM端口
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP_ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 192.168.1.2
DCR_EP_PORT = 5437
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_DSC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_DSC]
DCR_EP_NAME = DSC0 #实例名,和dm.ini的INSTANCE_NAME一致
DCR_EP_SEQNO = 0 #组内序号,不能重复
DCR_EP_PORT = 5236 #实例端口,和dm.ini的PORT_NUM一致
DCR_CHECK_PORT = 5536 #DCR检查端口
[GRP_DSC]
DCR_EP_NAME = DSC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 5537
A机器
[dmdba@~]# /opt/dsc/dmdbms/bin/dmasmcmd
ASM> create dcrdisk '/dev/raw/raw1' 'dcr'
ASM> create votedisk '/dev/raw/raw2' 'vote'
ASM> create asmdisk '/dev/raw/raw3' 'LOG0'
ASM> create asmdisk '/dev/raw/raw4' 'DATA0'
ASM> init dcrdisk '/dev/raw/raw1' from '/opt/dsc/config/dmdcr_cfg.ini' identified by 'admin1234'
ASM> init votedisk '/dev/raw/raw2' from '/opt/dsc/config/dmdcr_cfg.ini'
A机器、B机器配置相同
[dmdba@~]# vi /opt/dsc/config/dmasvrmal.ini
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 192.168.1.1 #心跳地址
MAL_PORT = 5636 #MAL监听端口
[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST = 192.168.1.2
MAL_PORT = 5637
A机器
[dmdba@~]# vi /opt/dsc/config/dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH = /opt/dsc/config/dmasvrmal.ini
DMDCR_SEQNO = 0
DMDCR_AUTO_OPEN_CHECK = 90
#DMDCR_ASM_RESTART_INTERVAL = 30 #CSS认定ASM故障重启的时间
#DMDCR_ASM_STARTUP_CMD = /opt/dsc/dmdbms/bin/dmasmsvr dcr_ini=/opt/dsc/config/dmdcr.ini
#DMDCR_DB_RESTART_INTERVAL = 60 #CSS认定DSC故障重启的时间
#DMDCR_DB_STARTUP_CMD = /opt/dsc/dmdbms/bin/dmserver path=/opt/dsc/config/dsc0_config/dm.ini dcr_ini=/opt/dsc/config/dmdcr.ini mount
B机器
[dmdba@~]# vi /opt/dsc/config/dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH = /opt/dsc/config/dmasvrmal.ini
DMDCR_SEQNO = 1
DMDCR_AUTO_OPEN_CHECK = 90
#DMDCR_ASM_RESTART_INTERVAL = 30
#DMDCR_ASM_STARTUP_CMD = /opt/dsc/dmdbms/bin/dmasmsvr dcr_ini=/opt/dsc/config/dmdcr.ini
#DMDCR_DB_RESTART_INTERVAL = 60
#DMDCR_DB_STARTUP_CMD = /opt/dsc/dmdbms/bin/dmserver path=/opt/dsc/config/dsc1_config/dm.ini dcr_ini=/opt/dsc/config/dmdcr.ini mount
注意:当前为手动拉起A机器和B机器的ASM和DMSERVER服务。待集群配置完成后,再修改为自动拉起(删除dmdcr.ini中红色井号),部署文档会有提示。
A机器、B机器依次执行
[dmdba@~]# /opt/dsc/dmdbms/bin/dmcss DCR_INI=/opt/dsc/config/dmdcr.ini
...
DMCSS IS READY
A机器、B机器依次执行
[dmdba@~]# /opt/dsc/dmdbms/bin/dmasmsvr DCR_INI=/opt/dsc/config/dmdcr.ini
...
the ASM server is Ready.
A机器
[dmdba@~]# /opt/dsc/dmdbms/bin/dmasmtool DCR_INI=/opt/dsc/config/dmdcr.ini
ASM> create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3'
ASM> create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4'
A机器、B机器配置相同
[dmdba@~]# vi /opt/dsc/config/dminit.ini
db_name = dsc
system_path = +DMDATA/data
main = +DMDATA/data/dsc/main.dbf
main_size = 128
roll = +DMDATA/data/dsc/roll.dbf
roll_size = 128
system = +DMDATA/data/dsc/system.dbf
system_size = 128
ctl_path = +DMDATA/data/dsc/dm.ctl
ctl_size = 8
log_size = 2048
dcr_path = /dev/raw/raw1
dcr_seqno = 0
auto_overwrite = 1
PAGE_SIZE = 32
CASE_SENSITIVE = Y
CHARSET = 0
[DSC0]
config_path = /opt/dsc/config/dsc0_config
port_num = 5236
mal_host = 192.168.1.1
mal_port = 5736
log_path = +DMLOG/log/dsc0_log01.log
log_path = +DMLOG/log/dsc0_log02.log
[DSC1]
config_path = /opt/dsc/config/dsc1_config
port_num = 5236
mal_host = 192.168.1.2
mal_port = 5737
log_path = +DMLOG/log/dsc1_log01.log
log_path = +DMLOG/log/dsc1_log02.log
-
- 初始化实例
A机器
--初始化实例
[dmdba@~]# /opt/dsc/dmdbms/bin/dminit control=/opt/dsc/config/dminit.ini
...
create dm database success. 2020-11-14 21:25:31
--拷贝文件
[dmdba@~]# scp -r /opt/dsc/config/dsc1_config dmdba@192.168.1.2:/opt/dsc/config/
A机器
[dmdba@~]# /opt/dsc/dmdbms/bin/dmserver /opt/dsc/config/dsc0_config/dm.ini dcr_ini=/opt/dsc/config/dmdcr.ini
B机器
[dmdba@~]# /opt/dsc/dmdbms/bin/dmserver /opt/dsc/config/dsc1_config/dm.ini dcr_ini=/opt/dsc/config/dmdcr.ini
-
- 注册CSS、ASM、DMSERVER后台服务
A机器
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /opt/dsc/config/dmdcr.ini -p CSS
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /opt/dsc/config/dmdcr.ini -y DmCSSServiceCSS.service -p ASM
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /opt/dsc/config/dsc0_config/dm.ini -dcr_ini /opt/dsc/config/dmdcr.ini -y DmASMSvrServiceASM.service -m mount -p DSC
B机器
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /opt/dsc/config/dmdcr.ini -p CSS
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /opt/dsc/config/dmdcr.ini -y DmCSSServiceCSS.service -p ASM
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /opt/dsc/config/dsc1_config/dm.ini -dcr_ini /opt/dsc/config/dmdcr.ini -y DmASMSvrServiceASM.service -m mount -p DSC
备注:A机器、B机器删除自启
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_uninstaller.sh -n DmCSSServiceCSS
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_uninstaller.sh -n DmASMSvrServiceASM
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_uninstaller.sh -n DmServiceDSC
搭建单机
1、取消DMDCR_ASM_RESTART_INTERVAL、DMDCR_ASM_STARTUP_CMD前面的#号(3.4章节)。
2、启动CSS和ASM后台服务、DMSERVER前台服务,并登录测试。
3、正常退出两节点的DMSERVER服务,使CSS和ASM服务处于开启状态。
A机器
[dmdba@~]# /opt/dsc/dmdbms/bin/dmrman use_ap=2 dcr_ini=/opt/dsc/config/dmdcr.ini
RMAN> BACKUP DATABASE '/opt/dsc/config/dsc0_config/dm.ini' FULL BACKUPSET '/opt/dsc/bak/BACKUP_FILE';
[dmdba@~]# scp -r /opt/dsc/bak/BACKUP_FILE dmdba@192.168.1.3:/opt/dmdbms/
C机器
--初始化实例
[dmdba@~]# /opt/dmdbms/bin/dminit path=/opt/dmdbms/data PAGE_SIZE=32 CASE_SENSITIVE=Y CHARSET=0 LOG_SIZE=2048
--启动服务并退出
[dmdba@~]# /opt/dmdbms/bin/dmserver /opt/dmdbms/data/DAMENG/dm.ini
--还原数据
[dmdba@~]# /opt/dmdbms/bin/dmrman use_ap=2
RMAN> RESTORE DATABASE '/opt/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/opt/dmdbms/BACKUP_FILE'
RMAN> RECOVER DATABASE '/opt/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/opt/dmdbms/BACKUP_FILE'
RMAN> RECOVER DATABASE '/opt/dmdbms/data/DAMENG/dm.ini' UPDATE DB_MAGIC
A机器、B机器该配置相同
A机器:[dmdba@~]# vi /opt/dsc/config/dsc0_config/dm.ini
B机器:[dmdba@~]# vi /opt/dsc/config/dsc1_config/dm.ini
DW_INACTIVE_INTERVAL = 60 #接收守护进程消息超时时间
ALTER_MODE_STATUS = 0 #不允许手工方式修改实例模式/状态/OGUID
ENABLE_OFFLINE_TS = 2 #不允许备库 OFFLINE 表空间
MAL_INI = 1 #打开MAL系统
ARCH_INI = 1 #打开归档配置
RLOG_SEND_APPLY_MON = 64 #统计最近 64 次的日志发送信息
C机器
[dmdba@~]# vi /opt/dmdbms/data/DAMENG/dm.ini
INSTANCE_NAME = DW1_01
DW_INACTIVE_INTERVAL = 60
ALTER_MODE_STATUS = 0
ENABLE_OFFLINE_TS = 2
MAL_INI = 1
ARCH_INI = 1
RLOG_SEND_APPLY_MON = 64
A机器
[dmdba@~]# vi /opt/dsc/config/dsc0_config/dmarch.ini
[ARCHIVE_LOCAL]
ARCH_TYPE = LOCAL
ARCH_DEST = /opt/dsc/arch_0
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 51200
[ARCHIVE_REMOTE]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC1
ARCH_INCOMING_PATH = /opt/dsc/arch_0_remote
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 51200
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = DW1_01
B机器
[dmdba@~]# vi /opt/dsc/config/dsc1_config/dmarch.ini
[ARCHIVE_LOCAL]
ARCH_TYPE = LOCAL
ARCH_DEST = /opt/dsc/arch_1
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 51200
[ARCHIVE_REMOTE]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC0
ARCH_INCOMING_PATH = /opt/dsc/arch_1_remote
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 51200
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = DW1_01
C机器
[dmdba@~]# vi /opt/dmdbms/data/DAMENG/dmarch.ini
[ARCHIVE_LOCAL]
ARCH_TYPE = LOCAL
ARCH_DEST = /opt/dmdbms/data/DAMENG/arch
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = DSC0/DSC1
A机器、B机器、C机器配置相同
A机器:[dmdba@~]# vi /opt/dsc/config/dsc0_config/dmmal.ini
B机器:[dmdba@~]# vi /opt/dsc/config/dsc1_config/dmmal.ini
C机器:[dmdba@~]# vi /opt/dmdbms/data/DAMENG/dmmal.ini
MAL_CHECK_INTERVAL = 30 #MAL链路检测时间间隔
MAL_CONN_FAIL_INTERVAL = 10 #判定MAL链路断开的时间
[MAL_INST0]
MAL_INST_NAME = DSC0 #实例名,和 dm.ini的INSTANCE_NAME一致
MAL_HOST = 192.168.1.1 #MAL系统监听TCP连接的IP地址
MAL_PORT = 5736 #MAL系统监听TCP连接的端口
MAL_INST_HOST = 172.16.1.1 #实例的对外服务IP地址
MAL_INST_PORT = 5236 #实例对外服务端口,和dm.ini的PORT_NUM一致
MAL_DW_PORT = 5836 #实例对应的守护进程监听TCP连接的端口
MAL_INST_DW_PORT = 5936 #实例监听守护进程TCP连接的端口
[MAL_INST1]
MAL_INST_NAME = DSC1
MAL_HOST = 192.168.1.2
MAL_PORT = 5737
MAL_INST_HOST = 172.16.1.2
MAL_INST_PORT = 5236
MAL_DW_PORT = 5837
MAL_INST_DW_PORT = 5937
[MAL_INST2]
MAL_INST_NAME = DW1_01
MAL_HOST = 192.168.1.3
MAL_PORT = 5738
MAL_INST_HOST = 172.16.1.3
MAL_INST_PORT = 5236
MAL_DW_PORT = 5838
MAL_INST_DW_PORT = 5938
A机器
[dmdba@~]# vi /opt/dsc/config/dsc0_config/dmwatcher.ini
[GDSCDW1]
DW_TYPE = GLOBAL #全局守护类型
DW_MODE = MANUAL #手动切换模式
DW_ERROR_TIME = 60 #远程守护进程故障认定时间
INST_ERROR_TIME = 35 #本地实例故障认定时间
INST_RECOVER_TIME = 60 #主库守护进程启动恢复的间隔时间
INST_OGUID = 45332 #守护系统唯一OGUID值
INST_INI = /opt/dsc/config/dsc0_config/dm.ini #dm.ini文件路径
DCR_INI = /opt/dsc/config/dmdcr.ini #dmdcr.ini文件路径
INST_STARTUP_CMD = /opt/dsc/dmdbms/bin/dmserver #命令行方式启动
INST_AUTO_RESTART = 0 #关闭实例的自动启动功能
RLOG_SEND_THRESHOLD = 0 #指定主库发送日志到备库的时间阈值,默认关闭
RLOG_APPLY_THRESHOLD = 0 #指定备库重演日志的时间阈值,默认关闭
B机器
[dmdba@~]# vi /opt/dsc/config/dsc1_config/dmwatcher.ini
[GDSCDW1]
DW_TYPE = GLOBAL
DW_MODE = MANUAL
DW_ERROR_TIME = 60
INST_ERROR_TIME = 35
INST_RECOVER_TIME = 60
INST_OGUID = 45332
INST_INI = /opt/dsc/config/dsc1_config/dm.ini
DCR_INI = /opt/dsc/config/dmdcr.ini
INST_STARTUP_CMD = /opt/dsc/dmdbms/bin/dmserver
INST_AUTO_RESTART = 0
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0
C机器
[dmdba@~]# vi /opt/dmdbms/data/DAMENG/dmwatcher.ini
[GDSCDW1]
DW_TYPE = GLOBAL
DW_MODE = MANUAL
DW_ERROR_TIME = 60
INST_ERROR_TIME = 35
INST_RECOVER_TIME = 60
INST_OGUID = 45332
INST_INI = /opt/dmdbms/data/DAMENG/dm.ini
INST_STARTUP_CMD = /opt/dmdbms/bin/dmserver
INST_AUTO_RESTART = 1
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0
-
- 注册服务
A机器
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p Watcher -watcher_ini /opt/dsc/config/dsc0_config/dmwatcher.ini
B机器
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p Watcher -watcher_ini /opt/dsc/config/dsc1_config/dmwatcher.ini
C机器
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmserver -p DW1_01 -dm_ini /opt/dmdbms/data/DAMENG/dm.ini -m mount
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p Watcher -watcher_ini /opt/dmdbms/data/DAMENG/dmwatcher.ini
备注:删除自启
A机器、B机器:[root@~]# /opt/dsc/dmdbms/script/root/dm_service_uninstaller.sh -n DmWatcherServiceWatcher
C机器:[root@~]# /opt/dmdbms/script/root/dm_service_uninstaller.sh -n DmServiceDW1_01
C机器:[root@~]# /opt/dmdbms/script/root/dm_service_uninstaller.sh -n DmWatcherServiceWatcher
配置监视器
A机器、B机器、C机器该配置相同
A机器、B机器:[dmdba@~]# vi /opt/dsc/dmdbms/bin/dmmonitor.ini
C机器:[dmdba@~]# vi /opt/dmdbms/bin/dmmonitor.ini
MON_DW_CONFIRM = 0 #0为非确认,1为确认
MON_LOG_PATH = ../log #监视器日志文件存放路径
MON_LOG_INTERVAL = 60 #每隔 60s 定时记录系统信息到日志文件
MON_LOG_FILE_SIZE = 512 #单个日志大小
MON_LOG_SPACE_LIMIT = 2048 #日志上限
[GDSCDW1]
MON_INST_OGUID = 45332 #组GDSCDW1的唯一OGUID 值
MON_DW_IP = 192.168.1.1:5836/192.168.1.2:5837 #IP对应MAL_HOST,PORT对应MAL_DW_PORT
MON_DW_IP = 192.168.1.3:5838
A机器、B机器该配置相同
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmmonitor -p Monitor -monitor_ini /opt/dsc/dmdbms/bin/dmmonitor.ini
C机器
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmmonitor -p Monitor -monitor_ini /opt/dmdbms/bin/dmmonitor.ini
备注:删除自启
A机器、B机器:[root@~]# /opt/dsc/dmdbms/script/root/dm_service_uninstaller.sh -n DmMonitorServiceMonitor
C机器:[root@~]# /opt/dmdbms/script/root/dm_service_uninstaller.sh -n DmMonitorServiceMonitor
A机器、B机器、C机器该配置相同
A机器、B机器:[dmdba@~]# vi /opt/dsc/dmdbms/bin/dmcssm.ini
C机器:[dmdba@~]# vi /opt/dmdbms/bin/dmcssm.ini
CSSM_OGUID = 45331
CSSM_CSS_IP = 192.168.1.1:5336
CSSM_CSS_IP = 192.168.1.2:5337
CSSM_LOG_PATH = ../log
CSSM_LOG_FILE_SIZE = 512
CSSM_LOG_SPACE_LIMIT = 2048
A机器、B机器该配置相同
[root@~]# /opt/dsc/dmdbms/script/root/dm_service_installer.sh -t dmcssm -cssm_ini /opt/dsc/dmdbms/bin/dmcssm.ini -p Monitor
C机器
[root@~]# /opt/dmdbms/script/root/dm_service_installer.sh -t dmcssm -cssm_ini /opt/dmdbms/bin/dmcssm.ini -p Monitor
备注:删除自启
A机器、B机器:[root@~]# /opt/dsc/dmdbms/script/root/dm_service_uninstaller.sh -n DmCSSMonitorServiceMonitor
C机器:[root@~]# /opt/dmdbms/script/root/dm_service_uninstaller.sh -n DmCSSMonitorServiceMonitor
-
- DSC监视器使用
命令 | 含义 |
show | 查看所有组的信息 |
show config | 查看dmdcr_cfg.ini 的配置信息 |
show monitor | 查看当前连接到主 CSS 的所有监视器信息 |
启动服务及查看信息
-
- 启动数据库并修改参数
取消DMDCR_DB_RESTART_INTERVAL、DMDCR_DB_STARTUP_CMD前面的#号(3.4章节)。
A机器
[dmdba@~]# /opt/dsc/dmdbms/bin/DmASMSvrServiceASM restart
[dmdba@~]# /opt/dsc/dmdbms/bin/DmCSSServiceCSS restart
[dmdba@~]# /opt/dsc/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.1:5236
SQL> SP_SET_OGUID(45332);
SQL> ALTER DATABASE PRIMARY;
B机器
[dmdba@~]# /opt/dsc/dmdbms/bin/DmASMSvrServiceASM restart
[dmdba@~]# /opt/dsc/dmdbms/bin/DmCSSServiceCSS restart
C机器
[dmdba@~]# /opt/dmdbms/bin/DmServiceDW1_01 start
[dmdba@~]# /opt/dmdbms/bin/disql SYSDBA/SYSDBA@172.16.1.3:5236
SQL> SP_SET_OGUID(45332);
SQL> ALTER DATABASE STANDBY;
A/B机器:[dmdba@~]# /opt/dsc/dmdbms/bin/DmWatcherServiceWatcher start
C机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceWatcher start
-
- 启动DSC+DW监视器(选做)
A机器、B机器
前台启动:[dmdba@~]# /opt/dsc/dmdbms/bin/dmmonitor /opt/dsc/dmdbms/bin/dmmonitor.ini
C机器
前台启动:[dmdba@~]# /opt/dmdbms/bin/dmmonitor /opt/dmdbms/bin/dmmonitor.ini
A机器、B机器
[dmdba@~]# /opt/dsc/dmdbms/bin/DmCSSMonitorServiceMonitor start
前台启动:[dmdba@~]# /opt/dsc/dmdbms/bin/dmcssm INI_PATH=/opt/dsc/dmdbms/bin/dmcssm.ini
C机器
前台启动:[dmdba@~]# /opt/dmdbms/bin/dmmonitor /opt/dmdbms/bin/dmmonitor.ini
启动:A/B机器CSS→A/B/C机器守护进程
A/B机器:[dmdba@~]# /opt/dsc/dmdbms/bin/DmCSSServiceCSS start
A/B机器:[dmdba@~]# /opt/dsc/dmdbms/bin/DmWatcherServiceWatcher start
C机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceWatcher start
说明:CSS启动后30秒自动拉起ASM,60秒自动拉起DMSERVER。
停止: A/B机器DMSERVER→A/B机器ASM→A/B机器CSS→A/B/C机器守护进程→C机器DMSERVER
A/B机器:[dmdba@~]# /opt/dsc/dmdbms/bin/DmServiceDSC stop
A/B机器:[dmdba@~]# /opt/dsc/dmdbms/bin/DmASMSvrServiceASM stop
A/B机器:[dmdba@~]# /opt/dsc/dmdbms/bin/DmCSSServiceCSS stop
A/B机器:[dmdba@~]# /opt/dsc/dmdbms/bin/DmWatcherServiceWatcher stop
C机器:[dmdba@~]# /opt/dmdbms/bin/DmWatcherServiceWatcher stop
C机器:[dmdba@~]# /opt/dmdbms/bin/DmServiceDW1_01 stop
说明:1)DSC正常停库必须2节点同时停止,根据目前脚本配置,CSS启动后30秒自动拉起ASM,60秒自动拉起DMSERVER,所以停止DMSERVER和ASM后,要尽快停止CSS,避免被自动拉起。2)ASM服务在任意节点停止,2个节点的ASM服务都会停止,为了保险起见,可以两边都执行停止命令。3)服务全部停止后,要检查后台进程是否全部停止。
配置应用连接
Linux环境:dm_svc.conf放在应用服务器/etc目录下。
Windows32环境:dm_svc.conf放在应用服务器System32目录下。
Windows64环境:dm_svc.conf放在应用服务器System32和SysWOW64目录下。
-
- dm_svc.conf配置内容
[root@~]# vi /etc/dm_svc.conf
TIME_ZONE=(+8:00)
LANGUAGE=(cn)
DSC1=(172.16.1.1:5236,172.16.1.2:5236,172.16.1.3:5236)
[DSC1]
LOGIN_MODE=(1)
SWITCH_TIME=(20)
SWITCH_INTERVAL=(2000)
LOGIN_ENCRYPT=(0)
<DRIVER>dm.jdbc.driver.DmDriver</DRIVER>
<URL>jdbc:dm://DSC1:5236?compatibleMode=oracle</URL>
社区地址:https://eco.dameng.com