注册
【与达梦同行】DM新版本DSC部署方案(参数、存储挂载方式)
技术分享/ 文章详情 /

【与达梦同行】DM新版本DSC部署方案(参数、存储挂载方式)

大白萌萌熊 2022/12/28 1338 1 1

DMDSC搭建
1 环境准备
配置环境说明
主机 IP地址 实例名 操作系统
dmjdcs1 192.168.2.151(外部服务)
10.10.20.152(内部通信) dmjdcs1 RHEL 7.5
dmjdcs2 192.168.2.152(外部服务)
10.10.20.152(内部通信) dmjdcs2 RHEL 7.5
dmjdcsdmcssm 192.168.2.153(外部服务)
10.10.20.153(内部通信) dmjdcsdmcssm RHEL 7.5
2 安装DM 软件
DSC 的配置工具在DM的软件介质中,所以需要先安装好DM软件。
DMDSC搭建
1 环境准备
配置环境说明
主机 IP地址 实例名 操作系统
dmjdcs1 192.168.2.151(外部服务)
10.10.20.152(内部通信) dmjdcs1 RHEL 7.5
dmjdcs2 192.168.2.152(外部服务)
10.10.20.152(内部通信) dmjdcs2 RHEL 7.5
dmjdcsdmcssm 192.168.2.153(外部服务)
10.10.20.153(内部通信) dmjdcsdmcssm RHEL 7.5
2 安装DM 软件
DSC 的配置工具在DM的软件介质中,所以需要先安装好DM软件。

3 共享存储环境准备
在虚拟机上创建4个共享磁盘,规划如下:(注意:关机状态下,新增控制器,可共享)

4 绑定UDEV
在之前步骤创建好raw设备之后,在操作系统层面可以直接看到这些硬盘:
[root@dm8dsc1 ~]# fdisk -l|grep “Disk /dev/sd*”|sort -u
Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Disk /dev/sdb: 1073 MB, 1073741524 bytes, 2097152 sectors
Disk /dev/sdc: 2147 MB, 2147483648 bytes, 4194304 sectors
Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Disk /dev/sde: 10.7 GB, 10737415240 bytes, 20971520 sectors
Disk /dev/sdf: 6442 MB, 6442450944 bytes, 12582912 sectors
在虚拟机配置文件dmdsc1.vmx中加入disk.EnableUUID = “TRUE”,确保获取UUID,再添加硬盘
直接执行如下脚本,完成UDEV绑定:
[root@dm8dsc1 ~]#
for i in b c d e f;
do
echo “KERNEL==“sd?”,SUBSYSTEM==“block”, PROGRAM==”/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT==“/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i”, SYMLINK+=“dm-disk$i”,OWNER=“dmdba”, GROUP=“dinstall”,MODE=“0660"”
done

[root@dm8dsc1 rules.d]# cat /etc/udev/rules.d/99-dm-devices.rules
#重启UDEV 查看绑定:
[root@dm8dsc1 rules.d]# /sbin/udevadm trigger --type=devices --action=change
[root@dm8dsc1 rules.d]# /sbin/udevadm control --reload-rules
[root@dm8dsc1 rules.d]# ll /dev/dm-*
将结果直接字节复制到另一个节点,因为同一硬件设备UUID相同。
6 配置dmdcr_cfg.ini 文件
在2个节点的/dm/dmdbms/data目录下创建配置文件dmdcr_cfg.ini,在文件中添加如下内容:
[root@dm8dsc1 dmdbms]# su - dmdba
[dmdba@dm8dsc1 ~]$ mkdir -p /dm/dmdbms/data
[dmdba@dm8dsc1 ~]$ vi /dm/dmdbms/data/dmdcr_cfg.ini
[dmdba@dm8dsc1 ~]$ cat /dm/dmdbms/data/dmdcr_cfg.ini
DCR_N_GRP = 3
DCR_VTD_PATH = /dev/dm-vote
DCR_OGUID = 63635

[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = dmjdcs_css
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[dmjdcs_css]
DCR_EP_NAME = dmjdcs1css
DCR_EP_HOST = 10.10.20.151
DCR_EP_PORT = 9541
[dmjdcs_css]
DCR_EP_NAME = dmjdcs2css
DCR_EP_HOST = 10.10.20.152
DCR_EP_PORT = 9542

[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = dmjdcs_asm
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[dmjdcs_asm]
DCR_EP_NAME = dmjdcs1asm
DCR_EP_SHM_KEY = 93360
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.10.20.151
DCR_EP_PORT = 9641
DCR_EP_ASM_LOAD_PATH = /dev
[dmjdcs_asm]
DCR_EP_NAME = dmjdcs2asm
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.10.20.152
DCR_EP_PORT = 9642
DCR_EP_ASM_LOAD_PATH = /dev

[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = dmjdcs_dsc
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[dmjdcs_dsc]
DCR_EP_NAME = dmjdcs1
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[dmjdcs_dsc]
DCR_EP_NAME = dmjdcs2
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9742
7 使用 DMASMCMD 工具初始化
在任意一台节点上用dmasmcmd工具执行如下命令:
[root@dm8dsc1 ~]# su - dmdba
[dmdba@dm8dsc1 ~]$ dmasmcmd
DMASMCMD V8.1.0.147-Build(2019.03.27-104581)ENT
ASM>create dcrdisk ‘/dev/dm-dcr’ ‘dcr’
[Trace]The ASM initialize dcrdisk /dev/raw/raw1 to name DMASMdcr
Used time: 9.134(ms).
ASM>create votedisk ‘/dev/dm-vote’ ‘vote’
[Trace]The ASM initialize votedisk /dev/raw/raw2 to name DMASMvote
Used time: 8.760(ms).
ASM>create asmdisk ‘/dev/dm-log’ ‘log’
[Trace]The ASM initialize asmdisk /dev/raw/raw3 to name DMASMLOG0
Used time: 7.536(ms).
ASM>create asmdisk ‘/dev/dm-data’ ‘data’
ASM>create asmdisk ‘/dev/dm-arch’ ‘arch’
[Trace]The ASM initialize asmdisk /dev/raw/raw4 to name DMASMDATA0
Used time: 8.811(ms).
ASM>init dcrdisk ‘/dev/dm-dcr’ from ‘/dm/dmdbms/data/dmdcr_cfg.ini’ identified by ‘dmjdcs’
[Trace]DG 126 allocate 4 extents for file 0xfe000002.
Used time: 145.364(ms).
ASM>init votedisk ‘/dev/dm-vote’ from ‘/dm/dmdbms/data/dmdcr_cfg.ini’
[Trace]DG 125 allocate 4 extents for file 0xfd000002.
Used time: 27.909(ms)
8 准备DMASM 的 MAL 配置文件(dmasvrmal.ini)
在2个节点的/dm/dmdbms/data目录下创建 DMASM 的 MAL 配置文件(命名为 dmasvrmal.ini),使用 DMASM 的所有节点都要配置,内容完全一样。
[root@dm8dsc1 ~]# su - dmdba
[dmdba@dm8dsc1 ~]$ vi /dm/dmdbms/data/dmasvrmal.ini
[dmdba@dm8dsc1 ~]$ cat /dm/dmdbms/data/dmasvrmal.ini
[MAL_INST1]
MAL_INST_NAME = dmjdcs1asm
MAL_HOST = 10.10.20.151
MAL_PORT = 7236
[MAL_INST2]
MAL_INST_NAME = dmjdcs2asm
MAL_HOST = 10.10.20.152
MAL_PORT = 7237
9 准备dmdcr.ini 配置文件
dmdcr.ini 是 dmcss、dmasmsvr、dmasmtool 工具的输入参数。记录了当前节点序列号以及 DCR 磁盘路径。
在2个节点的/dm/dmdbms/data目录下创建dmdcr.ini 配置文件,dmdcr_path 相同,dmasvrmal.ini 文件内容也相同,dmdcr_seqo 分别为 0 和 1。
节点 10.10.20.151:
[root@dm8dsc1 ~]# su - dmdba
[dmdba@dm8dsc1 ~]$ vi /dm/dmdbms/data/dmdcr.ini
[dmdba@dm8dsc1 ~]$ cat /dm/dmdbms/data/dmdcr.ini
DMDCR_PATH = /dev/dm-dcr

dmasmsvr 使用的 MAL 配置文件路径

DMDCR_MAL_PATH =/dm/dmdbms/data/dmasvrmal.ini
DMDCR_SEQNO = 0

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

DMDCR_ASM_RESTART_INTERVAL = 30
DMDCR_ASM_STARTUP_CMD = /dm/dmdbms/bin/dmasmsvr dcr_ini=/dm/dmdbms/data/dmdcr.ini

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

DMDCR_DB_RESTART_INTERVAL = 60
DMDCR_DB_STARTUP_CMD = /dm/dmdbms/bin/dmserver path=/dm/dmdbms/data/dmjdcs1_config/dm.ini dcr_ini=/dm/dmdbms/data/dmdcr.ini
节点 10.10.20.152:
[root@dm8dsc2 ~]# su - dmdba
[dmdba@dm8dsc2 ~]$ vi /dm/dmdbms/data/dmdcr.ini
[dmdba@dm8dsc2 ~]$ cat /dm/dmdbms/data/dmdcr.ini
DMDCR_PATH = /dev/dm-dcr
#dmasmsvr 使用的 MAL 配置文件路径
DMDCR_MAL_PATH =/dm/dmdbms/data/dmasvrmal.ini
DMDCR_SEQNO = 1

#ASM 重启参数,命令行方式启动
DMDCR_ASM_RESTART_INTERVAL = 30
DMDCR_ASM_STARTUP_CMD = /dm/dmdbms/bin/dmasmsvr dcr_ini=/dm/dmdbms/data/dmdcr.ini

#DB 重启参数,命令行方式启动
DMDCR_DB_RESTART_INTERVAL = 60
DMDCR_DB_STARTUP_CMD = /dm/dmdbms/bin/dmserver path=/dm/dmdbms/data/dmjdcs2_config/dm.ini dcr_ini=/dm/dmdbms/data/dmdcr.ini
10 启动DMCSS、DMASM 服务程序
10.1 分别在2个节点注册DMCSS和DMASM服务
#DMCSS:
[root@dmjdcs1 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm/dmdbms/data/dmdcr.ini -p dmjdcs1
[root@dmjdcs1 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmdbms/data/dmdcr.ini -p dmjdcs1 -y DmCSSServicedmjdcs1

[root@dmjdcs2 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm/dmdbms/data/dmdcr.ini -p dmjdcs2
[root@dmjdcs2 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmdbms/data/dmdcr.ini -p dmjdcs2 -y DmCSSServicedmjdcs2
10.2 启动DMCSS和DMASM 服务
节点1:
[root@dm8dsc1 ~]$ systemctl start DmCSSServicedmjdcs1
[root@dm8dsc1 ~]$ systemctl start DmASMSvrServicedmjdcs1

节点2:
[root@dm8dsc1 ~]$ systemctl start DmCSSServicedmjdcs2
[root@dm8dsc1 ~]$ systemctl start DmASMSvrServicedmjdcs2
11 创建DMASM磁盘组
在任意节点使用 dmasmtool 工具创建 DMASM 磁盘组。
[root@dm8dsc2 ~]# su - dmdba
[dmdba@dm8dsc2 ~]$ dmasmtool DCR_INI=/dm/dmdbms/data/dmdcr.ini
DMASMTOOL V7.6.0.197-Build(2019.09.12-112648)ENT
ASM>create diskgroup ‘dmlog’ asmdisk ‘/dev/dm-log’
Used time: 00:00:08.219.
ASM>create diskgroup ‘dmdata’ asmdisk ‘/dev/dm-data’
Used time: 00:00:05.349.
ASM>create diskgroup ‘dmarch’ asmdisk ‘/dev/dm-arch’
Used time: 00:00:05.349.

12 准备dminit.ini 配置文件
在2个节点的/dm/dmdbms/data目录下创建 dminit.ini 配置文件,添加如下内容。 在2个节点都创建。
[root@dm8dsc1 ~]# su - dmdba
[dmdba@dm8dsc1 ~]$ vi /dm/dmdbms/data/dminit.ini
[dmdba@dm8dsc1 ~]$ cat /dm/dmdbms/data/dminit.ini
db_name = dmjdcs
system_path = +dmdata
system = +dmdata/dmjdcs/system.dbf
system_size = 512
roll = +dmdata/dmjdcs/roll.dbf
roll_size = 512
main = +dmdata/dmjdcs/main.dbf
main_size = 512
ctl_path = +dmdata/dmjdcs/dm.ctl
ctl_size = 8
#dcr 磁盘路径,目前不支持 asm,只能是裸设备
dcr_path = /dev/dm-dcr
dcr_seqno = 0
auto_overwrite = 1
case_sensitive=1
log_size=2048
page_size=32
extent_size=32
length_in_char=0
charset=1

#inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
[dmjdcs1]
config_path = /dm/dmdbms/data/dmjdcs1_config
port_num = 5236
mal_host = 10.10.20.151
mal_port = 9340
log_path = +dmlog/dmjdcs1_log01.log
log_path = +dmlog/dmjdcs1_log02.log

#inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
[dmjdcs2]
config_path = /dm/dmdbms/data/dmjdcs2_config
port_num = 5236
mal_host = 10.10.20.152
mal_port = 9341
log_path = +dmlog/dmjdcs2_log01.log
log_path = +dmlog/dmjdcs2_log02.log
13 使用dminit 初始化 DB 环境
在任意节点启动 dminit 工具初始化数据库。dminit 执行完成后,会在 config_path 目录(/dm/dmdbms/data/dmjdcs1_config 和/dm/dmdbms/data/dmjdcs2_config)下生成配置文件 dm.ini 和 dmmal.ini。
[dmdba@dm8dsc1 data]$ dminit control=/dm/dmdbms/data/dminit.ini
initdb V7.6.0.95-Build(2018.09.13-97108)ENT
db version: 0x7000a
file dm.key not found, use default license!
License will expire on 2019-10-02

log file path: +DMLOG/log/rac0_log01.log
log file path: +DMLOG/log/rac0_log02.log
log file path: +DMLOG/log/rac1_log01.log
log file path: +DMLOG/log/rac1_log02.log

write to dir [+DMDATA/data/rac].
create dm database success. 2019-09-18 14:11:07

[dmdba@dm8dsc1 data]$ cd /dm/dmdbms/data
#将rac1的配置文件复制过去:
[dmdba@dm8dsc1 data]$ scp -r dmjdcs2_config 192.168.2.152:pwd
14 启动数据库服务器
14.1 注册服务
在2个节点分别注册DM 数据库服务:
[root@dm8dsc1 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmdbms/data/dmjdcs1_config/dm.ini -dcr_ini /dm/dmdbms/data/dmdcr.ini -p dmjdcs1 -y DmASMSvrServicedmjdcs1

[root@dm8dsc2 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmdbms/data/dmjdcs2_config/dm.ini -dcr_ini /dm/dmdbms/data/dmdcr.ini -p dmjdcs2 -y DmASMSvrServicedmjdcs2
14.2 启动数据库
[root@dmjdcs1 ~]# systemctl start DmServicedmjdcs1
[root@dmjdcs2 ~]# systemctl start DmServicedmjdcs2
如果 DMCSS 配置有自动拉起 dmserver 的功能,可以等待 DMCSS 自动拉起实例,不需要手动启动。
15 连接数据库验证
15.1 配置服务名文件
[root@dm8dsc1 ~]$ vi /etc/dm_svc.conf
[root@dm8dsc1 ~]$ cat /etc/dm_svc.conf
dmsbdsc=(192.168.2.151:5236,192.168.2.152:5236)
SWITCH_TIME=(10000)
SWITCH_INTERVAL=(10)
TIME_ZONE=(480)
LANGUAGE=(cn)
15.2 连接RAC集群
[dmdba@dm8dsc1 ~]$ disql SYSDBA/SYSDBA@dmsbdsc
SQL> select instance_name from v$instance;
SQL> select * from v$dsc_ep_info;
15.3 测试故障重连
[root@dmjdcs1 ~]# su - dmdba
[dmdba@dmjdcs1 ~]$ ps -ef|grep dm.ini
dmdba 3375 1 6 14:59 ? 00:00:25 /dm/dmdbms/bin/dmserver /dm/dmdbms/data/rac1_config/dm.ini DCR_INI=/dm/dmdbms/data/dmdcr.ini -noconsole
dmdba 3634 3603 0 15:06 pts/0 00:00:00 grep dm.ini
[dmdba@dmjdcs1 ~]$ kill -9 3375
[dmdba@dmjdcs1 ~]$ disql SYSDBA/SYSDBA@dmjdcs
[-70065]:连接异常,切换当前连接成功.
SQL> select instance_name from v$instance;
SQL> select * from v$dsc_ep_info;

[dmdba@dm8dsc1 ~]$ service DmServicedmdsc2 restart
[dmdba@dm8dsc1 ~]$ disql SYSDBA/SYSDBA@dmdsc
SQL> select instance_name from v$instance;
SQL> select * from v$dsc_ep_info;
16 DMCSSM监控器
16.1 配置步骤
[dmdba@dmjdcsmonitor dmdbms]$ mkdir -p /dm/dmdbms/data
[dmdba@dmjdcsmonitor dmdbms]$ vi /dm/dmdbms/data/dmcssm.ini

#和dmdcr_cfg.ini中的DCR_OGUID保持一致
CSSM_OGUID = 63635
#配置所有CSS的连接信息,
#和dmdcr_cfg.ini中CSS配置项的DCR_EP_HOST和DCR_EP_PORT保持一致
CSSM_CSS_IP = 10.10.20.151:9541
CSSM_CSS_IP = 10.10.20.152:9542
CSSM_LOG_PATH =/dm/dmdbms/data #监视器日志文件存放路径
CSSM_LOG_FILE_SIZE = 32#每个日志文件最大32M
CSSM_LOG_SPACE_LIMIT = 0#不限定日志文件总占用空间

os_install.txt

评论
后发表回复

作者

文章

阅读量

获赞

扫一扫
联系客服