一个典型的基于 DMASM 的 DMDSC 一般具备两个 DMDSC 节点,本文增加一个监控节点,使用VMware虚拟机创建共享磁盘,并使用 DMASM 来管理块设备。
磁盘数依据磁盘组数目不同而存在不同的最低磁盘数要求。本示例中 1 块 DCR 磁盘、1 块 VOTE 磁盘、1 个 DMDATA 磁盘组(含 1 块磁盘)和 1 个 DMLOG 磁盘组(含 1 块磁盘),DMARCH 磁盘组(含 1 块磁盘),共 5 块共享磁盘即可。
本示例以两节点为例搭建 DMDSC 环境。规划将 IP 为 node01 的机器作为控制节点。
表12.1 集群规划
从硬件、存储设备、操作系统、网络配置、用户准备、目录规划和磁盘准备这 7 个方面进行准备,下面分别介绍。
IP 地址为 192.168.10.11 和 192.168.10.12和192.168.10.13 的三台台相同配置的机器(4G 内存,1 块网卡)。
节点 | IP | 配置(cpu/内存) | 用途 |
---|---|---|---|
node01 | 192.168.10.11 | 2核/4G | DSC节点1,控制节点 |
node02 | 192.168.10.12 | 2核/4G | DSC节点2,普通节点 |
node03 | 192.168.10.13 | 2核/4G | 节点3,监控节点 |
5 块由VMware虚拟机配置的的共享存储磁盘,提供存储服务。
盘符名称 | 用途 | 大小 |
---|---|---|
asmdisk1.vmdk | DCR | 2G |
asmdisk2.vmdk | VOTE | 2G |
asmdisk3.vmdk | DATA | 10G |
asmdisk4.vmdk | LOG | 4G |
asmdisk5.vmdk | ARCH | 10G |
#window cmd创建共享磁盘
vmware-vdiskmanager.exe -c -s 2000MB -a lsilogic -t 2 "D:\VMOS\ShareDisk\asmdisk1.vmdk"
vmware-vdiskmanager.exe -c -s 2000MB -a lsilogic -t 2 "D:\VMOS\ShareDisk\asmdisk2.vmdk"
vmware-vdiskmanager.exe -c -s 4000MB -a lsilogic -t 2 "D:\VMOS\ShareDisk\asmdisk3.vmdk"
vmware-vdiskmanager.exe -c -s 10000MB -a lsilogic -t 2 "D:\VMOS\ShareDisk\asmdisk4.vmdk"
vmware-vdiskmanager.exe -c -s 5000MB -a lsilogic -t 2 "D:\VMOS\ShareDisk\asmdisk5.vmdk"
#添加到虚拟机上磁盘上
#编辑虚拟机文件.vmx 添加如下,磁盘目录已实际为准
scsi1.virtualDev = "lsilogic"
scsi1.present = "TRUE"
scsi1:0.filename = "D:\VMOS\ShareDisk\asmdisk1.vmdk"
scsi1:0.mode = "independent-persistent"
scsi1:0.present = "TRUE"
scsi1:1.filename = "D:\VMOS\ShareDisk\asmdisk2.vmdk"
scsi1:1.mode = "independent-persistent"
scsi1:1.present = "TRUE"
scsi1:2.filename = "D:\VMOS\ShareDisk\asmdisk3.vmdk"
scsi1:2.mode = "independent-persistent"
scsi1:2.present = "TRUE"
scsi1:3.filename = "D:\VMOS\ShareDisk\asmdisk4.vmdk"
scsi1:3.mode = "independent-persistent"
scsi1:3.present = "TRUE"
scsi1:4.filename = "D:\VMOS\ShareDisk\asmdisk5.vmdk"
scsi1:4.mode = "independent-persistent"
scsi1:4.present = "TRUE"
scsi1.sharedBus = "virtual"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
disk.EnableUUID = "TRUE"
Kylin V10 SP2,同一套 DMDSC 环境要求其所在机器的操作系统相同。
本文ens32 网卡 192.168.80.x 为内网网段,ens35 网卡 192.168.10.x 为外网网段,测试环境建议使用同一网段作为内外网
#id dmdba
id: dmdba: no such user
groupadd -g 1101 dinstall
useradd -u 1101 -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
echo "Dameng123" | passwd --stdin dmdba
mkdir -p /dm/{dmdbms,dmdata,dmarch,dmbak,dmconfig}
chown -R dmdba:dinstall /dm/{dmdbms,dmdata,dmarch,dmbak,dmconfig}
cd /dm/ && ls -ld */
drwxr-xr-x 2 dmdba dinstall 6 12月 25 14:05 dmarch/ #归档
drwxr-xr-x 2 dmdba dinstall 6 12月 25 14:05 dmbak/ #备份
drwxr-xr-x 2 dmdba dinstall 6 12月 25 14:05 dmdata/ #数据
drwxr-xr-x 2 dmdba dinstall 6 12月 25 14:05 dmdbms/ #软件
drwxr-xr-x 2 dmdba dinstall 6 12月 25 14:05 dmdbms/ #配置
达梦数据库的版本:
开发版:不能商用
标准版:小型应用
企业版:生产环境中应用最多的一个版本,三权分立
安全版:在企业版的基础上做了安全特性,增加强访问控制,四权分立。
根据服务器的软件硬件环境及应用需求选择相应安装包。
mount /dev/cdrom /mnt/
mount: /mnt: WARNING: source write-protected, mounted read-only.
#配置静默安装文件
cat /home/dmdba/auto_install.xml
<?xml version="1.0"?>
<DATABASE>
<!--安装数据库语言配置,中文版ZH,英文版EN,不分大小写。不允许为空-->
<LANGUAGE>zh</LANGUAGE>
<!--安装数据库时区配置,默认值+08:00,范围-12:59~+14:00-->
<TIME_ZONE>+08:00</TIME_ZONE>
<!--key文件路径-->
<KEY></KEY>
<!--安装组件类型,默认0,取值范围0、1、2,0表示全部安装,1表示安装服务器,2表示安装客户端-->
<INSTALL_TYPE>0</INSTALL_TYPE>
<!--安装路径,不允许为空-->
<INSTALL_PATH>/dm/dmdbms</INSTALL_PATH>
<!--是否初始化库,取值Y/N、y/n,不允许为空-->
<INIT_DB>N</INIT_DB>
<!--数据库实例参数-->
<DB_PARAMS>
<!--初始化文件dm.ini存放的路径-->
<INI_FILE></INI_FILE>
<!--初始化数据库存放路径,不允许为空-->
<PATH>/dm/dmdata/</PATH>
<!--控制文件路径,文件路径长度不超过256字符-->
<CTL_PATHS >
<CTL_PATH ></CTL_PATH >
<CTL_PATH ></CTL_PATH >
</CTL_PATHS>
<!--日志文件路径,文件路径长度不超过256字符-->
<LOG_PATHS>
<LOG_PATH ></LOG_PATH >
<LOG_PATH ></LOG_PATH >
</LOG_PATHS>
<!--数据文件使用的簇大小(16),可选值:16、32,单位:页-->
<EXTENT_SIZE>16</EXTENT_SIZE>
<!--数据页大小(8),可选值:4、8、16、32,单位:K-->
<PAGE_SIZE>32</PAGE_SIZE>
<!--日志文件大小(256),单位为:M,范围为:64M ~ 2G-->
<LOG_SIZE>2048</LOG_SIZE>
<!--大小敏感(Y),可选值:Y/N,1/0-->
<CASE_SENSITIVE>N</CASE_SENSITIVE>
<!--字符集(0),可选值:0[GB18030],1[UTF-8],2[EUC-KR]-->
<CHARSET>0</CHARSET>
<!--安全特权模式(0),可选值:0[传统],1[bmj]-->
<SEC_PRIV_MODE>0</SEC_PRIV_MODE>
<!--VARCHAR类型长度是否以字符为单位(N),可选值:Y/N,1/0-->
<LENGTH_IN_CHAR></LENGTH_IN_CHAR>
<!--设置SYSDBA密码(SYSDBA),密码长度为9到48-->
<SYSDBA_PWD>Dameng_123</SYSDBA_PWD>
<!--设置SYSAUDITOR密码(SYSAUDITOR),密码长度为9到48-->
<SYSAUDITOR_PWD> Dameng_123</SYSAUDITOR_PWD>
<!--数据库名(DAMENG),不超过128字符-->
<DB_NAME>TESTDB</DB_NAME>
<!--实例名(DMSERVER),不超过128字符-->
<INSTANCE_NAME>TESTDB</INSTANCE_NAME>
<!--监听端口号(5236)-->
<PORT_NUM>5236</PORT_NUM>
<!--设置时区(+08:00)-->
<TIME_ZONE></TIME_ZONE>
<!--页检查模式(0),可选值:0/1/2-->
<PAGE_CHECK></PAGE_CHECK>
<!--设置默认加密算法-->
<EXTERNAL_CIPHER_NAME></EXTERNAL_CIPHER_NAME>
<!--设置默认HASH算法-->
<EXTERNAL_HASH_NAME></EXTERNAL_HASH_NAME>
<!--设置根密钥加密引擎-->
<EXTERNAL_CRYPTO_NAME></EXTERNAL_CRYPTO_NAME>
<!--设置日志文件是否加密(N),可选值:Y/N,1/0-->
<RLOG_ENC_FLAG></RLOG_ENC_FLAG>
<!--设置USBKEY PIN-->
<USBKEY_PIN></USBKEY_PIN>
<!--设置全库加密算法-->
<ENCRYPT_NAME></ENCRYPT_NAME>
<!--设置空格填充模式(0),可选值:0/1-->
<BLANK_PAD_MODE></BLANK_PAD_MODE>
<!--SYSTEM数据文件镜像路径-->
<SYSTEM_MIRROR_PATH></SYSTEM_MIRROR_PATH>
<!--MAIN数据文件镜像-->
<MAIN_MIRROR_PATH></MAIN_MIRROR_PATH>
<!--回滚文件镜像路径-->
<ROLL_MIRROR_PATH></ROLL_MIRROR_PATH>
<!--初始化时设置dm.ini中的MAL_INI(0)-->
<MAL_FLAG></MAL_FLAG>
<!--初始化时设置dm.ini中的ARCH_INI(0)-->
<ARCH_FLAG></ARCH_FLAG>
<!--Mpp系统内的库初始化时设置dm.ini中的mpp_ini(0)-->
<MPP_FLAG></MPP_FLAG>
<!--初始化配置文件(配置文件格式见系统管理员手册)-->
<CONTROL></CONTROL>
<!--是否覆盖所有同名文件(0) 0:不覆盖 1:部分覆盖 2:完全覆盖-->
<AUTO_OVERWRITE></AUTO_OVERWRITE>
<!--是否使用改进的字符类型HASH算法(1)-->
<USE_NEW_HASH></USE_NEW_HASH>
<!--是否是DCP代理模式(0)-->
<DCP_MODE></DCP_MODE>
<!--DCP代理模式下管理端口-->
<DCP_PORT_NUM></DCP_PORT_NUM>
<!--指定初始化过程中生成的日志文件所在路径-->
<ELOG_PATH></ELOG_PATH>
<!--在ECS模式下,AP监听器端口用于协同工作-->
<AP_PORT_NUM></AP_PORT_NUM>
</DB_PARAMS>
<!--是否创建数据库实例服务(Y/N、 y/n),不能为空,非root用户不能创建数据库服务-->
<CREATE_DB_SERVICE>N</CREATE_DB_SERVICE>
<!--是否启动数据库实例服务(Y/N、 y/n),不能为空,非root用户不能创建数据库服务-->
<STARTUP_DB_SERVICE>N</STARTUP_DB_SERVICE>
</DATABASE>
/mnt/DMInstall.bin -q /home/dmdba/auto_install.xml
su - dmdba
cat /home/dmdba/.bash_profile
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/dm/dmdbms/bin"
export DM_HOME="/dm/dmdbms"
export DM_DATA="/dm/dmdata/DAMENG"
export DM_INI="/dm/dmdata/DAMENG/dm.ini"
export PATH=$PATH:$DM_HOME/bin
因为共享磁盘在一个节点配置后,将配置文件拷到另一个节点即可
获取UUID
for d in `fdisk -l |grep /dev/sd | egrep -v "sda|sdb" | sort -k 2 | awk '{print $2":"$3$4}' | sed 's/://' ` do i=`echo $d|awk -F':' '{print $1}'` echo -n $d;echo -n " " udevadm info --name=$i | grep -E '(ID_SERIAL=)' done
# cat uuid.sh
curr=$(cd "$(dirname "$0")";pwd)
rm -f $curr/88-dm-asmdevices.rules
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/asm-disk$i\",OWNER=\"dmdba\",GROUP=\"dinstall\",MODE=\"0660\"">>/etc/udev/rules.d/88-dm-asmdevices.rules
done
# bash uuid.sh
# cat /etc/udev/rules.d/88-dm-asmdevices.rules
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c295b8adac0c36b1af7428628675",SYMLINK+="dm/asm-diskb",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29fd994653c2e4510b018b3ce6b",SYMLINK+="dm/asm-diskc",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29a433dd3d3c9e4a8d746e8cd69",SYMLINK+="dm/asm-diskd",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c2915ac755f697f313e2ce23ed08",SYMLINK+="dm/asm-diske",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29db176f7421bbf13db45984ed8",SYMLINK+="dm/asm-diskf",OWNER="dmdba",GROUP="dinstall",MODE="0660"
#更改为
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29820d234beb5532439186b61ae",SYMLINK+="dm/asm-dmdcr",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c296e6e56524caab47318671e627",SYMLINK+="dm/asm-dmvote",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c2976a820cd66b6470ea583bdcef",SYMLINK+="dm/asm-dmlog",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29880e7ff90674e8478f7929778",SYMLINK+="dm/asm-dmdata",OWNER="dmdba",GROUP="dinstall",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29ab191ded4313ff080a0e5de82",SYMLINK+="dm/asm-dmarch",OWNER="dmdba",GROUP="dinstall",MODE="0660"
#防止重启后权限更改配置99-dm-permissons.rules
# cat /etc/udev/rules.d/99-dm-permissons.rules
PROGRAM="/bin/chown -R dmdba:dinstall /dev/dm/asm-dmvote"
PROGRAM="/bin/chown -R dmdba:dinstall /dev/dm/asm-dmdcr"
PROGRAM="/bin/chown -R dmdba:dinstall /dev/dm/asm-dmlog"
PROGRAM="/bin/chown -R dmdba:dinstall /dev/dm/asm-dmdata"
PROGRAM="/bin/chown -R dmdba:dinstall /dev/dm/asm-dmarch"
/sbin/udevadm control --reload-rules
/sbin/udevadm trigger --type=devices --action=change
blockdev --getsize64 /dev/dm/asm-dmvote
blockdev --getsize64 /dev/dm/asm-dmdcr
blockdev --getsize64 /dev/dm/asm-dmlog
blockdev --getsize64 /dev/dm/asm-dmdata
blockdev --getsize64 /dev/dm/asm-dmarch
在 2 个节点的/dm/dmconfig⽬录下创建,dmdcr_cfg.ini 是格式化 DCR 和 Voting Disk 的配置文件。配置信息包括三类:
集群环境全局信息、集群组信息、以及组内节点信息。 使用 dmasmcmd 工具,
可以根据 dmdcr_cfg.ini 配置文件,格式化 DCR 和 Voting Disk。
[root@node01 ~]# cat /dm/dmconfig/dmdcr_cfg.ini
DCR_N_GRP = 3 ##集群环境有多少个 GROUP,范围:
DCR_VTD_PATH = /dev/dm/asm-dmvote ##规划为 vote 的磁盘
DCR_OGUID = 210715 ## 消息标识,一个组里面只有一个。
[GRP] #新建一个 GROUP
DCR_GRP_TYPE = CSS ##组类型(CSS/ASM/DB)
DCR_GRP_NAME = GRP_CSS ##组名
DCR_GRP_N_EP = 2 ##组内节点个数
DCR_GRP_DSKCHK_CNT = 65 ##磁盘心跳容错时间,单位:秒
[GRP_CSS]
DCR_EP_NAME = CSS0 ##CSS 节点名
DCR_EP_HOST = 192.168.10.11 ##心跳地址
DCR_EP_PORT = 11286 ##CSS 端口
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.10.12
DCR_EP_PORT = 11286
[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = GRP_ASM
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 61
[GRP_ASM]
DCR_EP_NAME = ASM0 ##ASM 节点名,和 dmasvrmal 的 MAL_INST_NAME 一致
DCR_EP_SHM_KEY = 42424 ##共享内存标识
DCR_EP_SHM_SIZE = 1024 ##共享内存大小
DCR_EP_HOST = 192.168.10.11 ##心跳地址
DCR_EP_PORT = 11276 ##ASM 端口
DCR_EP_ASM_LOAD_PATH = /dev/dm
[GRP_ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 42425
DCR_EP_SHM_SIZE = 1024
DCR_EP_HOST = 192.168.10.12
DCR_EP_PORT = 11277
DCR_EP_ASM_LOAD_PATH = /dev/dm
[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_DSC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 57
[GRP_DSC]
DCR_EP_NAME = DSC0 ##实例名,和 dm.ini 的 INSTANCE_NAME 一致
DCR_EP_SEQNO = 0 ##组内序号,不能重复
DCR_EP_PORT = 5236 ##实例端口,和 dm.ini 的 PORT_NUM 一致
DCR_CHECK_PORT = 11256 ##DCR 检查端口
[GRP_DSC]
DCR_EP_NAME = DSC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 11257
[dmdba@DSC1 ~]$ dmasmcmd
DMASMCMD V8
create dcrdisk '/dev/dm/asm-dmdcr' 'dcr'
create votedisk '/dev/dm/asm-dmvote' 'vote'
init dcrdisk '/dev/dm/asm-dmdcr' from '/dm/dmconfig/dmdcr_cfg.ini' identified by 'Dameng123'
init votedisk '/dev/dm/asm-dmvote' from '/dm/dmconfig/dmdcr_cfg.ini'
create asmdisk '/dev/dm/asm-dmdata' 'DATA0'
create asmdisk '/dev/dm/asm-dmlog' 'LOG0'
create asmdisk '/dev/dm/asm-dmarch' 'ARCH0'
在 2 个节点的/dm/dmconfig⽬录下创建 DMASM 的 MAL 配置⽂件(命名为
dmasvrmal.ini),使⽤ DMASM 的所有节点都要配置,内容完全⼀样
[root@node01 ~]# cat /dm/dmconfig/dmasvrmal.ini
[MAL_INST0]
MAL_INST_NAME = ASM0
MAL_HOST = 192.168.10.11 #心跳地址
MAL_PORT = 11266 #MAL 监听端口
[MAL_INST1]
MAL_INST_NAME = ASM1
MAL_HOST = 192.168.10.12
MAL_PORT = 11266
dmdcr.ini 是 dmcss、dmasmsvr、dmasmtool⼯具的输⼊参数。
记录了当前节点序列号以及 DCR 磁盘路径。
在 2 个节点的/dm/dmconfig⽬录下创建 dmdcr.ini 配置⽂件,dmdcr_path 相同,
dmasvrmal.ini ⽂件内容也相同,dmdcr_seqo 分别为 0 和 1,方便排错这里不设置自动拉起
#node01
vi /dm/dmconfig/dmdcr.ini
#node1
DMDCR_PATH = /dev/dm/asm-dmdcr
DMDCR_MAL_PATH = /dm/dmconfig/dmasvrmal.ini #dmasmsvr 使用的 MAL 配置文件路径
DMDCR_SEQNO = 0
DMDCR_AUTO_OPEN_CHECK = 111
DMDCR_ASM_TRACE_LEVEL = 2
#ASM 重启参数,命令行方式启动
##DMDCR_ASM_RESTART_INTERVAL = 60 #CSS 认定 ASM 故障重启的时间
##DMDCR_ASM_STARTUP_CMD = /dm/dmconfig/DmAsmService_DSC0 start
#DB 重启参数,命令行方式启动
##DMDCR_DB_RESTART_INTERVAL = 60 ##CSS 认定 DSC 故障重启的时间,设置为 0 不自动拉起
##DMDCR_DB_STARTUP_CMD = /dm/dmconfig/DmService_DSC0 start
#node02
vi /dm/dmconfig/dmdcr.ini
#node2
DMDCR_PATH = /dev/dm/asm-dmdcr
DMDCR_MAL_PATH = /dm/dmconfig/dmasvrmal.ini #dmasmsvr 使用的 MAL 配置文件路径
DMDCR_SEQNO = 1
DMDCR_AUTO_OPEN_CHECK = 111
DMDCR_ASM_TRACE_LEVEL = 2
#ASM 重启参数,命令行方式启动
##DMDCR_ASM_RESTART_INTERVAL = 60 #CSS 认定 ASM 故障重启的时间
##DMDCR_ASM_STARTUP_CMD = /dm/dmconfig/DmAsmService_DSC0 start
#DB 重启参数,命令行方式启动
##DMDCR_DB_RESTART_INTERVAL = 60 ##CSS 认定 DSC 故障重启的时间,设置为 0 不自动拉起
##DMDCR_DB_STARTUP_CMD = /dm/dmconfig/DmService_DSC0 start
在 2 个节点分别启动 dmcss 命令:
/dm/dmdbms/bin/dmcss DCR_INI=/dm/dmconfig/dmdcr.ini
/dm/dmdbms/bin/dmcss DCR_INI=/dm/dmconfig/dmdcr.ini
在 2 个节点分别启动 dmasmsvr 命令
/dm/dmdbms/bin/dmasmsvr DCR_INI=/dm/dmconfig/dmdcr.ini
/dm/dmdbms/bin/dmasmsvr DCR_INI=/dm/dmconfig/dmdcr.ini
cd /dm/dmdbms/bin/
./dmasmtool DCR_INI=/dm/dmdbms/dsc_config/dmdcr.ini
DMASMTOOL V8
ASM>create diskgroup 'DMLOG' asmdisk '/dev/dm/asm-dmlog'
ASM> create diskgroup 'DMDATA' asmdisk '/dev/dm/asm-dmdata'
ASM>create diskgroup 'DMARCH' asmdisk '/dev/dm/asm-dmarch'
在 2 个节点的/dm/dmconfig⽬录下创建 dminit.ini 配置⽂件,添加如下内容。
在 2 个节点都创建。
DB_NAME = DSC
SYSDBA_PWD = Dameng123
SYSTEM_PATH = +DMDATA/data
SYSTEM = +DMDATA/data/SYSTEM.dbf
SYSTEM_SIZE = 1024
ROLL = +DMDATA/data/ROLL.dbf
ROLL_SIZE = 1024
MAIN = +DMDATA/data/MAIN.dbf
MAIN_SIZE = 1024
CTL_PATH = +DMDATA/data/dm.ctl
CTL_SIZE = 8
LOG_SIZE = 256
DCR_PATH = /dev/dm/asm-dmdcr
DCR_SEQNO = 0
AUTO_OVERWRITE = 1
PAGE_SIZE = 32
EXTENT_SIZE = 16
BLANK_PAD_MODE = 1
[DSC0]
CONFIG_PATH = /dm/dmconfig/dsc0_config
PORT_NUM = 5236
MAL_HOST = 192.168.10.11
MAL_PORT = 11246
LOG_PATH = +DMLOG/DSC0_LOG01.log
LOG_PATH = +DMLOG/DSC0_LOG02.log
[DSC1]
CONFIG_PATH = /dm/dmconfig/dsc1_config
PORT_NUM = 5236
MAL_HOST = 192.168.10.12
MAL_PORT = 11246
LOG_PATH = +DMLOG/DSC1_LOG01.log
LOG_PATH = +DMLOG/DSC1_LOG02.log
/dm/dmdbms/bin/dminit control=/dm/dmconfig/dminit.ini
然后初始化数据库完成之后,将节点 1 上生成的 dsc1_config 文件夹拷贝到节点 2
scp -r /dm/dmconfig/dsc1_config dmdba@192.168.80.12:/dm/dmconfig
最后将节点1 上/dm/dmdbms/dsc_config 目录下的 dsc1_config 文件夹
删掉。
vi /dm/dmconfig/dsc0_config/dm.ini
ARCH_INI = 1
vi /dm/dmconfig/dsc0_config/dmarch.ini
ARCH_WAIT_APPLY = 0
ARCH_LOCAL_SHARE = 1
ARCH_LOCAL_SHARE_CHECK=0
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = +DMARCH/ARCH/DSC0/arch #归档路径不同
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
[ARCHIVE_REMOTE1]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC1
ARCH_INCOMING_PATH = +DMARCH/ARCH/DSC1/arch #归档路径不同
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
vi /dm/dmconfig/dsc1_config/dm.ini
ARCH_INI = 1
vi /dm/dmconfig/dsc1_config/dmarch.ini
ARCH_WAIT_APPLY = 0
ARCH_LOCAL_SHARE = 1
ARCH_LOCAL_SHARE_CHECK=0
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = +DMARCH/ARCH/DSC1/arch #归档路径不同
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
[ARCHIVE_REMOTE1]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC0
ARCH_INCOMING_PATH = +DMARCH/ARCH/DSC0/arch #归档路径不同
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
如果 DMCSS 配置有自动拉起 dmserver 的功能,可以等待 DMCSS 自动拉起实例,不需要手动启动。如果需要手动启动,可参考以下步骤:
/dm/dmdbms/bin/dmserver /dm/dmconfig/dsc0_config/dm.ini dcr_ini=/dm/dmconfig/dmdcr.ini
/dm/dmdbms/bin/dmserver /dm/dmconfig/dsc1_config/dm.ini dcr_ini=/dm/dmconfig/dmdcr.ini
日志可知:出现SYSTEM IS READY.说明数据库实例启动成功。
file dm.key not found, use default license!
version info: develop
DM Database Server 64 V8 03134283968-20230103-178822-20033 startup...
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Database mode = 0, oguid = 0
License will expire on 2024-01-03
hpc_ini_info_pre_check end, code:0
hlck_sys_init, init g_drm_dest:[0, 1]
lbs_sys_init, the length of g_master_map is 1117, fill it use ok_ep_arr:[0, 1], n_ok_ep:2!
check CSS cmd: DCR_LOAD, cmd_seq: 4
check CSS cmd: EP START, cmd_seq: 8
Control Node change from 255 to 0
mal_tsk_process_g_crash_lsn_bro, ep_seqno(0), crash_lsn(0)
mal_tsk_process_g_crash_lsn_bro, ep_seqno(1), crash_lsn(0)
check CSS cmd: EP START2, cmd_seq: 13
Control node start status: OPEN
EP[1] adjust cur_lsn from [37339] to [37499]
file lsn: 0
ndct db load finished
ckpt2_exec_immediately begin.
file_lsn < cur_lsn & no dirty page & in mount status, ignore checkpoint
checkpoint end, 0 pages flushed, used_space[512], free_space[536862208].
checkpoint end, 0 pages flushed, used_space[0], free_space[536862720].
checkpoint end, 0 pages flushed, used_space[0], free_space[536862720].
pseg recv finished
nsvr_startup end.
aud sys init success.
aud rt sys init success.
systables desc init success.
ndct_db_load_info success.
nsvr_process_before_open begin.
nsvr_process_before_open success.
check CSS cmd: EP OPEN, cmd_seq: 17
SYSTEM IS READY.
...
vi /dm/dmdbms/bin/dmcssm.ini
CSSM_OGUID = 210715
CSSM_CSS_IP = 192.168.10.11:11286
CSSM_CSS_IP = 192.168.10.12:11286
CSSM_LOG_PATH = ../log
CSSM_LOG_FILE_SIZE = 512
CSSM_LOG_SPACE_LIMIT = 2048
vi /etc/dm_svc.conf
TIME_ZONE=(+8:00)
LANGUAGE=(cn)
DSCDB=(192.168.80.11:5236,192.168.80.12:5236)
启动手工监控运维用于日常维护和观察集群状况
cd /dm/dmdbms/bin/ ./dmcssm /dm/dmdbms/bin/dmcssm.ini
查看sys_status 字段为 OPEN,vtd_status 字段为 WORKING,active 字段为 TRUE 说明 db 服务正常。至此DSC数据共享集群搭建完成
[root@node01 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm/dmconfig/dmdcr.ini -p CSS
Created symlink /etc/systemd/system/multi-user.target.wants/DmCSSServiceCSS.service → /usr/lib/systemd/system/DmCSSServiceCSS.service.
创建服务(DmCSSServiceCSS)完成
[root@node01 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmconfig/dmdcr.ini -y DmCSSServiceCSS.service -p ASM
Created symlink /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceASM.service → /usr/lib/systemd/system/DmASMSvrServiceASM.service.
创建服务(DmASMSvrServiceASM)完成
[root@node01 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmconfig/dsc0_config/dm.ini -dcr_ini /dm/dmconfig/dmdcr.ini -y DmASMSvrServiceASM.service -p DSC
Created symlink /etc/systemd/system/multi-user.target.wants/DmServiceDSC.service → /usr/lib/systemd/system/DmServiceDSC.service.
创建服务(DmServiceDSC)完成
节点2:
# /dm/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm/dmconfig/dmdcr.ini -p CSS
Created symlink /etc/systemd/system/multi-user.target.wants/DmCSSServiceCSS.service → /usr/lib/systemd/system/DmCSSServiceCSS.service.
创建服务(DmCSSServiceCSS)完成
# /dm/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmconfig/dmdcr.ini -y DmCSSServiceCSS.service -p ASM
Created symlink /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceASM.service → /usr/lib/systemd/system/DmASMSvrServiceASM.service.
创建服务(DmASMSvrServiceASM)完成
# /dm/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmconfig/dsc1_config/dm.ini -dcr_ini /dm/dmconfig/dmdcr.ini -y DmASMSvrServiceASM.service -p DSC
Created symlink /etc/systemd/system/multi-user.target.wants/DmServiceDSC.service → /usr/lib/systemd/system/DmServiceDSC.service.
创建服务(DmServiceDSC)完成
节点3:
[root@DW03 ~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmcssm -cssm_ini /dm/dmdbms/bin/dmcssm.ini -p CSSM
Created symlink /etc/systemd/system/multi-user.target.wants/DmCSSMonitorServiceCSSM.service → /usr/lib/systemd/system/DmCSSMonitorServiceCSSM.service.
创建服务(DmCSSMonitorServiceCSSM)完成
DmCSSServiceCSS start
DmASMSvrServiceASM start
DmServiceDSC start
#节点1
[dmdba@node01 ~]$ DmCSSServiceCSS start
Starting DmCSSServiceCSS: [ OK ]
[dmdba@node01 ~]$ DmASMSvrServiceASM start
Starting DmASMSvrServiceASM: [ OK ]
[dmdba@node01 ~]$ DmServiceDSC start
Starting DmServiceDSC: connnect dmasmtool successfully.
[ OK ]
#节点2
$ DmCSSServiceCSS start
Starting DmCSSServiceCSS: [ OK ]
$ DmASMSvrServiceASM start
Starting DmASMSvrServiceASM: [ OK ]
$ DmServiceDSC start
Starting DmServiceDSC: connnect dmasmtool successfully.
[ OK ]
#节点3
后台服务启动
[dmdba@DW03 ~]$ DmCSSMonitorServiceCSSM start
Starting DmCSSMonitorServiceCSSM: [ OK ]
[dmdba@DW03 ~]$ DmCSSMonitorServiceCSSM status
DmCSSMonitorServiceCSSM (pid 3311) is running.
前台命令启动
/dm/dmdbms/bin/dmcssm /dm/dmdbms/bin/dmcssm.ini
disql V8
SQL>
SQL> select * from v$dsc_ep_info;
行号 EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS
---------- ------- ----------- -------------------- -------------------- ------------ ---------
1 DSC0 0 835502 836424 Control Node OK
2 DSC1 1 839919 840822 Normal Node OK
文章
阅读量
获赞