DMDSC集群安装
1. 环境描述
机器情况:
存储情况:
2. 部署前准备
2.1. 目录规划和创建
创建和规划目录在2个节点都需要执行。
DSC环境搭建的目录:/dmdba/dmdbms
DM执行码和工具存放于目录:/dmdba/dmdbms/bin
配置文件存放于目录:
1节点:/dmdba/config
2节点:/dmdba/config
1节点:
[root@lei1 ~]# su - dmdba
[dmdba@lei1 ~]$ mkdir -p /dmdba/dmdbms
[dmdba@lei1 ~]$ mkdir -p /dmdba/config
2节点:
[root@lei2 ~]# su - dmdba
[dmdba@lei2 ~]$ mkdir -p /dmdba/dmdbms
[dmdba@lei2 ~]$ mkdir -p /dmdba/config
2.2. 共享存储配置
共享存储配置2个节点都需要执行,UDEV绑定裸设备。
1节点:
[root@lei1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1000M 0 part /boot
└─sda2 8:2 0 19G 0 part
├─rhel-root 253:0 0 18G 0 lvm /
└─rhel-swap 253:1 0 1000M 0 lvm [SWAP]
sdb 8:16 0 2G 0 disk
sdc 8:32 0 2G 0 disk
sdd 8:48 0 2G 0 disk
sde 8:64 0 2G 0 disk
sdf 8:80 0 2G 0 disk
sr0 11:0 1 4.2G 0 rom
[root@lei1 ~]# vi /etc/udev/rules.d/90-raw.rules
添加:
ACTION=="add",KERNEL=="sdb",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="sdc",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="sdd",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add",KERNEL=="sde",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add",KERNEL=="sdf",RUN+="/bin/raw /dev/raw/raw5 %N"
KERNEL=="raw[1-5]", OWNER="dmdba", GROUP="dinstall", MODE="660"
[root@lei1 ~]# udevadm trigger --type=devices --action=change
[root@lei1 ~]# ll /dev/raw/raw*
crw-rw---- 1 dmdba dinstall 162, 1 Aug 21 10:03 /dev/raw/raw1
crw-rw---- 1 dmdba dinstall 162, 2 Aug 21 10:03 /dev/raw/raw2
crw-rw---- 1 dmdba dinstall 162, 3 Aug 21 10:03 /dev/raw/raw3
crw-rw---- 1 dmdba dinstall 162, 4 Aug 21 10:03 /dev/raw/raw4
crw-rw---- 1 dmdba dinstall 162, 5 Aug 21 10:03 /dev/raw/raw5
crw-rw---- 1 root disk 162, 0 Aug 21 10:03 /dev/raw/rawctl
若识别不了裸设备,重启服务器重新识别。
2节点:
[root@lei2 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1000M 0 part /boot
└─sda2 8:2 0 19G 0 part
├─rhel-root 253:0 0 18G 0 lvm /
└─rhel-swap 253:1 0 1000M 0 lvm [SWAP]
sdb 8:16 0 2G 0 disk
sdc 8:32 0 2G 0 disk
sdd 8:48 0 2G 0 disk
sde 8:64 0 2G 0 disk
sdf 8:80 0 2G 0 disk
sr0 11:0 1 4.2G 0 rom
[root@lei2 ~]# vi /etc/udev/rules.d/90-raw.rules
添加:
ACTION=="add",KERNEL=="sdb",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="sdc",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="sdd",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add",KERNEL=="sde",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add",KERNEL=="sdf",RUN+="/bin/raw /dev/raw/raw5 %N"
KERNEL=="raw[1-5]", OWNER="dmdba", GROUP="dinstall", MODE="660"
[root@lei1 ~]# udevadm trigger --type=devices --action=change
[root@lei1 ~]# ll /dev/raw/raw*
crw-rw---- 1 dmdba dinstall 162, 1 Aug 21 10:03 /dev/raw/raw1
crw-rw---- 1 dmdba dinstall 162, 2 Aug 21 10:03 /dev/raw/raw2
crw-rw---- 1 dmdba dinstall 162, 3 Aug 21 10:03 /dev/raw/raw3
crw-rw---- 1 dmdba dinstall 162, 4 Aug 21 10:03 /dev/raw/raw4
crw-rw---- 1 dmdba dinstall 162, 5 Aug 21 10:03 /dev/raw/raw5
crw-rw---- 1 root disk 162, 0 Aug 21 10:03 /dev/raw/rawctl
若识别不了裸设备,重启服务器重新识别。
3. 部署步骤
搭建的配置文件分别存放于1节点机器的/dmdba/config和2节点机器的/dmdba/config下。
3.1. dmdcr_cfg.ini文件配置
两个节点上都执行。
节点1:
[dmdba@lei1 ~]$ cd /dmdba/config/
[dmdba@lei1 config]$ vi dmdcr_cfg.ini
添加:
DCR_N_GRP = 3
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635
[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = CSS
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 10.0.10.1
DCR_EP_PORT = 9341
[CSS]
DCR_EP_NAME = CSS2
DCR_EP_HOST = 10.10.10.2
DCR_EP_PORT = 9341
[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = ASM
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 93360
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.10.10.1
DCR_EP_PORT = 9351
DCR_EP_ASM_LOAD_PATH = /dev/raw
[ASM]
DCR_EP_NAME = ASM2
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.10.10.2
DCR_EP_PORT = 9351
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = DSC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[DSC]
DCR_EP_NAME = DSC1
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[DSC]
DCR_EP_NAME = DSC2
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
节点2:
[dmdba@lei1 ~]$ cd /dmdba/config/
[dmdba@lei1 config]$ vi dmdcr_cfg.ini
添加:
DCR_N_GRP = 3
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635
[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = CSS
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 10.0.10.1
DCR_EP_PORT = 9341
[CSS]
DCR_EP_NAME = CSS2
DCR_EP_HOST = 10.10.10.2
DCR_EP_PORT = 9341
[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = ASM
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 93360
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.10.10.1
DCR_EP_PORT = 9351
DCR_EP_ASM_LOAD_PATH = /dev/raw
[ASM]
DCR_EP_NAME = ASM2
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.10.10.2
DCR_EP_PORT = 9351
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = DSC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[DSC]
DCR_EP_NAME = DSC1
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[DSC]
DCR_EP_NAME = DSC2
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
3.2. dmasmcmd创建磁盘组
一台机器上执行。
[dmdba@lei1 ~]$ dmasmcmd
dmasmcmd V8
ASM>create dcrdisk '/dev/raw/raw1' 'dcr'
[TRACE]The ASM initialize dcrdisk /dev/raw/raw1 to name DMASMdcr
Used time: 10.960(ms).
ASM>create votedisk '/dev/raw/raw2' 'vote'
[TRACE]The ASM initialize votedisk /dev/raw/raw2 to name DMASMvote
Used time: 9.241(ms).
ASM>create asmdisk '/dev/raw/raw3' 'LOG0'
[TRACE]The ASM initialize asmdisk /dev/raw/raw3 to name DMASMLOG0
Used time: 9.483(ms).
ASM>create asmdisk '/dev/raw/raw4' 'DATA0'
[TRACE]The ASM initialize asmdisk /dev/raw/raw4 to name DMASMDATA0
Used time: 9.574(ms).
ASM>create asmdisk '/dev/raw/raw5' 'ARCH0'
[TRACE]The ASM initialize asmdisk /dev/raw/raw5 to name DMASMARCH0
Used time: 9.909(ms).
ASM>init dcrdisk '/dev/raw/raw1' from '/dmdba/config/dmdcr_cfg.ini' identified by '123456'
[TRACE]DG 126 alloc extent for inode (0, 0, 1)
[TRACE]DG 126 alloc 4 extents for 0xfe000002 (0, 0, 2)->(0, 0, 5)
Used time: 22.060(ms).
ASM>init votedisk '/dev/raw/raw2' from '/dmdba/config/dmdcr_cfg.ini'
[TRACE]DG 125 alloc extent for inode (0, 0, 1)
[TRACE]DG 125 alloc 4 extents for 0xfd000002 (0, 0, 2)->(0, 0, 5)
Used time: 9.975(ms).
3.3. dmasvrmal.ini文件配置
两个节点该文件配置一样,只需一台机器上配置好scp过去即可。
[dmdba@lei1 ~]$ cd /dmdba/config/
[dmdba@lei1 config]$ vi dmasvrmal.ini
添加:
[MAL_INST1]
MAL_INST_NAME = ASM1
MAL_HOST = 10.10.10.1
MAL_PORT = 7236
[MAL_INST2]
MAL_INST_NAME = ASM2
MAL_HOST = 10.10.10.2
MAL_PORT = 7236
[dmdba@lei1 config]$ scp dmasvrmal.ini lei2:/dmdba/config/
3.4. dmdcr.ini文件配置
2个节点都要执行。
1节点:
[dmdba@lei1 ~]$ cd /dmdba/config/
[dmdba@lei1 config]$ vi dmdcr.ini
添加:
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/dmdba/config/dmasvrmal.ini
DMDCR_SEQNO = 0
DMDCR_ASM_RESTART_INTERVAL = 10
DMDCR_ASM_STARTUP_CMD = /dmdba/dmdbms/bin/dmasmsvr dcr_ini=/dmdba/config/dmdcr.ini
DMDCR_DB_RESTART_INTERVAL = 30
DMDCR_DB_STARTUP_CMD = /dmdba/dmdbms/bin/dmserver path=/dmdba/config/dsc1/dm.ini dcr_ini=/dmdba/config/dmdcr.ini
2节点:
[dmdba@lei2 ~]$ cd /dmdba/config/
[dmdba@lei2 config]$ vi dmdcr.ini
添加:
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/dmdba/config/dmasvrmal.ini
DMDCR_SEQNO = 1
DMDCR_ASM_RESTART_INTERVAL = 10
DMDCR_ASM_STARTUP_CMD = /dmdba/dmdbms/bin/dmasmsvr dcr_ini=/dmdba/config/dmdcr.ini
DMDCR_DB_RESTART_INTERVAL = 30
DMDCR_DB_STARTUP_CMD = /dmdba/dmdbms/bin/dmserver path=/dmdba/config/dsc2/dm.ini dcr_ini=/dmdba/config/dmdcr.ini
两个节点的DMDCR_SEQNO参数不能相同要唯一,DMDCR_DB_STARTUP_CMD 中启动脚本路径和配置文件路径要配置准确。如果不配置css自动启动asm和db则需要配置 DMDCR_ASM_RESTART_INTERVAL 和DMDCR_DB_RESTART_INTERVAL 为 0。
3.5. 注册DMCSS服务
两个节点都要执行。
1节点:
[root@lei1 ~]# cd /dmdba/dmdbms/script/root
[root@lei1 root]# ./dm_service_installer.sh -t dmcss -dcr_ini /dmdba/config/dmdcr.ini -p dsc1
Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicedsc1.service to /usr/lib/systemd/system/DmCSSServicedsc1.service.
创建服务(DmCSSServicedsc1)完成
2节点:
[root@lei2 ~]# cd /dmdba/dmdbms/script/root
[root@lei2 root]# ./dm_service_installer.sh -t dmcss -dcr_ini /dmdba/config/dmdcr.ini -p dsc2
Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicedsc2.service to /usr/lib/systemd/system/DmCSSServicedsc2.service.
创建服务(DmCSSServicedsc2)完成
3.6. 启动DMCSS
启动DMCSS服务
[dmdba@lei1]$ DmCSSServicedsc1 start
Starting DmCSSServicedsc1: [ OK ]
[dmdba@lei2]$ DmCSSServicedsc2 start
Starting DmCSSServicedsc1: [ OK ]
3.7. 创建ASM磁盘组
任一节点执行即可。
[dmdba@lei1 ~]$ cd /dmdba/dmdbms/bin
[dmdba@lei1 bin]$ ./dmasmtool dcr_ini=/dmdba/config/dmdcr.ini
DMASMTOOL V8
ASM>create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3'
Used time: 17.197(ms).
ASM>create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4'
Used time: 16.196(ms).
ASM>create diskgroup 'DMARCH' asmdisk '/dev/raw/raw5'
Used time: 15.350(ms).
3.8. 初始化共享存储集群实例
先在1节点执行,再将1节点初始化实例后生成的实例2配置文件scp至2节点。
[dmdba@lei1 ~]$ cd /dmdba/config/
[dmdba@lei1 config]$ vi 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 = 256
dcr_path = /dev/raw/raw1
dcr_seqno = 0
auto_overwrite = 1
[DSC1]
config_path = /dmdba/config/dsc1
port_num = 5236
mal_host = 10.10.10.1
mal_port = 9236
log_path = +DMLOG/log/DSC1_log01.log
log_path = +DMLOG/log/DSC1_log02.log
[DSC2]
config_path = /dmdba/config/dsc2
port_num = 5236
mal_host = 10.10.10.2
mal_port = 9236
log_path = +DMLOG/log/DSC2_log01.log
log_path = +DMLOG/log/DSC2_log02.log
[dmdba@lei1 ~]$ cd /dmdba/dmdbms/bin
[dmdba@lei1 bin]$ ./dminit control=/dmdba/config/dminit.ini
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2025-07-03
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: +DMLOG/log/DSC1_log01.log
log file path: +DMLOG/log/DSC1_log02.log
log file path: +DMLOG/log/DSC2_log01.log
log file path: +DMLOG/log/DSC2_log02.log
write to dir [+DMDATA/data/DSC].
create dm database success. 2024-08-21 11:54:48
[dmdba@lei1 bin]$ cd /dmdba/config/
[dmdba@lei1 config]$ ll
total 16
-rw-rw-r-- 1 dmdba dmdba 256 Aug 21 10:20 dmasvrmal.ini
-rw-rw-r-- 1 dmdba dmdba 1283 Aug 21 10:13 dmdcr_cfg.ini
-rw-rw-r-- 1 dmdba dmdba 353 Aug 21 11:30 dmdcr.ini
-rw-rw-r-- 1 dmdba dmdba 762 Aug 21 11:54 dminit.ini
drwxrwxr-x 2 dmdba dmdba 87 Aug 21 11:54 dsc1
drwxrwxr-x 2 dmdba dmdba 55 Aug 21 11:54 dsc2
[dmdba@lei1 config]$
[dmdba@lei1 config]$ scp -r dsc2/ lei2:/dmdba/config/
拷贝完成后2节点CSS会自动启动2节点数据库实例。
3.9. 配置集群监视器
[dmdba@lei1 ~]$ cd /dmdba/config/
[dmdba@lei1 config]$ vi dmcssm.ini
添加:
CSSM_OGUID = 63635
CSSM_CSS_IP = 10.10.10.1:9341
CSSM_CSS_IP = 10.10.10.2:9341
CSSM_LOG_PATH =/dmdba/dmdbms/log
CSSM_LOG_FILE_SIZE = 32
CSSM_LOG_SPACE_LIMIT = 0
3.10. 启动集群监视器
[dmdba@lei1 ~]$ cd /dmdba/dmdbms/bin
[dmdba@lei1 bin]$ ./dmcssm ini_path=/dmdba/config/dmcssm.ini