/home/dmdba/dmdsc/data/DSC01
/home/dmdba/dmdsc/data/DSC01/dmdcr_cfg.ini
/home/dmdba/dmdsc/data/DSC01/dmasvrmal.ini
/home/dmdba/dmdsc/data/DSC01/dmdcr.ini
/home/dmdba/dmdsc/data/DSC01/dminit.ini
/home/dmdba/dmdsc/data/DSC02
/home/dmdba/dmdsc/data/DSC02/dmdcr_cfg.ini
/home/dmdba/dmdsc/data/DSC02/dmasvrmal.ini
/home/dmdba/dmdsc/data/DSC02/dmdcr.ini
/home/dmdba/dmdsc/data/DSC02/dminit.ini
## 1,2
systemctl start multipathd
## CSS1(DSC1-terminal1)
cd /home/dmdba/dmdbms/bin
./dmcss dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini
## CSS2(DSC2-terminal2)
cd /home/dmdba/dmdbms/bin
./dmcss dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini
## asvr1(DSC1-terminal3)
cd /home/dmdba/dmdbms/bin
./dmasmsvrm dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini
## asvr2(DSC2-terminal4)
cd /home/dmdba/dmdbms/bin
./dmasmsvrm dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini
## dmserver1(DSC1-terminal5)
/home/dmdba/dmdbms/bin/dmserver dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini /home/dmdba/dmdsc/data/DSC01/DSC01_conf/dm.ini
## dmserver2(DSC2-terminal6)
/home/dmdba/dmdbms/bin/dmserver dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini /home/dmdba/dmdsc/data/DSC02/DSC02_conf/dm.ini
## dmasmcmdm(DSC1-terminal7)
cd /home/dmdba/dmdbms/bin/
./dmasmcmdm
## Monitor('Dm-Kylin-SQL'-terminal8)
dmcssm ini_path=/home/dmdba/dmdsc/data/dmcssm.ini
## DISQL1('Dm-Kylin-SQL'-terminal9)
disql SYSDBA/SYSDBA@192.168.0.101:7236
## DISQL2('Dm-Kylin-SQL'-terminal10)
disql SYSDBA/SYSDBA@192.168.0.101:7237
DISSQL>DMSERVER>DMASMSVR>DMCSS
vboxmanage createmedium disk --filename "./Shared_Storage/system.vdi" --size 1024 --format VDI --variant Fixed
vboxmanage createmedium disk --filename "./Shared_Storage/data.vdi" --size 4096 --format VDI --variant Fixed
vboxmanage createmedium disk --filename "./Shared_Storage/log.vdi" --size 2048 --format VDI --variant Fixed
VBoxManage modifyhd "./Shared_Storage/system.vdi" --type shareable
VBoxManage modifyhd "./Shared_Storage/data.vdi" --type shareable
VBoxManage modifyhd "./Shared_Storage/log.vdi" --type shareable
查看所有的medium:
VBoxManage list hdds | select-string "Shared"
<br>
删除medium文件:VBoxManage closemedium disk "D:\doc\DM\DSC\Shared_Storage\system.vdi" --delete
vboxmanage showvminfo Dm-Kylin-DSC-1 --details
Storage Controllers:
#0: 'IDE', Type: PIIX4, Instance: 0, Ports: 2 (max 2), Bootable
Port 1, Unit 0: UUID: a719174c-f995-47db-b0cb-1142d692a991
Location: "D:\doc\VirtualBox VMS\dm8_20240712_x86_rh7_64.iso"
#1: 'SATA', Type: IntelAhci, Instance: 0, Ports: 2 (max 30), Bootable
Port 0, Unit 0: UUID: 1d52714c-edec-4fa6-94e5-507fcbf8da12
Location: "D:\doc\VirtualBox VMS\DSC\Dm-Kylin-DSC-1\Dm-Kylin-DSC-1.vdi"
- 现有的SATA Storagectl 的 name 是 'SATA'
- storage device 是被 controller 管理的
vboxmanage storageattach Dm-Kylin-DSC-1 --storagectl "SATA" --port 1 --type hdd --device 0 --medium "./Shared_Storage/system.vdi"
vboxmanage storageattach Dm-Kylin-DSC-1 --storagectl "SATA" --port 2 --type hdd --device 0 --medium "./Shared_Storage/log.vdi"
vboxmanage storageattach Dm-Kylin-DSC-1 --storagectl "SATA" --port 3 --type hdd --device 0 --medium "./Shared_Storage/data.vdi"
vboxmanage showvminfo Dm-Kylin-DSC-2 --details
Storage Controllers:
#0: 'IDE', Type: PIIX4, Instance: 0, Ports: 2 (max 2), Bootable
Port 1, Unit 0: UUID: a719174c-f995-47db-b0cb-1142d692a991
Location: "D:\doc\VirtualBox VMS\dm8_20240712_x86_rh7_64.iso"
#1: 'SATA', Type: IntelAhci, Instance: 0, Ports: 2 (max 30), Bootable
Port 0, Unit 0: UUID: 2b651801-8460-4260-b87d-4abc80af4fb1
Location: "D:\doc\VirtualBox VMS\DSC\Dm-Kylin-DSC-2\Dm-Kylin-DSC-2.vdi"
现有的SATA Storagectl 的 name 是 'SATA'
vboxmanage storageattach Dm-Kylin-DSC-2 --storagectl "SATA" --port 1 --type hdd --device 0 --medium "./Shared_Storage/system.vdi"
vboxmanage storageattach Dm-Kylin-DSC-2 --storagectl "SATA" --port 2 --type hdd --device 0 --medium "./Shared_Storage/log.vdi"
vboxmanage storageattach Dm-Kylin-DSC-2 --storagectl "SATA" --port 3 --type hdd --device 0 --medium "./Shared_Storage/data.vdi"
移除storage的attach状态:
vboxmanage storageattach Dm-Kylin-DSC-2 --storagectl "SATA" --port 1 --type hdd --device 0 --medium none
查找vm 绑定的medium:vboxmanage showvminfo Dm-Kylin-DSC-1 | sls 'UUID' -Context 1
vboxmanage startvm --type headless Dm-Kylin-DSC-1 Dm-Kylin-DSC-2
关机
VBoxManage controlvm Dm-Kylin-DSC-1 poweroff
HOST | IP | ALIAS |
---|---|---|
Dm-Kylin-DSC-1 | 192.168.0.101 | DSC01/DSC1 |
Dm-Kylin-DSC-2 | 192.168.0.102 | DSC02/DSC2 |
nmcli g hostname Dm-Kylin-DSC-1 nmcli con mod enp0s3 ipv4.addresses 192.168.0.101/24 nmcli con mod enp0s3 ipv4.method manual nmcli con mod enp0s3 connection.autoconnect yes nmcli dev reapply enp0s3
nmcli g hostname Dm-Kylin-DSC-2 nmcli con mod enp0s3 ipv4.addresses 192.168.0.102/24 nmcli con mod enp0s3 ipv4.method manual nmcli con mod enp0s3 connection.autoconnect yes nmcli dev reapply enp0s3
KylinOS 自带MultiPath 但是可以查看一下状态,如果没有有可能没有启动,需要启动一下。
默认情况下不是enable的
#root
systemctl status multipathd
systemctl start multipathd
通过大小分辨磁盘种类
[root@Dm-Kylin-DSC-1 ~]# fdisk -l | grep mapper
Disk /dev/mapper/klas-root:16.93 GiB,18182307840 字节,35512320 个扇区
Disk /dev/mapper/klas-swap:2.06 GiB,2214592512 字节,4325376 个扇区
Disk /dev/mapper/VBOX_HARDDISK_VB8bce59d8-d846e4c5:1 GiB,1073741824 字节,2097152 个扇区
Disk /dev/mapper/VBOX_HARDDISK_VBb4090a73-54e458a9:2 GiB,2147483648 字节,4194304 个扇区
Disk /dev/mapper/VBOX_HARDDISK_VBe34d4271-7cb7209d:4 GiB,4294967296 字节,8388608 个扇区
[root@Dm-Kylin-DSC-2 ~]# fdisk -l | grep mapper
Disk /dev/mapper/klas-root:16.93 GiB,18182307840 字节,35512320 个扇区
Disk /dev/mapper/klas-swap:2.06 GiB,2214592512 字节,4325376 个扇区
Disk /dev/mapper/VBOX_HARDDISK_VB8bce59d8-d846e4c5:1 GiB,1073741824 字节,2097152 个扇区
Disk /dev/mapper/VBOX_HARDDISK_VBb4090a73-54e458a9:2 GiB,2147483648 字节,4194304 个扇区
Disk /dev/mapper/VBOX_HARDDISK_VBe34d4271-7cb7209d:4 GiB,4294967296 字节,8388608 个扇区
如果multipathd服务没有启动,新创建加入的那些盘是不会被展示的。
[root@Dm-Kylin-DSC-1 ~]# for file in /dev/mapper/*; do echo $file && /usr/lib/udev/scsi_id -g -u $file; done
/dev/mapper/control
/dev/mapper/klas-root
1ATA_VBOX_HARDDISK_VB1d52714c-12daf8cb
/dev/mapper/klas-swap
1ATA_VBOX_HARDDISK_VB1d52714c-12daf8cb
/dev/mapper/VBOX_HARDDISK_VB8bce59d8-d846e4c5
1ATA_VBOX_HARDDISK_VB8bce59d8-d846e4c5
/dev/mapper/VBOX_HARDDISK_VBb4090a73-54e458a9
1ATA_VBOX_HARDDISK_VBb4090a73-54e458a9
/dev/mapper/VBOX_HARDDISK_VBe34d4271-7cb7209d
1ATA_VBOX_HARDDISK_VBe34d4271-7cb7209d
[root@Dm-Kylin-DSC-2 ~]# for file in /dev/mapper/*; do echo $file && /usr/lib/udev/scsi_id -g -u $file; done
/dev/mapper/control
/dev/mapper/klas-root
1ATA_VBOX_HARDDISK_VB2b651801-b14faf80
/dev/mapper/klas-swap
1ATA_VBOX_HARDDISK_VB2b651801-b14faf80
/dev/mapper/VBOX_HARDDISK_VB8bce59d8-d846e4c5
1ATA_VBOX_HARDDISK_VB8bce59d8-d846e4c5
/dev/mapper/VBOX_HARDDISK_VBb4090a73-54e458a9
1ATA_VBOX_HARDDISK_VBb4090a73-54e458a9
/dev/mapper/VBOX_HARDDISK_VBe34d4271-7cb7209d
1ATA_VBOX_HARDDISK_VBe34d4271-7cb7209d
由上图可知 多个mapper可能对应同一个实际硬盘,具体要看UUID 来判断
mkdir /dev_dsc chown -R dmdba.dmdba /dev_dsc
HOST | TYPE | MapperName | UUID |
---|---|---|---|
Dm-Kylin-DSC-1 | system | VBOX_HARDDISK_VB8bce59d8-d846e4c5 | 1ATA_VBOX_HARDDISK_VB8bce59d8-d846e4c5 |
Dm-Kylin-DSC-2 | system | VBOX_HARDDISK_VB8bce59d8-d846e4c5 | 1ATA_VBOX_HARDDISK_VB8bce59d8-d846e4c5 |
Dm-Kylin-DSC-1 | log | VBOX_HARDDISK_VBb4090a73-54e458a9 | 1ATA_VBOX_HARDDISK_VBb4090a73-54e458a9 |
Dm-Kylin-DSC-2 | log | VBOX_HARDDISK_VBb4090a73-54e458a9 | 1ATA_VBOX_HARDDISK_VBb4090a73-54e458a9 |
Dm-Kylin-DSC-1 | data | VBOX_HARDDISK_VBe34d4271-7cb7209d | 1ATA_VBOX_HARDDISK_VBe34d4271-7cb7209d |
Dm-Kylin-DSC-2 | data | VBOX_HARDDISK_VBe34d4271-7cb7209d | 1ATA_VBOX_HARDDISK_VBe34d4271-7cb7209d |
cd /dev_dsc
ln -s /dev/mapper/VBOX_HARDDISK_VB8bce59d8-d846e4c5 system
ln -s /dev/mapper/VBOX_HARDDISK_VBb4090a73-54e458a9 log
ln -s /dev/mapper/VBOX_HARDDISK_VBe34d4271-7cb7209d data
chown -R dmdba.dmdba /dev_dsc
chown dmdba.dmdba -R /dev/mapper/VBOX*
其中
chown dmdba.dmdba -R /dev/mapper/VBOX*
每次重启要执行
### Dm-Kylin-DSC-1
su - dmdba
mkdir -p /home/dmdba/dmdsc/data/DSC01
### Dm-Kylin-DSC-2
su - dmdba
mkdir -p /home/dmdba/dmdsc/data/DSC02
DCR_N_GRP= 3 #集群环境包括多少个组(即包括多少个集群),取值范围1~16。例如:配置了1个DMCSS集群、1个DMASM集群、1个DMDSC集群,则DCR_N_GRP=3。目前仅支持3个组
DCR_DISK_LOAD_PATH = /dev_dsc #ASM磁盘扫描路径,Linux下一般为/dev/DMDATA,或者/dev_DMDATA/。支持多路径配置以,进行分隔,
DCR_OGUID= 509317566 #消息标识,DMCSSM登录DMCSS消息校验用。取值范围:正整数
[GRP]
DCR_GRP_TYPE = CSS #组类型:CSS、ASM或DB。分别表示DMCSS集群、DMASM集群和DMDSC集群
DCR_GRP_NAME = GRP_CSS ## 要和下面配置的[]内匹配
DCR_GRP_N_EP = 2 #组内节点个数N,最大8
DCR_GRP_DSKCHK_CNT = 60
[GRP_CSS]
DCR_EP_NAME = CSS0
DCR_EP_HOST = 192.168.0.101
DCR_EP_PORT = 7936
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.0.102
DCR_EP_PORT = 7937
[GRP]
DCR_GRP_TYPE= ASM
DCR_GRP_NAME= GRP_ASM
DCR_GRP_N_EP= 2
DCR_GRP_DSKCHK_CNT= 60 #磁盘心跳机制,容错时间,单位秒,缺省60S,取值范围5~600
[GRP_ASM]
DCR_EP_NAME= ASM0
DCR_EP_SHM_KEY= 54730
DCR_EP_SHM_SIZE= 512
DCR_EP_HOST= 192.168.0.101
DCR_EP_PORT= 7536
[GRP_ASM]
DCR_EP_NAME= ASM1
DCR_EP_SHM_KEY= 54731
DCR_EP_SHM_SIZE= 512
DCR_EP_HOST= 192.168.0.102
DCR_EP_PORT= 7537
[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= DSC01
DCR_EP_SEQNO= 0 #组内序号,CSS/ASM不能配置,自动分配,DB可以配置,0 ~ n_ep -1,组内不能重复,如不配置则自动分配
DCR_EP_PORT= 7236
[GRP_DSC]
DCR_EP_NAME= DSC02
DCR_EP_SEQNO= 1
DCR_EP_PORT= 7237
nano /home/dmdba/dmdsc/data/DSC01/dmdcr_cfg.ini
nano /home/dmdba/dmdsc/data/DSC02/dmdcr_cfg.ini
加入上方配置
DMASMCMDM : 使用说明, 应用dmasmcmd在bin目录下.
只用在一台主机 root 下执行dmasmcmdm
cd /home/dmdba/dmdbms/bin/
./dmasmcmdm # 进入交互式命令行
create dcrvdisk '/dev_dsc/system' 'dcrv'
create asmdisk '/dev_dsc/data' 'data'
create asmdisk '/dev_dsc/log' 'log'
CREATE SYSTEM DISKGROUP ASMDISK '/dev_dsc/system' ATTRIBUTE CONFIG='/home/dmdba/dmdsc/data/DSC01/dmdcr_cfg.ini', passwd='dmdba'
只用在一台机器上执行,我这是在Dm-Kylin-DSC-1上执行的.
ASM>CREATE SYSTEM DISKGROUP ASMDISK '/dev_dsc/system' ATTRIBUTE CONFIG='/home/dmdba/dmdsc/data/DSC01/dmdcr_cfg.ini', passwd='dmdba'
[/dev_dsc/system]: used DCRV disk, name:[DMASMdcrv], size:[1023 AU]
Do you want to continue?: (y/n)y
Used time: 00:00:37.103.
一个 AU 占用 1MB 存储空间
可以脚本执行
DMASMCMDM SCRIPT_FILE=asmcmd.txt
/home/dmdba/dmdsc/data/DSC01/dmasvrmal.ini
加入
[MAL_INST1]
MAL_INST_NAME= ASM0
MAL_HOST= 192.168.0.101
MAL_PORT= 7436
[MAL_INST2]
MAL_INST_NAME= ASM1
MAL_HOST= 192.168.0.102
MAL_PORT= 7437
在DSC-2上同样操作
nano /home/dmdba/dmdsc/data/DSC02/dmasvrmal.ini
IPV6 多块 网卡: 参考这个
DMDCR.INI 是 DMCSS、DMASMSVR、DMASMTOOL 等工具的输入参数。记录了当前节点序列号以及 DCR 磁盘路径。参数说明
nano /home/dmdba/dmdsc/data/DSC01/dmdcr.ini
DMDCR_PATH= /dev_dsc
DMDCR_SEQNO= 0 #记录当前节点序号(用来获取ASM登录信息)
DMDCR_MAL_PATH= /home/dmdba/dmdsc/data/DSC01/dmasvrmal.ini
DMDCR_ASM_RESTART_INTERVAL= 0 #如果DMASM节点的active标记仍然为FALSE,则DMCSS会执行自动拉起。如果配置为0,则不会执行自动拉起操作,缺省为60s
DMDCR_ASM_STARTUP_CMD= /home/dmdba/dmdbms/bin/dmasmsvrm dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini #DMCSS认定DMASM节点故障后,执行自动拉起的命令串
DMDCR_DB_RESTART_INTERVAL= 0
DMDCR_DB_STARTUP_CMD= /home/dmdba/dmdbms/bin/dmserver path=/home/dmdba/dmdsc/data/DSC01/DSC01_conf/dm.ini dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini
DMDCR_IPC_CONTROL = 2
DMDCR_LINK_CHECK_IP=192.168.0.177
# DMDCR_LINK_CHECK_IP 内网和DSC同网段,测试网络联通
默认安装的dmdbms 所以和 dmdsc目录的互转有点不方便
sudo setcap cap_net_raw,cap_net_admin=eip /home/dmdba/dmdbms/bin/dmserver
sudo setcap cap_net_raw,cap_net_admin=eip /home/dmdba/dmdbms/bin/dmasmsvrm
sudo getcap /home/dmdba/dmdbms/bin/dmserver
查询是否授予成功
nano /home/dmdba/dmdsc/data/DSC02/dmdcr.ini
DMDCR_PATH= /dev_dsc
DMDCR_SEQNO= 1 #记录当前节点序号(用来获取ASM登录信息)
DMDCR_MAL_PATH= /home/dmdba/dmdsc/data/DSC02/dmasvrmal.ini
DMDCR_ASM_RESTART_INTERVAL= 0
DMDCR_ASM_STARTUP_CMD= /home/dmdba/dmdbms/bin/dmasmsvrm dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini
DMDCR_DB_RESTART_INTERVAL= 0
DMDCR_DB_STARTUP_CMD= /home/dmdba/dmdbms/bin/dmserver path=/home/dmdba/dmdsc/data/DSC02/DSC02_conf/dm.ini dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini
DMDCR_IPC_CONTROL = 2
DMDCR_LINK_CHECK_IP=192.168.0.177
# DMDCR_LINK_CHECK_IP 内网和DSC同网段,测试网络联通
sudo setcap cap_net_raw,cap_net_admin=eip /home/dmdba/dmdbms/bin/dmserver
sudo setcap cap_net_raw,cap_net_admin=eip /home/dmdba/dmdbms/bin/dmasmsvrm
DMCSS: 达梦集群同步服务(Dameng Cluster Synchronization Services).在 DMASM 集群或 DMDSC 集群中,每个节点都需要配置一个 DMCSS 服务。这些 DMCSS 服务自身也构成一个集群,DMCSS 集群中负责监控、管理整个 DMASM 集群和 DMDSC 集群的节点称为控制节点(Control Node),其他 DMCSS 节点称为普通节点(Normal Node)。DMCSS 普通节点不参与 DMASM 集群和 DMDSC 集群管理,当 DMCSS 控制节点故障时,会从活动的普通节点中重新选取一个 DMCSS 控制节点。
[root@Dm-Kylin-DSC-1 DSC01]# cd /home/dmdba/dmdbms/bin/
[root@Dm-Kylin-DSC-1 bin]# ./dmcss dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini
DMCSS V8
DMCSS IS READY
[2024-12-11 16:25:02:248] [CSS]: 设置EP CSS0[0]为控制节点
[root@Dm-Kylin-DSC-1 DSC01]# cd /home/dmdba/dmdbms/bin/
[root@Dm-Kylin-DSC-1 bin]# ./dmcss dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini
DMCSS V8
DMCSS IS READY
[2024-12-11 16:25:02:248] [CSS]: 设置EP CSS0[0]为控制节点
DMASMSVRM 是 DMASM 服务器,负责管理 DMASM 文件系统。每个提供 DMASM 服务的节点都必须启动一个 DMASMSVRM 服务器,这些 DMASMSVRM 服务器一起组成 DMASMSVRM 集群。
cd /home/dmdba/dmdbms/bin/
./dmasmsvrm dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini
cd /home/dmdba/dmdbms/bin/
./dmasmsvrm dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini
DMCSS V8
DMCSS IS READY
[2024-12-11 16:25:02:248] [CSS]: 设置EP CSS0[0]为控制节点
[2024-12-11 16:35:11:710] [ASM]: 设置EP ASM0[0]为控制节点
[2024-12-11 16:35:11:788] [ASM]: 设置命令[START NOTIFY], 目标站点 ASM0[0], 命令序号[2]
[2024-12-11 16:35:13:894] [ASM]: 设置命令[EP START], 目标站点 ASM0[0], 命令序号[3]
[2024-12-11 16:35:14:003] [ASM]: 设置命令[NONE], 目标站点 ASM0[0], 命令序号[0]
[2024-12-11 16:35:14:112] [ASM]: 设置命令[EP START], 目标站点 ASM1[1], 命令序号[5]
[2024-12-11 16:35:14:220] [ASM]: 设置命令[NONE], 目标站点 ASM1[1], 命令序号[0]
[2024-12-11 16:35:14:328] [ASM]: 设置命令[EP OPEN], 目标站点 ASM0[0], 命令序号[8]
[2024-12-11 16:35:14:331] [ASM]: 设置命令[EP OPEN], 目标站点 ASM1[1], 命令序号[9]
[2024-12-11 16:35:14:439] [ASM]: 设置命令[NONE], 目标站点 ASM0[0], 命令序号[0]
[2024-12-11 16:35:14:442] [ASM]: 设置命令[NONE], 目标站点 ASM1[1], 命令序号[0]
[2024-12-11 16:35:14:444] [ASM]: 设置命令[EP REAL OPEN], 目标站点 ASM0[0], 命令序号[11]
[2024-12-11 16:35:14:446] [ASM]: 设置命令[EP REAL OPEN], 目标站点 ASM1[1], 命令序号[12]
[2024-12-11 16:35:15:509] [ASM]: 设置命令[NONE], 目标站点 ASM0[0], 命令序号[0]
[2024-12-11 16:35:15:513] [ASM]: 设置命令[NONE], 目标站点 ASM1[1], 命令序号[0]
DSC-1
cd /home/dmdba/dmdbms/bin/
./dmasmtoolm dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini
ASM>lsdsk
group SYS(id:126 au_size:1MB) include 1 disks......
NO.1 disk :
id: 0
name: DMASMdcrv
failgroup: SYS_FGRP0
partner:
path: /dev_dsc/system
status: NORMAL
size: 1023AU
free_size: 1008AU
free_rate: 98.5%
create_time: 2024-12-11 14:42:43
modify_time: 2024-12-11 14:42:43
belong group: SYS
total 2 disks unused......
NO.1 : name: DMASMlog, path: /dev_dsc/log, size: 2047M
NO.2 : name: DMASMdata, path: /dev_dsc/data, size: 4095M
Used time: 20.728(ms).
磁盘组命令: 参数说明
#创建DATA磁盘组
ASM>CREATE DISKGROUP DMDATA EXTERNAL REDUNDANCY FAILGROUP 'data1' asmdisk '/dev_dsc/data' ATTRIBUTE AU_SIZE=32, REDO_SIZE=128
#创建LOG磁盘组
ASM>CREATE DISKGROUP DMLOG EXTERNAL REDUNDANCY FAILGROUP 'data1' asmdisk '/dev_dsc/log' ATTRIBUTE AU_SIZE=32, REDO_SIZE=128
EXTERNAL、NORMAL、HIGH:用于指定镜像类型,即文件的副本数。EXTERNAL 表示单副本;NORMAL 表示双副本;HIGH 表示三副本。缺省为单副本。
磁盘组命令
DSC DMINIT 说明 和 DSC 镜像 DMINIT 说明
DB_NAME= dameng
SYSTEM_PATH= +DMDATA/data
SYSTEM= +DMDATA/data/dameng/system.dbf
SYSTEM_SIZE= 128
ROLL= +DMDATA/data/dameng/roll.dbf
ROLL_SIZE= 128
MAIN= +DMDATA/data/dameng/main.dbf
MAIN_SIZE= 128
CTL_PATH= +DMDATA/data/dameng/dm.ctl
LOG_SIZE= 256
DCR_PATH= /dev_dsc
DCR_SEQNO= 0
AUTO_OVERWRITE= 2
PAGE_SIZE = 32
EXTENT_SIZE = 16
DATA_MIRROR = 1 #SYSTEM/MAIN/ROLL表空间数据文件副本数, 默认1
LOG_MIRROR = 1 #联机日志文件副本数, 默认1
DATA_STRIPING = 32 #数据文件条带化粒度,取值0、32、64、128、256。缺省为32。单位KB。
LOG_STRIPING = 32 #联机日志条带化粒度,取值0、32、64、128、256。缺省为64。单位KB。
[DSC01]
CONFIG_PATH= /home/dmdba/dmdsc/data/DSC01/DSC01_conf
PORT_NUM = 7236
MAL_HOST= 192.168.0.101
MAL_PORT= 7336
LOG_PATH= +DMLOG/log/DSC01_log1.log
LOG_PATH= +DMLOG/log/DSC01_log2.log
[DSC02]
CONFIG_PATH= /home/dmdba/dmdsc/data/DSC02/DSC02_conf
PORT_NUM = 7237
MAL_HOST= 192.168.0.102
MAL_PORT= 7337
LOG_PATH= +DMLOG/log/DSC02_log1.log
LOG_PATH= +DMLOG/log/DSC02_log2.log
模拟环境,我之后可以测试一下0和32对比的性能是否有提升
相关的size要和实际的磁盘大小一致
./dminit control=/home/dmdba/dmdsc/data/DSC01/dminit.ini
scp -r /home/dmdba/dmdsc/data/DSC02/DSC02_conf/ root@192.168.0.102:/home/dmdba/dmdsc/data/DSC02
## DSC-1
/home/dmdba/dmdbms/bin/dmserver dcr_ini=/home/dmdba/dmdsc/data/DSC01/dmdcr.ini /home/dmdba/dmdsc/data/DSC01/DSC01_conf/dm.ini
## DSC-2
/home/dmdba/dmdbms/bin/dmserver dcr_ini=/home/dmdba/dmdsc/data/DSC02/dmdcr.ini /home/dmdba/dmdsc/data/DSC02/DSC02_conf/dm.ini
mkdir -p /home/dmdba/dmdsc/data/
nano /home/dmdba/dmdsc/data/dmcssm.ini
#和DMDCR_CFG.INI中的DCR_OGUID保持一致
CSSM_OGUID = 509317566
#配置所有CSS的连接信息,
#与DMDCR_CFG.INI中CSS配置项的DCR_EP_HOST和DCR_EP_PORT保持一致
CSSM_CSS_IP = 192.168.0.101:7936
CSSM_CSS_IP = 192.168.0.102:7937
CSSM_LOG_PATH = /home/dmdba/dmdsc/data/cssm_log #监视器日志文件存放路径,没有的话需要创建
CSSM_LOG_FILE_SIZE = 32 #每个日志文件最大32M
CSSM_LOG_SPACE_LIMIT = 0 #不限定日志文件总占用空间
mkdir /home/dmdba/dmdsc/log/cssm_log -p
dmcssm ini_path=/home/dmdba/dmdsc/data/dmcssm.ini
show
monitor current time:2024-12-12 15:44:38, n_group:3
=================== group[name = GRP_CSS, seq = 0, type = CSS, Control Node = 0] ========================================
[CSS0] auto check = TRUE, global info:
[ASM0] auto restart = FALSE
[DSC01] auto restart = FALSE
DCRV_STATUS is [OK,UNUSED,UNUSED,UNUSED,UNUSED]
[CSS1] auto check = TRUE, global info:
[ASM1] auto restart = FALSE
[DSC02] auto restart = FALSE
DCRV_STATUS is [OK,UNUSED,UNUSED,UNUSED,UNUSED]
ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts
2024-12-12 15:44:36 CSS0 0 7936 Control Node OPEN WORKING OK TRUE 911317 54168
2024-12-12 15:44:36 CSS1 1 7937 Normal Node OPEN WORKING OK TRUE 919094 52825
=================== 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
2024-12-12 15:44:36 ASM0 0 7536 Control Node OPEN WORKING OK TRUE 941525 56362
2024-12-12 15:44:36 ASM1 1 7537 Normal Node OPEN WORKING OK TRUE 943283 52337
=================== 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
2024-12-12 15:44:36 DSC01 0 7236 Control Node OPEN WORKING OK TRUE 3255612 12232
2024-12-12 15:44:36 DSC02 1 7237 Normal Node OPEN WORKING OK TRUE 3257776 12188
==================================================================================================================
ASM>ls
+
disk groups total [3]......
NO.1 name: DMDATA
NO.2 name: DMLOG
NO.3 name: SYS
Used time: 54.223(ms).
ASM>lsdsk
group DMDATA(id:0 au_size:32MB) include 1 disks......
NO.1 disk :
id: 0
name: DMASMdata
failgroup: data1
partner:
path: /dev_dsc/data
status: NORMAL
size: 127AU
free_size: 89AU
free_rate: 70.1%
create_time: 2024-12-11 14:43:15
modify_time: 2024-12-12 11:23:29
belong group: DMDATA
group DMLOG(id:1 au_size:32MB) include 1 disks......
NO.1 disk :
id: 0
name: DMASMlog
failgroup: data1
partner:
path: /dev_dsc/log
status: NORMAL
size: 63AU
free_size: 18AU
free_rate: 28.6%
create_time: 2024-12-11 14:43:24
modify_time: 2024-12-12 11:23:46
belong group: DMLOG
group SYS(id:126 au_size:1MB) include 1 disks......
NO.1 disk :
id: 0
name: DMASMdcrv
failgroup: SYS_FGRP0
partner:
path: /dev_dsc/system
status: NORMAL
size: 1023AU
free_size: 1008AU
free_rate: 98.5%
create_time: 2024-12-11 14:42:43
modify_time: 2024-12-11 14:42:43
belong group: SYS
total 0 disks unused......
Used time: 45.726(ms).
SQL> select * from v$instance;
行号 NAME INSTANCE_NAME INSTANCE_NUMBER HOST_NAME SVR_VERSION DB_VERSION START_TIME STATUS$
---------- ----- ------------- --------------- -------------- -------------------------- ------------------- ------------------- -------
MODE$ OGUID DSC_SEQNO DSC_ROLE BUILD_VERSION BUILD_TIME
------ ----------- ----------- ------------ ------------------------------------ --------------------
1 DSC01 DSC01 1 Dm-Kylin-DSC-1 DM Database Server x64 V8 DB Version: 0x7000c 2024-12-13 09:57:33 OPEN
NORMAL 0 0 Control node 1-3-162-2024.07.03-234060-20108-ENT Jul 12 2024 05:45:36
已用时间: 22.221(毫秒). 执行号:504.
SQL> select * from DBA_DATA_FILES;
行号 FILE_NAME FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO
---------- ------------------------------ ----------- --------------- -------------------- -------------------- --------- ------------
AUTOEXTENSIBLE MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS ONLINE_STATUS
-------------- -------------- ----------- ------------ -------------------- -------------------- -------------
1 +DMDATA/data/dameng/system.dbf 0 SYSTEM 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 50855936 1552 ONLINE
2 +DMDATA/data/dameng/TEMP0.DBF 0 TEMP 77594624 2368 AVAILABLE 1
YES 70368743129088 67108863 0 75497472 2304 ONLINE
3 +DMDATA/data/dameng/roll.dbf 0 ROLL 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 113770496 3472 ONLINE
行号 FILE_NAME FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO
---------- ------------------------------ ----------- --------------- -------------------- -------------------- --------- ------------
AUTOEXTENSIBLE MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS ONLINE_STATUS
-------------- -------------- ----------- ------------ -------------------- -------------------- -------------
4 +DMDATA/data/dameng/main.dbf 0 MAIN 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 124780544 3808 ONLINE
5 +DMDATA/data/dameng/DMHR.DBF 0 DMHR 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 133693440 4080 ONLINE
已用时间: 58.183(毫秒). 执行号:505.
SQL> select * from v$instance;
行号 NAME INSTANCE_NAME INSTANCE_NUMBER HOST_NAME SVR_VERSION DB_VERSION START_TIME STATUS$
---------- ----- ------------- --------------- -------------- -------------------------- ------------------- ------------------- -------
MODE$ OGUID DSC_SEQNO DSC_ROLE BUILD_VERSION BUILD_TIME
------ ----------- ----------- ----------- ------------------------------------ --------------------
1 DSC02 DSC02 2 Dm-Kylin-DSC-2 DM Database Server x64 V8 DB Version: 0x7000c 2024-12-13 09:57:57 OPEN
NORMAL 0 1 Normal node 1-3-162-2024.07.03-234060-20108-ENT Jul 12 2024 05:45:36
SQL> select * from dba_data_files;
行号 FILE_NAME FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO
---------- ------------------------------ ----------- --------------- -------------------- -------------------- --------- ------------
AUTOEXTENSIBLE MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS ONLINE_STATUS
-------------- -------------- ----------- ------------ -------------------- -------------------- -------------
1 +DMDATA/data/dameng/system.dbf 0 SYSTEM 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 50855936 1552 ONLINE
2 +DMDATA/data/dameng/TEMP1.DBF 0 TEMP 77594624 2368 AVAILABLE 1
YES 70368743129088 67108863 0 75497472 2304 ONLINE
3 +DMDATA/data/dameng/roll.dbf 0 ROLL 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 113246208 3456 ONLINE
行号 FILE_NAME FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO
---------- ------------------------------ ----------- --------------- -------------------- -------------------- --------- ------------
AUTOEXTENSIBLE MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS ONLINE_STATUS
-------------- -------------- ----------- ------------ -------------------- -------------------- -------------
4 +DMDATA/data/dameng/main.dbf 0 MAIN 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 124780544 3808 ONLINE
5 +DMDATA/data/dameng/DMHR.DBF 0 DMHR 134217728 4096 AVAILABLE 1
YES 70368743129088 67108863 0 133693440 4080 ONLINE
已用时间: 67.516(毫秒). 执行号:2.
vboxmanage controlvm Dm-Kylin-DSC-1 pause
[CSS1] [2024-12-13 11:29:59:527] The timestamp of instance CSS [CSS0] has not changed for about 60 seconds, Last timestamp:77436, css sta:OPEN. CSS will exclude the instance from the cluster and launch crash recovery process
[CSS1] [2024-12-13 11:29:59:537] [CSS]: 监测到控制节点关闭
[CSS1] [2024-12-13 11:29:59:547] [CSS]: 设置EP [255]为控制节点
[monitor] 2024-12-13 11:30:01: 检测到CSS控制节点发生变化,由CSS[255]变为CSS[1]
[CSS1] [2024-12-13 11:30:00:566] [CSS]: 设置EP CSS1[1]为控制节点
[CSS1] [2024-12-13 11:30:01:367] [DB]: 设置命令[SYS HALT], 目标站点 DSC01[0], 命令序号[123]
[CSS1] [2024-12-13 11:30:01:377] [DB]: 设置EP DSC01[0]为故障EP
[CSS1] [2024-12-13 11:30:01:379] [ASM]: 设置命令[SYS HALT], 目标站点 ASM0[0], 命令序号[132]
[CSS1] [2024-12-13 11:30:02:413] [ASM]: 设置EP ASM0[0]为故障EP
[CSS1] [2024-12-13 11:30:02:424] [ASM]: 检测到EP ASM0[0]故障在PROCESS_OPEN中
[CSS1] [2024-12-13 11:30:02:436] [ASM]: 设置命令[PRE SUSPEND], 目标站点 ASM1[1], 命令序号[135]
[CSS1] [2024-12-13 11:30:02:547] [ASM]: 预暂停结束
[CSS1] [2024-12-13 11:30:02:580] [DB]: 设置EP DSC02[1]为控制节点
[CSS1] [2024-12-13 11:30:02:692] [ASM]: 暂停工作线程结束
[CSS1] [2024-12-13 11:30:04:648] [ASM]: 设置EP ASM1[1]为控制节点
[CSS1] [2024-12-13 11:30:04:653] [ASM]: 设置命令[CRASH RECV], 目标站点 ASM1[1], 命令序号[139]
[CSS1] [2024-12-13 11:30:07:043] [ASM]: 设置命令[NONE], 目标站点 ASM1[1], 命令序号[0]
[CSS1] [2024-12-13 11:30:07:057] [ASM]: 设置命令[RESUME EP WORKER THREAD], 目标站点 ASM1[1], 命令序号[141]
[CSS1] [2024-12-13 11:30:07:178] [ASM]: 设置命令[NONE], 目标站点 ASM1[1], 命令序号[0]
[CSS1] [2024-12-13 11:30:07:187] [ASM]: 命令[RESUME EP WORKER THREAD]处理结束
[CSS1] [2024-12-13 11:30:08:246] [ASM]: 上次故障处理已完成,允许故障ep重加入
[CSS1] [2024-12-13 11:30:14:028] [DB]: 设置命令[NONE], 目标站点 DSC02[1], 命令序号[0]
[CSS1] [2024-12-13 11:30:14:054] [DB]: 命令[EP_CRASH]处理结束
[CSS1] [2024-12-13 11:30:14:087] [DB]: 设置命令[CMD CLEAR], 目标站点 DSC02[1], 命令序号[128]
[CSS1] [2024-12-13 11:30:14:297] [CSS]: 设置命令[CONFIG VIP], 目标站点 CSS0[0], 命令序号[106]
[CSS1] [2024-12-13 11:30:14:882] [DB]: 设置命令[CONFIG VIP], 目标站点 DSC02[1], 命令序号[133]
[CSS1] [2024-12-13 11:30:15:008] [DB]: 设置命令[NONE], 目标站点 DSC02[1], 命令序号[0]
[CSS1] [2024-12-13 11:30:15:015] [DB]: 命令[CONFIG VIP]处理结束
[CSS1] [2024-12-13 11:30:16:030] [DB]: 上次故障处理已完成,允许故障ep重加入
SQL> select * from dmhr.employee limit 1;
行号 EMPLOYEE_ID EMPLOYEE_NAME IDENTITY_CARD EMAIL PHONE_NUM HIRE_DATE JOB_ID SALARY COMMISSION_PCT
---------- ----------- ------------- ------------------ -------------------- ----------- ---------- ------ ----------- --------------
MANAGER_ID DEPARTMENT_ID
----------- -------------
1 1001 马学铭 340102196202303000 maxueming@dameng.com 15312348552 2008-05-30 11 30000 0
1001 101
已用时间: 00:00:15.439. 执行号:3.
crash process over flag is TRUE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2024-12-13 12:40:42 DSC01 0 7236 Normal Node OPEN SYSHALT ERROR FALSE 532506 34476 2024-12-13 12:40:42 DSC02 1 7237 Control Node OPEN WORKING OK TRUE 534155 38588 ==================================================================================================================
crash process over flag is TRUE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2024-12-13 12:56:01 DSC01 0 7236 Normal Node OPEN WORKING OK TRUE 2531293 44551 2024-12-13 12:56:01 DSC02 1 7237 Control Node OPEN WORKING OK TRUE 534155 39496 ==================================================================================================================
VBoxManage.exe: error: UUID ? of the medium ? does not match the value ? stored in the media registry ('VirtualBox.xml')
解决方案是:
[dmdba@Dm-Kylin-DSC-2 ~]$ dmasmcmd help
dmasmcmd V8
version: 03134284194-20240703-234060-20108 Pack1
格式: ./dmasmcmd KEYWORD=value
例程: ./dmasmcmd SCRIPT_FILE=asmcmd.txt
关键字 说明(默认值)
--------------------------------------------------------------------------------
SCRIPT_FILE asmcmd脚本文件路径
RET_FLAG 执行asmcmd脚本文件时,出错是否立即返回。0:忽略,1:返回。(0)
HELP 打印帮助信息
[dmdba@Dm-Kylin-DSC-2 ~]$ dmasmcmdm help
dmasmcmdm V8
version: 03134284194-20240703-234060-20108 Pack1
格式: ./dmasmcmdm KEYWORD=value
例程: ./dmasmcmdm SCRIPT_FILE=asmcmd.txt
关键字 说明(默认值)
--------------------------------------------------------------------------------
SCRIPT_FILE asmcmd脚本文件路径
RET_FLAG 执行asmcmd脚本文件时,出错是否立即返回。0:忽略,1:返回。(0)
HELP 打印帮助信息
没看出来区别,但是同样的
create dcrvdisk '/dev_dsc/system' 'dcrv'
dmasmcmd 会报错.
2024-12-12 14:27:06.505 [INFO] dminit P0000005132 T0000000000000005132 rfil_close_low set arch rfil[+DMLOG/log/DSC01_log1.log]'s sta to inactive, l_next_seq = 2457, g_next_seq = 2457, clsn = 0, handle = -2130051053, free=4096, len=1073741824
2024-12-12 14:27:06.509 [ERROR] dminit P0000005132 T0000000000000005132 os_file_create_with_init->os_asm_file_create: [path: +DMLOG/log/DSC01_log2.log]: [CODE:-523]
2024-12-12 14:27:06.509 [INFO] dminit P0000005132 T0000000000000005132 os_sema2_free, sema_id:131074, sema_value:1!
2024-12-12 14:27:06.509 [INFO] dminit P0000005132 T0000000000000005132 os_sema2_free, sema_id:163843, sema_value:1!
2024-12-12 14:27:06.509 [INFO] dminit P0000005132 T0000000000000005132 dmshm3_detach, ret = 0 shm id 98307
2024-12-12 14:27:06.513 [FATAL] dminit P0000005132 T0000000000000005132 init database fail with code -2!
SQL> `/home/dmdba/dmdbms/samples/instance_script/dmhr/GBK/1-CREATESCHEMA.sql
SQL> --������ռ�
CREATE TABLESPACE DMHR DATAFILE 'DMHR.DBF' size 128;
--������ռ�
CREATE TABLESPACE DMHR DATAFILE 'DMHR.DBF' size 128;
--������ռ�
*
第 1 行, 第 63 列[]附近出现错误[-2007]:语法分析出错.
已用时间: 15.423(毫秒). 执行号:0.
SQL> /
--������ռ�
CREATE TABLESPACE DMHR DATAFILE 'DMHR.DBF' size 128;
--������ռ�
*
第 1 行, 第 63 列[]附近出现错误[-2007]:语法分析出错.
已用时间: 2.139(毫秒). 执行号:0.
SQL> --����ģʽ
CREATE SCHEMA DMHR;
操作已执行
已用时间: 124.194(毫秒). 执行号:65001.
SQL> `/home/dmdba/dmdbms/samples/instance_script/dmhr/UTF-8/1-CREATESCHEMA.sql
SQL> --创建表空间
CREATE TABLESPACE DMHR DATAFILE 'DMHR.DBF' size 128;
操作已执行
已用时间: 00:00:01.527. 执行号:65002.
SQL> /
--创建表空间
CREATE TABLESPACE DMHR DATAFILE 'DMHR.DBF' size 128;
第2 行附近出现错误[-3401]:表空间[DMHR]已存在.
已用时间: 3.942(毫秒). 执行号:0.
SQL> --创建模式
CREATE SCHEMA DMHR;
操作已执行
已用时间: 17.564(毫秒). 执行号:65003.
可能原因如下
[root@Dm-Kylin-DSC-1 ~]# locale
LC_CTYPE="zh_CN.UTF-8"
官方社区地址:https://eco.dameng.com
文章
阅读量
获赞