达梦DSC共享存储集群部署

目录

1    简介    1

2    部署环境    2

3    DSC共享存储集群集群部署    3

3.1    创建目录    3

3.2    配置dmdcr_cfg.ini    3

3.3    初始化磁盘组    5

3.4    配置 dmasvrmal.ini    6

3.5    配置 dmdcr.ini    6

3.6    启动CSSASM服务    7

3.7    创建DMASM磁盘组    8

3.8    配置dminit.ini    8

3.9    初始化数据库    10

3.10    配置 dmarch.ini    11

3.11    启动DMSERVER服务    12

3.12    注册服务    12

3.13    配置监视器    14

3.14    需要注意的地方    14

3.15    磁盘扩容    15

4    总结    15

 

 

  1. 简介

DMDSC集群是一个多实例、单数据库的系统。多个数据库实例可以同时访问、修改同一个数据库的数据。用户可以登录集群中的任意一个数据库实例,获得完整的数据库服务。数据文件、控制文件在集群系统中只有一份,不论有几个节点,这些节点都平等地使用这些文件。DMDSC 集群得以实现的重要基础就是共享存储。DM 支持的共享存储有两种:裸设备DMASM。这两种存储的区别在于后者在前者的基础上,部署并使用了 DMASM 文件系统。

1-1 什么是DMDSC

  1. 部署环境

2‑1 部署环境

系统版本

银河麒麟V10

CPU型号

Intel(R) i5-7200U CPU (2核)

磁盘空间

40G

内存大小

2G

2‑2 磁盘规划

数据

/dev/mapper/vg_dm-lv_dmdata

备份

/dev/mapper/vg_dm-lv_dmbak

归档

/dev/mapper/vg_dm-lv_arch

2‑3 目录规划

数据库软件安装目录

/opt/dsc/dmdbms

实例安装目录

/opt/dsc/config/dsc0_config

归档存放目录

/opt/dsc/arch_0

备份存放目录

/opt/dsc/dmbak_0

2‑4 IP端口规划

实例名

业务IP

心跳IP

MAL端口

系统监听端口

实例本地的守护进程监听端口

实例监听守护进程端口

DMDSC01

172.16.1.1

192.168.1.1

5236

7336

7436

7536

DMDSC02

172.16.1.2

192.168.1.2

5236

7336

7436

7536

  1. DSC共享存储集群集群部署

    1. 创建目录

节点1切换到dmdba用户下,创建文件夹,数据库安装在/opt/dsc/dmdbms目录下

[root@dmdsc01 ~]# chmod 777 /opt/

[root@dmdsc01 ~]# su - dmdba

[dmdba@ dmdsc01 ~]$ mkdir /opt/dsc /opt/dsc/setup /opt/dsc/dmdbms /opt/dsc/config /opt/dsc/arch_0 /opt/dsc/arch_0_remote /opt/dsc/bak

节点2切换到dmdba用户下,创建文件夹,数据库安装在/opt/dsc/dmdbms目录下

[root@dmdsc02 ~]# chmod 777 /opt/

[root@dmdsc02 ~]# su - dmdba

[dmdba@dmdsc02 ~]# mkdir /opt/dsc /opt/dsc/setup /opt/dsc/dmdbms /opt/dsc/config /opt/dsc/arch_1 /opt/dsc/arch_1_remote /opt/dsc/bak

 

  1. 配置dmdcr_cfg.ini

[root@xxxx ~]# su - dmdba

[dmdba@xxxx ~]$ vim /opt/dsc/config/dmdcr_cfg.ini

在/opt/dsc/config下新建dmdcr_cfg.ini文件(DMDSC01节点、DMDSC02节点该文件相同):

/DCR_N_GRP = 3

DCR_VTD_PATH = /dev/raw/raw2

DCR_OGUID = 45330

 

[GRP]

DCR_GRP_TYPE = CSS

DCR_GRP_NAME = GRP_CSS

DCR_GRP_N_EP = 2

DCR_GRP_DSKCHK_CNT = 60

[GRP_CSS]

DCR_EP_NAME = CSS0

DCR_EP_HOST = 192.168.1.1 #心跳地址

DCR_EP_PORT = 9341

[GRP_CSS]

DCR_EP_NAME = CSS1

DCR_EP_HOST = 192.168.1.2 #心跳地址

DCR_EP_PORT = 9343

 

[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

DCR_EP_SHM_KEY = 93360

DCR_EP_SHM_SIZE = 10

DCR_EP_HOST = 172.16.1.1 #业务地址

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 = 172.16.1.2 #业务地址

DCR_EP_PORT = 9351

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

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

  1. 初始化磁盘组

DMDSC01节点上启动dmasmcmd工具,依次执行以下命令:

[dmdba@dmdsc01 ~]$ cd /opt/dsc/dmdbms/bin

[dmdba@ dmdsc01 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 'abcd'

ASM> init votedisk '/dev/raw/raw2' from '/opt/dsc/config/dmdcr_cfg.ini'

31 初始化磁盘成功

 

  1. 配置 dmasvrmal.ini

/opt/dsc/config下新建dmasvrmal.ini文件(DMDSC01节点与DMDSC02节点上该文件相同):

[dmdba@xxxx ~]$ vim /opt/dsc/config/dmasvrmal.ini

[MAL_INST1]

MAL_INST_NAME = ASM0

MAL_HOST = 192.168.1.1

MAL_PORT = 7236

[MAL_INST2]

MAL_INST_NAME = ASM1

MAL_HOST = 192.168.1.2

MAL_PORT = 7237

  1. 配置 dmdcr.ini

DMDSC01节点的/opt/dsc/config下新建dmdcr.ini文件

[dmdba@dmdsc01 ~]$ vim /opt/dsc/config/dmdcr.ini

DMDCR_PATH = /dev/raw/raw1

DMDCR_MAL_PATH = /opt/dsc/config/dmasvrmal.ini

DMDCR_SEQNO = 0

 

#ASM重启参数,命令行方式启动

#DMDCR_ASM_RESTART_INTERVAL = 30

#DMDCR_ASM_STARTUP_CMD = /etc/rc.d/init.d/DmASMSvrServicedmdsc01 start

 

#DB重启参数,命令行方式启动

#DMDCR_DB_RESTART_INTERVAL = 60

#DMDCR_DB_STARTUP_CMD = /etc/rc.d/init.d/DmServicedmdsc01 start

DMDSC02节点的/opt/dsc/config下新建dmdcr.ini文件

[dmdba@dmdsc02 ~]$ vim /opt/dsc/config/dmdcr.ini

DMDCR_PATH = /dev/raw/raw1

DMDCR_MAL_PATH = /opt/dsc/config/dmasvrmal.ini

DMDCR_SEQNO = 1

 

#ASM重启参数,命令行方式启动

#DMDCR_ASM_RESTART_INTERVAL = 30

#DMDCR_ASM_STARTUP_CMD = /etc/rc.d/init.d/DmASMSvrServicedmdsc02 start

 

#DB重启参数,命令行方式启动

#DMDCR_DB_RESTART_INTERVAL = 60

#DMDCR_DB_STARTUP_CMD = /etc/rc.d/init.d/DmServicedmdsc02 start

dmdcr.ini中先将ASMDMSERVER配置为手动服务,待所有配置完成后,再修改dmdcr.iniASMDMSERVER配置成自动拉起。

  1. 启动CSS、ASM服务

以前台启动服务方式分别启动DMDSC01节点、DMDSC02节点的CSSASM服务,设置CSS[0]为主CSS,[ASM]: 设置EP[0]为主EP

[dmdba@xxxx]$ cd /opt/dsc/dmdbms/bin

[dmdba@xxxx]$ ./dmcss DCR_INI=/opt/dsc/config/dmdcr.ini

3-2 启动CSSASM服务

[dmdba@xxxx]$ cd /opt/dsc/dmdbms/bin

[dmdba@xxxx]$ ./dmasmsvr DCR_INI=/opt/dsc/config/dmdcr.ini

dmcss V8

ASM SELF EPNO:0

dmasmsvr task worker thread startup

the ASM server is Ready.

 

  1. 创建DMASM磁盘组

DMDSC01节点上启动dmasmtool工具,创建DMASM磁盘组:

[dmdba@xxxx]$ cd /opt/dsc/dmdbms/bin

[dmdba@xxxx]$ ./dmasmtool DCR_INI=/opt/dsc/config/dmdcr.ini

ASM> create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3'

ASM> create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4'

  1. 配置dminit.ini

//两节点文件一致

[dmdba@xxxx ~]$ vim /opt/dsc/config/dminit.ini

db_name = dsc

system_path = +DMDATA/data

system = +DMDATA/data/dsc/system.dbf

system_size = 128

roll = +DMDATA/data/dsc/roll.dbf

roll_size = 128

main = +DMDATA/data/dsc/main.dbf

main_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

 

[DSC0]

config_path = /opt/dsc/config/dsc0_config

port_num = 5236

mal_host = 192.168.1.1

mal_port = 9340

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 = 9341

log_path = +DMLOG/log/dsc1_log01.log

log_path = +DMLOG/log/dsc1_log02.log

  1. 初始化数据库

DMDSC01节点上启动dminit工具初始化数据库,然后会在config目录下生成dsc0_configdsc1_config目录,每个目录下都有dm.inidmmal.ini。将DMDSC01节点上生成的dsc1_config目录剪贴到DMDSC02节点的config目录下。

[dmdba@dmdsc01 ~]$ cd /opt/dsc/dmdbms/bin

[dmdba@dmdsc01 bin]$ ./dminit control=/opt/dsc/config/dminit.ini

initdb V8

...

create dm database success. 2022-01-23 13:26:16

[dmdba@dmdsc01 bin]$ cd /opt/dsc/dmdbms/bin

 

//DMDSC01节点:上生成的dsc1_config目录剪贴到DMDSC02节点:的config目录下

[dmdba@dmdsc01 bin]$ scp -r /opt/dsc/config/dsc1_config dmdba@172.16.1.2:/opt/dsc/config

33 初始化成功

  1. 配置 dmarch.ini

//将DMDSC01节点、DMDSC02节点上dm.ini中的ARCH_INI设置为1,然后配置dmarch.ini文件。在DMDSC01节点的/opt/dsc/config/dsc0_config下新建dmarch.ini文件

 

[dmdba@dmdsc01 ~]$ vim /opt/dsc/config/dsc0_config/dm.ini

ARCH_INI = 1

[dmdba@dmdsc01 ~]$ vim /opt/dsc/config/dsc0_config/dmarch.ini

[ARCHIVE_LOCAL1]

ARCH_TYPE = LOCAL

ARCH_DEST = /opt/dsc/arch_0

ARCH_FILE_SIZE = 2048

ARCH_SPACE_LIMIT = 51200

[ARCH_REMOTE1]

ARCH_TYPE = REMOTE

ARCH_DEST = DSC1

ARCH_INCOMING_PATH = /opt/dsc/arch_0_remote

ARCH_FILE_SIZE = 2048

ARCH_SPACE_LIMIT = 51200

 

//在DMDSC02节点的/opt/dsc/config/dsc1_config下新建dmarch.ini文件

[dmdba@dmdsc02 ~]$ vim /opt/dsc/config/dsc1_config/dm.ini

ARCH_INI = 1

[dmdba@dmdsc02 ~]$ vim /opt/dsc/config/dsc1_config/dmarch.ini

[ARCHIVE_LOCAL1]

ARCH_TYPE = LOCAL

ARCH_DEST = /opt/dsc/arch_1

ARCH_FILE_SIZE = 2048

ARCH_SPACE_LIMIT = 51200

[ARCH_REMOTE1]

ARCH_TYPE = REMOTE

ARCH_DEST = DSC0

ARCH_INCOMING_PATH = /opt/dsc/arch_1_remote

ARCH_FILE_SIZE = 2048

ARCH_SPACE_LIMIT = 51200

  1. 启动DMSERVER服务

// DMDSC01节点:

[dmdba@dmdsc01 ~]$ cd /opt/dsc/dmdbms/bin

[dmdba@dmdsc01 bin]$ ./dmserver /opt/dsc/config/dsc0_config/dm.ini dcr_ini=/opt/dsc/config/dmdcr.ini

 

// DMDSC02节点:

[dmdba@dmdsc02 ~]$ cd /opt/dsc/dmdbms/bin

[dmdba@dmdsc02 bin]$ ./dmserver /opt/dsc/config/dsc1_config/dm.ini dcr_ini=/opt/dsc/config/dmdcr.ini

3-3 查询进程

  1. 注册服务

// DMDSC01节点:

[root@dmdsc01 ~]# cd /opt/dsc/dmdbms/script/root/

[root@dmdsc01 root]# ./dm_service_installer.sh -t dmserver -p dmdsc01 -dm_ini /opt/dsc/config/dsc0_config/dm.ini -dcr_ini /opt/dsc/config/dmdcr.ini -m open

移动服务脚本文件(/opt/dsc/dmdbms/bin/DmServicedmdsc01 到 /etc/rc.d/init.d/DmServicedmdsc01)

创建服务(DmServicedmdsc01)完成

[root@dmdsc01 root]# ./dm_service_installer.sh -t dmasmsvr -p dmdsc01 -dcr_ini /opt/dsc/config/dmdcr.ini

移动服务脚本文件(/opt/dsc/dmdbms/bin/DmASMSvrServicedmdsc01 到 /etc/rc.d/init.d/DmASMSvrServicedmdsc01)

创建服务(DmASMSvrServicedmdsc01)完成

[root@dmdsc01 root]# ./dm_service_installer.sh -t dmcss -p dmdsc01 -dcr_ini /opt/dsc/config/dmdcr.ini

移动服务脚本文件(/opt/dsc/dmdbms/bin/DmCSSServicedmdsc01 到 /etc/rc.d/init.d/DmCSSServicedmdsc01)

创建服务(DmCSSServicedmdsc01)完成

 

//DMDSC02节点:

[root@dmdsc02 ~]# cd /opt/dsc/dmdbms/script/root/

[root@dmdsc02 root]# ./dm_service_installer.sh -t dmserver -p dmdsc02 -dm_ini /opt/dsc/config/dsc1_config/dm.ini -dcr_ini /opt/dsc/config/dmdcr.ini -m open

移动服务脚本文件(/opt/dsc/dmdbms/bin/DmServicedmdsc02 到 /etc/rc.d/init.d/DmServicedmdsc02)

创建服务(DmServicedmdsc02)完成

[root@dmdsc02 root]# ./dm_service_installer.sh -t dmasmsvr -p dmdsc02 -dcr_ini /opt/dsc/config/dmdcr.ini

移动服务脚本文件(/opt/dsc/dmdbms/bin/DmASMSvrServicedmdsc02 到 /etc/rc.d/init.d/DmASMSvrServicedmdsc02)

创建服务(DmASMSvrServicedmdsc02)完成

[root@dmdsc02 root]# ./dm_service_installer.sh -t dmcss -p dmdsc02 -dcr_ini /opt/dsc/config/dmdcr.ini

移动服务脚本文件(/opt/dsc/dmdbms/bin/DmCSSServicedmdsc02 到 /etc/rc.d/init.d/DmCSSServicedmdsc02)

创建服务(DmCSSServicedmdsc02)完成

  1. 配置监视器

//将dmcssm.ini放在数据库安装目录的bin目录下

[dmdba@xxxx ~]$ vim /opt/dsc/dmdbms/bin/dmcssm.ini

 

CSSM_OGUID = 45330

CSSM_CSS_IP = 192.168.1.1:9341

CSSM_CSS_IP = 192.168.1.2:9343

CSSM_LOG_PATH = ../log

CSSM_LOG_FILE_SIZE = 256

CSSM_LOG_SPACE_LIMIT = 1024

 

//启动监视器

[dmdba@xxxx ~]$ cd /opt/dsc/dmdbms/bin/

[dmdba@xxxx bin]$ ./dmcssm INI_PATH=dmcssm.ini

  1. 磁盘扩容

表空间空间使用快满时,ASM可以进行添加磁盘,划分新磁盘并加入裸设备,使用DMASMTOOL工具添加磁盘

alter diskgroup 'DMDATA' add asmdisk '/dev/raw/raw5'

 

 

 

 

 

技术社区地址:https://eco.dameng.com

posted @   zzzzz887  阅读(201)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示