环境准备:
os:centos7.9 dm8 软件安装路径/dm8 数据库软件版本:1-2-38-21.07.09-143359-10018-ENT
端口配置:
Ip | Vip | db name | port_num | ASM Mal port | DSC mal port | css port | asm port | dcr check port |
192.168.89.130 | 192.168.206.130 | DSC0 | 5237 | 7236 | 9340 | 9341 | 9349 | 9741 |
192.168.89.131 | 192.168.206.131 | DSC1 | 5237 | 7236 | 9340 | 9341 | 9349 | 9741 |
192.168.89.132 | 192.168.206.132 | DSC2 | 5237 | 7236 | 9340 | 9341 | 9349 | 9741 |
其中DSC2为接下来需要新增的节点
- export dmdcr_cfg文件
DSC0 机器上:
使用dmasmcmd工具export出备份dmdcr_cfg_bak.ini
./dmasmcmd
export dcrdisk ‘/dev/raw/raw1’ to ‘/dmdata/dmdcr_cfg_bak.ini’ --注意不要末尾加分号
- 为新增节点添加日志文件
登录原集群任意节点执行即可
alter database add node logfile ‘+DMLOG/log/DSC2_log01.log’ size 128, +DMLOG/log/DSC2_log02.log’ size 128;
查看新增节点的日志文件信息:
方法一:
dmctlcvt将dm.ctl转换为dmctl.txt
./dmctlcvt type=1 src=+DMDATA/data/dsc/dmctl dest=/dmdata/dmctl.txt dcr_ini=/dmdata/dmdcr.ini
方法二:
./dmasmtool dcr_ini=/dmdata/dmdcr.ini
ASM> ls +DMLOG/log
配置DMCSSM监视器
vi /dmdata/dmcssm.ini
#和 dmdcr_cfg.ini 中的 DCR_OGUID 保持一致
CSSM_OGUID = 63635 #配置所有 CSS 的连接信息,
#和 dmdcr_cfg.ini 中 CSS 配置项的 DCR_EP_HOST 和 DCR_EP_PORT 保持一致
CSSM_CSS_IP = 192.168.206.130:9341
CSSM_CSS_IP = 192.168.206.131:9341
CSSM_LOG_PATH =/dmdata/cssm_log #监视器日志文件存放路径
CSSM_LOG_FILE_SIZE = 32 #每个日志文件最大 32M
CSSM_LOG_SPACE_LIMIT =1024 #限定日志文件总占用空间1024M
dmcssm启动:
命令格式:
./dmcssm [[INI_PATH] | [INI_PATH=/opt/dmdbms/data/DAMENG/dmcssm.ini]
配置新增节点
- 配置config_path
1、将节点1 DSC0上将/dmdata/dsc0_config 目录拷贝为新增节点DSC2 上/dmdata/dsc2_config
2、修改参数文件dm.ini
config_path=/dmdata/dsc2_config
instance_name=DSC2
若配置了归档还需修改dmarch.ini
DSC0&DSC1归档添加内容:
[ARCH_REMOTE2]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC2
ARCH_INCOMING_PATH =+DMDATA/DSC2/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 1024
新增节点DSC2归档配置:
ARCH_LOCAL_SHARE = 1
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST =+DMDATA/DSC2/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 1024
[ARCH_REMOTE1]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC0
ARCH_INCOMING_PATH =+DMDATA/DSC0/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 1024
[ARCH_REMOTE2]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC1
ARCH_INCOMING_PATH =+DMDATA/DSC1/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 1024
3、新增节点配置dmdcr.ini
DMDCR_PATH = /dev/raw/raw1 #dcr磁盘路径
DMDCR_MAL_PATH =/dmdata/dmasvrmal.ini #dmasmsvr 使用的 MAL 配置文件路径
DMDCR_SEQNO = 2#当前节点序列号
#ASM 重启参数,命令行方式启动
#asm节点故障重启的时间间隔,0不会执行自动拉起,默认60s
DMDCR_ASM_RESTART_INTERVAL = 0
DMDCR_ASM_STARTUP_CMD = /dm8/bin/dmasmsvr dcr_ini=/dmdata/dmdcr.ini
#DB 重启参数,命令行方式启动
DMDCR_DB_RESTART_INTERVAL = 0
DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dmdata/dsc2_config/dm.ini dcr_ini=/dmdata/dmdcr.ini
4、配置dmasvrmal.ini
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 192.168.206.130
MAL_PORT = 7236
[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST =192.168.206.131
MAL_PORT = 7236
[MAL_INST3]
MAL_INST_NAME = ASM2
MAL_HOST =192.168.206.132
MAL_PORT = 7236
5、配置dmmal.ini文件
[mal_inst0]
mal_inst_name = DSC0
mal_host = 192.168.206.130
mal_port = 9340
[mal_inst1]
mal_inst_name = DSC1
mal_host = 192.168.206.131
mal_port = 9340
[mal_inst2]
mal_inst_name = DSC2
mal_host = 192.168.206.132
mal_port = 9340
6、修改之前export出的dmdcr_cfg_bak.ini文件
修改:
DCR_GRP_N_EP = 3
DCR_GRP_EP_ARR = {0,1,2}
每个组还需添加节点三成员:
# the file is auto-created by system, self edit is invalid!
#DCR HDR
DCR_N_GRP = 3
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635
[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = GRP_CSS
DCR_GRP_N_EP =3
DCR_GRP_EP_ARR = {0,1,2}
DCR_GRP_N_ERR_EP = 0
DCR_GRP_ERR_EP_ARR = {}
DCR_GRP_DSKCHK_CNT = 60
[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = GRP_ASM
DCR_GRP_N_EP = 3
DCR_GRP_EP_ARR = {0,1,2}
DCR_GRP_N_ERR_EP = 0
DCR_GRP_ERR_EP_ARR = {}
DCR_GRP_DSKCHK_CNT = 60
[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_DSC
DCR_GRP_N_EP =3
DCR_GRP_EP_ARR = {0,1,2}
DCR_GRP_N_ERR_EP = 0
DCR_GRP_ERR_EP_ARR = {}
DCR_GRP_DSKCHK_CNT = 60
[GRP_CSS]
DCR_EP_NAME = CSS0
DCR_EP_HOST = 192.168.206.130
DCR_EP_PORT = 9341
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.206.131
DCR_EP_PORT = 9341
[GRP_CSS]
DCR_EP_NAME = CSS2
DCR_EP_HOST = 192.168.206.132
DCR_EP_PORT = 9341
[GRP_ASM]
DCR_EP_NAME = ASM0
DCR_EP_SHM_KEY = 93360
DCR_EP_SHM_SIZE = 20
DCR_EP_HOST = 192.168.206.130
DCR_EP_PORT = 9349
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP_ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 20
DCR_EP_HOST = 192.168.206.131
DCR_EP_PORT = 9349
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP_ASM]
DCR_EP_NAME = ASM2
DCR_EP_SHM_KEY = 93362
DCR_EP_SHM_SIZE = 20
DCR_EP_HOST = 192.168.206.132
DCR_EP_PORT = 9349
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP_DSC]
DCR_EP_NAME = DSC0
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5237
DCR_CHECK_PORT = 9741
[GRP_DSC]
DCR_EP_NAME = DSC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5237
DCR_CHECK_PORT = 9741
[GRP_DSC]
DCR_EP_NAME = DSC2
DCR_EP_SEQNO = 2
DCR_EP_PORT = 5237
DCR_CHECK_PORT = 9741
7、将新增节点信息写回磁盘
使用dmasmcmd工具,新增节点作为error节点(在原DSC节点执行)
cd /dm8/bin
./dmasmcmd
extend dcrdisk ‘/dev/raw/raw1’ from ‘/dmdata/dmdcr_cfg_bak.ini’;
8、扩展节点
启动DMCSSM监视器
[dmdba@dmtest3 dmdata]$ cd /dm8/bin
[dmdba@dmtest3 bin]$ ./dmcssm ini_path=/dmdata/dmcssm.ini
直接执行:
extend node
程序会通知所有实例(CSS/ASMSVR/dmserver)更新信息,在 CSS 控制台执行 SHOW 命令,能看到新增节点信息, ASMSVR/dmserver 是 error 节点, 程 序 会 通 知 ASMSVR/dmserver 更新 MAL 信息。
在DSC2 上:
./dmcss dcr_ini=/dmdata/dmdcr.ini
./dmasmsvr dcr_ini=/dmdata/dmdcr.ini(如果 DMCSS 配置有自动拉起 dmasmsvr 的功能,可以等待 DMCSS 自动拉起 dmasmsvr 程序,不需要手动启动)
./dmserver /dmdata/dsc2_config/dm.ini dcr_ini=/dmdata/dmdcr.ini
查看CSS和ASM状态:
启动新增节点DB:
$ /dm8/bin/dmserver /dmdata/dsc2_config/dm.ini dcr_ini=/dmdata/dmdcr.ini
root用户下生成服务:
[root@dmtest3 ~]# cd /dm8/script/root/
[root@dmtest3 root]# ./dm_service_installer.sh -t dmasmsvr -p ASM2 -dcr_ini /dmdata/dmdcr.ini
dmasmsvr(RAC)服务需设置依赖服务(dmcss)!
[root@dmtest3 root]# ./dm_service_installer.sh -t dmasmsvr -p ASM2 -dcr_ini /dmdata/dmdcr.ini -y DmCSSServiceCSS2
Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceASM2.service to /usr/lib/systemd/system/DmASMSvrServiceASM2.service.
创建服务(DmASMSvrServiceASM2)完成
[root@dmtest3 root]# ./dm_service_installer.sh -t dmserver -p DSC2 -dcr_ini /dmdata/dmdcr.ini -y DmASMSvrServiceASM2
注册服务的ini文件路径不能为空或未设置ini文件路径("-dm_ini")!
[root@dmtest3 root]# ./dm_service_installer.sh -t dmserver -p DSC2 -dm_ini /dmdata/dsc2_config/dm.ini -dcr_ini /dmdata/dmdcr.ini -y DmASMSvrServiceASM2
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDSC2.service to /usr/lib/systemd/system/DmServiceDSC2.service.
创建服务(DmServiceDSC2)完成
查看DSC2的归档信息:
SQL> select ARCH_NAME,ARCH_TYPE,ARCH_DEST,ARCH_IS_VALID,ARCH_FILE_SIZE from v$dm_arch_ini;
如果由于配置文件错误,动态扩展节点失败,只能停掉所有实例,重新 init dcr 磁盘,不影响 dmserver 数据。
dmcssm监视器查看: