DM DSC动态扩展节点

1、在第三台机器上使用 DMASMCMD 工具 export 出备份 dmdcr_cfg_bak.ini

[dmdba@localhost bin]$ ./dmasmcmd
DMASMCMD V8
ASM>export dcrdisk '/dev/raw/raw1' to '/home/dmdba/dmdbms/data/dmdcr_cfg_bak.ini'  
ASMCMD export DCRDISK success.Used time: 95.013(ms).

2、为新增节点准备日志文件 ,至少两个日志文件,路径必须是 ASM 文件格式

SQL> alter database add node logfile '+DMLOG/log/dsc2_log01.log' size 2048,'+DMLOG/log/dsc2_log02.log' size 2048;
操作已执行

1)使用 dmasmtool 工具登录 ASM 文件系统,也可以看到新增的节点日志文件

[dmdba@localhost bin]$ ./dmasmtool DCR_INI=/home/dmdba/dmdbms/data/dmdcr.ini
DMASMTOOL V8
ASM>cd DMLOG
+DMLOG
Used time: 1.872(ms).
ASM>ls 
	dir : log
total count 1.
Used time: 2.331(ms).
ASM>cd log
+DMLOG/log
Used time: 1.250(ms).
ASM>ls
	file : dsc0_log01.log
	file : dsc0_log02.log
	file : dsc1_log01.log
	file : dsc1_log02.log
	file : dsc2_log01.log
	file : dsc2_log02.log
total count 6.
Used time: 2.717(ms).

2)使用 dmctlcvt 工具将 dm.ctl 转换为文本文件 dmctl.txt,查看 dmctl.txt, 新增节点的日志文件信息已 经添加进 dm.ctl

[dmdba@localhost bin]$ ./dmctlcvt type=1 src=+DMDATA/data/dsc/dm.ctl dest=/home/dmdba/dmdbms/data/dmctl.txt DCR_INI=/home/dmdba/dmdbms/data/dmdcr.ini
DMCTLCVT V8
convert ctl to txt success!

3、将节点一的dsc0_config目录拷贝到第三台机器的相同目录下面

[dmdba@localhost data]$ scp -r dsc0_config dmdba@192.168.56.100:/home/dmdba/dmdbms/data/

1)第三个节点:修改dm.ini

CONFIG_PATH  = /home/data/dsc2_config 
instance_name = DSC2 

2)第三个节点:修改dmarch.ini

[ARCHIVE_LOCAL1]
  ARCH_TYPE     		= LOCAL
  ARCH_DEST     		= /home/dmdba/dmdbms/arch_2
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960
[ARCH_REMOTE1]
  ARCH_TYPE     		= REMOTE
  ARCH_DEST     		= DSC0
  ARCH_INCOMING_PATH   	=/home/dmdba/dmdbms/arch_2_remote
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960

4、第三个节点:新建dmdcr.ini

DMDCR_PATH     = /dev/raw/raw1 
DMDCR_MAL_PATH = /home/dmdba/dmdbms/data/dmasvrmal.ini 
DMDCR_SEQNO    = 2

DMDCR_ASM_RESTART_INTERVAL = 30
DMDCR_ASM_STARTUP_CMD = /home/dmdba/dmdbms/bin/DmASMSvrService_DSC2 start

DMDCR_DB_RESTART_INTERVAL = 60
DMDCR_DB_STARTUP_CMD = /home/dmdba/dmdbms/bin/DmService_DSC2 start

5、DSC0/DSC1/DSC2:修改dmasvrmal.ini,添加新增节点信息 (三个节点一致)

[MAL_INST1]
    MAL_INST_NAME        = ASM0
    MAL_HOST                    = 192.168.56.101
    MAL_PORT                    = 7236
[MAL_INST2]
    MAL_INST_NAME         = ASM1
    MAL_HOST                    = 192.168.56.201
    MAL_PORT                    = 7237
[MAL_INST3]
    MAL_INST_NAME         = ASM2
    MAL_HOST                    = 192.168.56.100
    MAL_PORT                    = 7238

6、DSC0/DSC1/DSC2:修改dmmal.ini,添加新增节点信息 (三个节点一致)

[mal_inst0]
    mal_inst_name  = DSC0 
    mal_host       = 192.168.56.101 
    mal_port       = 9340 

[mal_inst1]
    mal_inst_name  = DSC1 
    mal_host       = 192.168.56.201 
    mal_port       = 9341 

[mal_inst2]
    mal_inst_name  = DSC2
    mal_host       = 192.168.56.100
    mal_port       = 9342

7、节点一:修改dmdcr_cfg_bak.ini,添加新增节点信息
CSS/ASMSVR/DB 都要配置所有组信息修改

# 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     = 5

[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     = 5

[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     = 5

[GRP_CSS]
DCR_EP_NAME        = CSS0
DCR_EP_HOST        = 192.168.56.101
DCR_EP_PORT        = 9341

[GRP_CSS]
DCR_EP_NAME        = CSS1
DCR_EP_HOST        = 192.168.56.201
DCR_EP_PORT        = 9343

[GRP_CSS]
DCR_EP_NAME        = CSS2
DCR_EP_HOST        = 192.168.56.100
DCR_EP_PORT        = 9500

[GRP_ASM]
DCR_EP_NAME        = ASM0
DCR_EP_SHM_KEY     = 93360
DCR_EP_SHM_SIZE    = 10
DCR_EP_HOST        = 192.168.56.101
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    = 10
DCR_EP_HOST        = 192.168.56.201
DCR_EP_PORT        = 9351
DCR_EP_ASM_LOAD_PATH  = /dev/raw

[GRP_ASM]
DCR_EP_NAME        = ASM2
DCR_EP_SHM_KEY     = 93362
DCR_EP_SHM_SIZE    = 10
DCR_EP_HOST        = 192.168.56.100
DCR_EP_PORT        = 9501
DCR_EP_ASM_LOAD_PATH  = /dev/raw

[GRP_DSC]
DCR_EP_NAME        = DSC0
DCR_EP_SEQNO       = 0
DCR_EP_PORT        = 5236
DCR_CHECK_PORT     = 9741

[GRP_DSC]
DCR_EP_NAME        = DSC1
DCR_EP_SEQNO       = 1
DCR_EP_PORT        = 5236
DCR_CHECK_PORT     = 9742

[GRP_DSC]
DCR_EP_NAME        = DSC2
DCR_EP_SEQNO       = 2
DCR_EP_PORT        = 5236
DCR_CHECK_PORT     = 9502

8、使用 DMASMCMD 工具将新增节点信息写回磁盘,新增节点作为 error 节点

[dmdba@localhost bin]$ ./dmasmcmd 
DMASMCMD V8
ASM>extend dcrdisk '/dev/raw/raw1' from '/home/dmdba/dmdbms/data/dmdcr_cfg_bak.ini'
ASMCMD extend node for dcr disk success.
ASMCMD extend node for vote disk success.
Used time: 171.077(ms).

9、在 dmcssm 控制台执行扩展节点命令 (extend node)
程序会通知所有实例(CSS/ASMSVR/dmserver)更新信息,在 CSS 控制台执行 SHOW 命令,能看到新增节点信息,ASMSVR/dmserver 是 error 节点,程序会通知 ASMSVR/dmserver 更新 MAL 信息

[dmdba@localhost bin]$ ./dmcssm INI_PATH=../dmcssm.ini
extend node
[monitor]         2020-02-29 08:51:28: 执行扩展节点动作

[monitor]         2020-02-29 08:51:34: 接收CSS(seqno: 0)消息超时
[monitor]         2020-02-29 08:51:34: 通知当前活动的CSS执行清理操作
[monitor]         2020-02-29 08:51:34: 命令EXTENT NODE 执行失败
show
Connect to [CSS2] failed, please check the network or the CSSM_CSS_IP config in [../dmcssm.ini] .

ep:	css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid          
    ts              	2020-02-29 08:52:25    CSS0          0         9341    Control Node OPEN               WORKING      OK           TRUE         504534381     
    504542950       	2020-02-29 08:52:25    CSS1          1         9343    Normal Node  OPEN               WORKING      OK           TRUE         504538083     
    504546637       	2020-02-29 08:52:25    CSS2          2         9500    Normal Node  SHUTDOWN           UNKNOWN      OK           FALSE        0     
      0               
=================== group[name = GRP_ASM, seq = 1, type = ASM, Control Node = 0] ========================================

n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)

sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL

crash process over flag is TRUE
ep:	css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid          
    ts              	2020-02-29 08:52:25    ASM0          0         9349    Control Node OPEN               WORKING      OK           TRUE         504542609     
    504551143       	2020-02-29 08:52:25    ASM1          1         9351    Normal Node  OPEN               WORKING      OK           TRUE         506121302     
    506122515       	2020-02-29 08:52:25    ASM2          2         9501    Normal Node  SHUTDOWN           UNKNOWN      ERROR        FALSE        0             
    0               
=================== group[name = GRP_DSC, seq = 2, type = DB, Control Node = 0] ========================================

n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)

sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL

crash process over flag is TRUE
ep:	css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid          
    ts              	2020-02-29 08:52:25    DSC0          0         5236    Control Node OPEN               WORKING      OK           TRUE         1440999152    
    1441007661      	2020-02-29 08:52:25    DSC1          1         5236    Normal Node  OPEN               WORKING      OK           TRUE         1445861939    
    1445863116      	2020-02-29 08:52:25    DSC2          2         5236    Normal Node  SHUTDOWN           UNKNOWN      ERROR        FALSE        0             
    0               
==================================================================================================================
        

10、启动新增节点的CSS、ASM、DB服务

./dmcss DCR_INI=/home/dmdba/dmdbms/data/dmdcr.ini

11、配置归档 dmarch.ini
1)节点一 DSC0

[ARCHIVE_LOCAL1]
  ARCH_TYPE     		= LOCAL
  ARCH_DEST     		= /home/dmdba/dmdbms/arch_0
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960
[ARCH_REMOTE1]
  ARCH_TYPE     		= REMOTE
  ARCH_DEST     		= DSC1  #代表将DSC1的归档放到本地arch_1_remote目录
  ARCH_INCOMING_PATH   	=/home/dmdba/dmdbms/arch_1_remote
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960
[ARCH_REMOTE2]
  ARCH_TYPE                     = REMOTE
  ARCH_DEST                     = DSC2
  ARCH_INCOMING_PATH            =/home/dmdba/dmdbms/arch_2_remote
  ARCH_FILE_SIZE                = 1024
  ARCH_SPACE_LIMIT              = 40960

2)节点二DSC1

[ARCHIVE_LOCAL1]
  ARCH_TYPE     		= LOCAL
  ARCH_DEST     		= /home/dmdba/dmdbms/arch_1
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960
[ARCH_REMOTE1]
  ARCH_TYPE     		= REMOTE
  ARCH_DEST     		= DSC0
  ARCH_INCOMING_PATH   		=/home/dmdba/dmdbms/arch_0_remote
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960
[ARCH_REMOTE2]
  ARCH_TYPE                     = REMOTE
  ARCH_DEST                     = DSC2
  ARCH_INCOMING_PATH            =/home/dmdba/dmdbms/arch_2_remote
  ARCH_FILE_SIZE                = 1024
  ARCH_SPACE_LIMIT              = 40960

3)节点三DSC2

[ARCHIVE_LOCAL1]
  ARCH_TYPE     		= LOCAL
  ARCH_DEST     		= /home/dmdba/dmdbms/arch_2
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960
[ARCH_REMOTE1]
  ARCH_TYPE     		= REMOTE
  ARCH_DEST     		= DSC0
  ARCH_INCOMING_PATH   		=/home/dmdba/dmdbms/arch_0_remote
  ARCH_FILE_SIZE        	= 1024
  ARCH_SPACE_LIMIT      	= 40960
[ARCH_REMOTE2]
  ARCH_TYPE                     = REMOTE
  ARCH_DEST                     = DSC1
  ARCH_INCOMING_PATH            =/home/dmdba/dmdbms/arch_1_remote
  ARCH_FILE_SIZE                = 1024
  ARCH_SPACE_LIMIT              = 40960

11、修改监视器

CSSM_OGUID      = 63635
CSSM_CSS_IP     = 192.168.56.101:9341
CSSM_CSS_IP     = 192.168.56.201:9343
CSSM_CSS_IP     = 192.168.56.100:9500
CSSM_LOG_PATH   = ../log        
CSSM_LOG_FILE_SIZE      = 32
CSSM_LOG_SPACE_LIMIT    = 0

注:
如果由于配置文件错误,动态扩展节点失败,只能停掉所有实例,重新 init dcr磁盘,不影响dmserver数据

上一篇:达梦数据库关键词屏蔽


下一篇:业务逻辑的好文章