達夢DMDSC叢集搭建
介紹
DM 共享儲存資料庫叢集的英文全稱 DM Data Shared Cluster ,簡稱 DMDSC 。
DM 共享儲存資料庫叢集,允許多個資料庫例項同時訪問、操作同一資料庫,具有高可用、高效能、負載均衡等特性。 DMDSC 支援故障自動切換和故障自動重加入,某一個資料庫例項故障後,不會導致資料庫服務無法提供。
系統結構圖:
前期準備
兩臺伺服器、每臺伺服器至少 2 塊網路卡、記憶體至少 2GB 、三塊共享儲存磁碟、提前安裝 dm 軟體。
網路配置
###public 192.168.31.200 dsc01 192.168.31.58 dsc02 ###priv 192.168.33.200 dsc01-priv 192.168.33.58 dsc02-priv
儲存配置
fdisk -l Disk /dev/sde: 2147 MB, 2147483648 bytes, 4194304 sectors Disk /dev/sdf: 2147 MB, 2147483648 bytes, 4194304 sectors Disk /dev/sdg: 2147 MB, 2147483648 bytes, 4194304 sectors Disk /dev/sdh: 10.7 GB, 10737418240 bytes, 20971520 sectors
儲存規劃
VOTE 2G /dev/sde---/dev/dm/asm-diske DCR 2G /dev/sdf---/dev/dm/asm-diskf ARCH 2G /dev/sdg---/dev/dm/asm-diskg DATA 10G /dev/sdh---/dev/dm/asm-diskh
磁碟繫結
如沒有配置多路徑,採用 UUID 繫結多個 LUN 儲存,可以透過 fdisk -l 命令檢視 LUN 裝置,這裡以共享儲存盤為 sde , sdf , sdg , sdh 為例。
繫結裝置的 UUID 。建立 uuid.sh 檔案,使用指令碼生成配置檔案。
ls /etc/udev/rules.d/88-dm-asmdevices.rules
for i in e f g h; 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
指令碼執行成功後,會生成繫結配置檔案 88-dm-asmdevices.rules ,可以根據自己的需求進行修改別名 SYMLINK ,本文件修改如下:
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=="1ATA_VBOX_HARDDISK_VB4bbc185c-adebce47", 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=="1ATA_VBOX_HARDDISK_VB5286a6b0-e686bf8e", 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=="1ATA_VBOX_HARDDISK_VB45416f69-4a1e1728", SYMLINK+="dm/asm-diskg",OWNER="dmdba", GROUP="dinstall",MODE="0660" KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VBc8102a7b-c9fec5b3", SYMLINK+="dm/asm-diskh",OWNER="dmdba", GROUP="dinstall",MODE="0660"
配置部署檔案。生成配置檔案後,把 88-dm-asmdevices.rules 配置檔案 cp 到 DSC 的每個節點上。
檢查生效。
( 1 )重啟伺服器,建議使用該方法。
( 2 )如果無法重啟,執行下述命令。
udevadm control --reload-rules systemctl restart systemd-udev-trigger.service
[root@dsc01 ~]# ls -lrth /dev/dm/asm-disk* lrwxrwxrwx 1 root root 6 Dec 8 15:01 /dev/dm/asm-diske -> ../sde lrwxrwxrwx 1 root root 6 Dec 8 15:01 /dev/dm/asm-diskh -> ../sdh lrwxrwxrwx 1 root root 6 Dec 8 15:01 /dev/dm/asm-diskf -> ../sdf lrwxrwxrwx 1 root root 6 Dec 8 15:01 /dev/dm/asm-diskg -> ../sdg
( 3 )授權
chown dmdba:dinstall /dev/dm/asm-* -R
( 4 )檢查生效
blockdev --getsize64 /dev/dm/asm-diske blockdev --getsize64 /dev/dm/asm-diskh blockdev --getsize64 /dev/dm/asm-diskf blockdev --getsize64 /dev/dm/asm-diskg
結果如下
[root@dsc01 ~]# blockdev --getsize64 /dev/dm/asm-diske 2147483648 [root@dsc01 ~]# blockdev --getsize64 /dev/dm/asm-diskh 10737418240 [root@dsc01 ~]# blockdev --getsize64 /dev/dm/asm-diskf 2147483648 [root@dsc01 ~]# blockdev --getsize64 /dev/dm/asm-diskg 2147483648
配置 dmdcr_cfg.ini
dsc01 和 dsc02 機器配置相同。
[dmdba@dsc01 ~]$ mkdir /dm/dmdbms/dsc_config vi /dm/dmdbms/dsc_config/dmdcr_cfg.ini DCR_N_GRP = 3 ##叢集環境有多少個 GROUP,範圍:1~16 DCR_VTD_PATH = /dev/dm/asm-diske ##規劃為 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.33.200 ##心跳地址 DCR_EP_PORT = 11286 ##CSS 埠 [GRP_CSS] DCR_EP_NAME = CSS1 DCR_EP_HOST = 192.168.33.58 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.33.200 ##心跳地址 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.33.58 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 = 5237 ##例項埠,和 dm.ini 的 PORT_NUM 一致 DCR_CHECK_PORT = 11256 ##DCR 檢查埠 [GRP_DSC] DCR_EP_NAME = DSC1 DCR_EP_SEQNO = 1 DCR_EP_PORT = 5237 DCR_CHECK_PORT = 11257
初始化磁碟組
在 dsc01 機器上進行如下操作。
/dm/dmdbms/bin/dmasmcmd ASM>create votedisk '/dev/dm/asm-diske' 'vote' ASM>create dcrdisk '/dev/dm/asm-diskf' 'dcr' ASM>init dcrdisk '/dev/dm/asm-diskf' from '/dm/dmdbms/dsc_config/dmdcr_cfg.ini' identified by 'hust4400' ASM>init votedisk '/dev/dm/asm-diske' from '/dm/dmdbms/dsc_config/dmdcr_cfg.ini' ASM>create asmdisk '/dev/dm/asm-diskh' 'DATA0' ASM>create asmdisk '/dev/dm/asm-diskg' 'ARCH0'
配置 dmasvrmal.ini
vi /dm/dmdbms/dsc_config/dmasvrmal.ini [MAL_INST0] MAL_INST_NAME = ASM0 MAL_HOST = 192.168.33.200 #心跳地址 MAL_PORT = 11266 #MAL 監聽埠 [MAL_INST1] MAL_INST_NAME = ASM1 MAL_HOST = 192.168.33.58 MAL_PORT = 11266
配置 dmdcr.ini 檔案
dsc01 機器配置 dmdcr.ini , dmdcr_seqo 為 0
vi /dm/dmdbms/dsc_config/dmdcr.ini DMDCR_PATH = /dev/dm/asm-diskf DMDCR_MAL_PATH = /dm/dmdbms/dsc_config/dmasvrmal.ini DMDCR_SEQNO = 0 DMDCR_AUTO_OPEN_CHECK = 111 DMDCR_ASM_TRACE_LEVEL = 2 ##DMDCR_ASM_RESTART_INTERVAL = 60 #CSS 認定 ASM 故障重啟的時間 ##DMDCR_ASM_STARTUP_CMD = /dm/dmdbms/dsc_config/DmAsmService_DSC0 start ##DMDCR_DB_RESTART_INTERVAL = 60 ##CSS 認定 DSC 故障重啟的時間,設定為 0 不自動拉起 ##DMDCR_DB_STARTUP_CMD = /dm/dmdbms/dsc_config/DmService_DSC0 start
dsc02 機器配置 dmdcr.ini, dmdcr_seqo 為 1
vi /dm/dmdbms/dsc_config/dmdcr.ini DMDCR_PATH = /dev/dm/asm-diskf DMDCR_MAL_PATH = /dm/dmdbms/dsc_config/dmasvrmal.ini DMDCR_SEQNO = 1 DMDCR_AUTO_OPEN_CHECK = 111 DMDCR_ASM_TRACE_LEVEL = 2 ##DMDCR_ASM_RESTART_INTERVAL = 60 ##DMDCR_ASM_STARTUP_CMD = /dm/dmdbms/dsc_config/DmAsmServiceDSC1 start ##DMDCR_DB_RESTART_INTERVAL = 60 ##DMDCR_DB_STARTUP_CMD = /dm/dmdbms/dsc_config/DmServiceDSC1 start
注意
當前為手動拉起 dsc01 機器和 dsc02 機器的 ASM 和 DMSERVER 服務。待叢集配置完成後,再修改為自動拉起(刪除 dmdcr.ini 中的“ ## ”號即可)。
啟動 DMCSS 、 DMASM 服務
在 2 個節點分別啟動 dmcss 命令:
前臺啟動,執行 ctrl+c 後服務會退出
/dm/dmdbms/bin/dmcss DCR_INI=/dm/dmdbms/dsc_config/dmdcr.ini
在 2 個節點分別啟動 dmasmsvr 命令:
前臺啟動,執行 ctrl+c 後服務會退出
/dm/dmdbms/bin/dmasmsvr DCR_INI=/dm/dmdbms/dsc_config/dmdcr.ini
建立 ASM
## 在 dsc01 節點啟動 dmasmtool 工具
/dm/dmdbms/bin/dmasmtool DCR_INI=/dm/dmdbms/dsc_config/dmdcr.ini
## 輸入下列語句建立 DMASM 磁碟組
## 建立資料磁碟組
ASM> create diskgroup 'DMDATA' asmdisk '/dev/dm/asm-diskh'
## 建立歸檔磁碟組
ASM> create diskgroup 'DMARCH' asmdisk '/dev/dm/asm-diskg'
初始化 DB 環境
dsc01 和 dsc02 機器配置相同。
建立 dminit.ini 檔案
[dmdba@~]# vi /dm/dmdbms/dsc_config/dminit.ini DB_NAME = DSC SYSDBA_PWD = 1 SYSTEM_PATH = +DMDATA/data SYSTEM = +DMDATA/data/SYSTEM.dbf SYSTEM_SIZE = 300 ROLL = +DMDATA/data/ROLL.dbf ROLL_SIZE = 300 MAIN = +DMDATA/data/MAIN.dbf MAIN_SIZE = 300 CTL_PATH = +DMDATA/data/dm.ctl CTL_SIZE = 8 LOG_SIZE = 300 DCR_PATH = /dev/dm/asm-diskf DCR_SEQNO = 0 AUTO_OVERWRITE = 1 PAGE_SIZE = 32 EXTENT_SIZE = 16 BLANK_PAD_MODE = 1 [DSC0] CONFIG_PATH = /dm/dmdbms/dsc_config/DCS0 PORT_NUM = 5237 MAL_HOST = 192.168.33.200 MAL_PORT = 11246 LOG_PATH = +DMDATA/DSC0_LOG01.log LOG_PATH = +DMDATA/DSC0_LOG02.log [DSC1] CONFIG_PATH = /dm/dmdbms/dsc_config/DCS1 PORT_NUM = 5237 MAL_HOST = 192.168.33.58 MAL_PORT = 11246 LOG_PATH = +DMDATA/DSC1_LOG01.log LOG_PATH = +DMDATA/DSC1_LOG02.log
在 dsc01 節點執行初始化 db 命令
[dmdba@dsc01 dsc_config]$ /dm/dmdbms/bin/dminit control=/dm/dmdbms/dsc_config/dminit.ini initdb V8 db version: 0x7000c file dm.key not found, use default license! License will expire on 2023-07-20 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL log file path: +DMDATA/DSC0_LOG01.log log file path: +DMDATA/DSC0_LOG02.log log file path: +DMDATA/DSC1_LOG01.log log file path: +DMDATA/DSC1_LOG02.log FILE "/dm/dmdbms/dsc_config/DCS0/dm.ini" has already existed FILE "/dm/dmdbms/dsc_config/DCS0/sqllog.ini" has already existed FILE "/dm/dmdbms/dsc_config/DCS1/dm.ini" has already existed FILE "/dm/dmdbms/dsc_config/DCS1/sqllog.ini" has already existed FILE "+DMDATA/data/SYSTEM.dbf" has already existed FILE "+DMDATA/data/dm.ctl" has already existed FILE "+DMDATA/DSC0_LOG01.log" has already existed FILE "+DMDATA/DSC0_LOG02.log" has already existed FILE "+DMDATA/DSC1_LOG01.log" has already existed FILE "+DMDATA/DSC1_LOG02.log" has already existed write to dir [+DMDATA/data/DSC]. create dm database success. 2022-12-08 17:52:12
複製檔案到 dsc02 節點
scp -r /dm/dmdbms/dsc_config/DCS1 dmdba@192.168.33.58:/dm/dmdbms/dsc_config/
啟動資料庫
##dsc01 機器 /dm/dmdbms/bin/dmserver /dm/dmdbms/dsc_config/DCS0/dm.ini dcr_ini=/dm/dmdbms/dsc_config/dmdcr.ini ##dsc02 機器 /dm/dmdbms/bin/dmserver /dm/dmdbms/dsc_config/DCS1/dm.ini dcr_ini=/dm/dmdbms/dsc_config/dmdcr.ini
檢查資料庫
[dmdba@dsc01 ~]$ disql SYSDBA/Dameng123:5237 Server[LOCALHOST:5237]:mode is normal, state is open login used time : 95.307(ms) disql V8
檢查叢集
SQL> select * from V$dsc_ep_info; LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS ---------- ------- ----------- -------------------- -------------------- ------------ --------- 1 DSC0 0 9684163 9684477 Control Node OK 2 DSC1 1 9725549 9725768 Normal Node OK used time: 468.386(ms). Execute id is 55000.
檢查檔案路徑
SQL> select path from v$datafile; LINEID PATH ---------- -------------------------- 1 +DMDATA/data/SYSTEM.dbf 2 +DMDATA/data/ROLL.dbf 3 +DMDATA/data/DSC/TEMP0.DBF 4 +DMDATA/data/MAIN.dbf used time: 233.157(ms). Execute id is 55002. SQL> select path from v$rlogfile; LINEID PATH ---------- ---------------------- 1 +DMDATA/DSC0_LOG01.log 2 +DMDATA/DSC0_LOG02.log used time: 272.908(ms). Execute id is 55005.
檢查 例項
SQL> select name,instance_name,host_name from v$instance; LINEID NAME INSTANCE_NAME HOST_NAME ---------- ---- ------------- --------- 1 DSC0 DSC0 dsc01 used time: 822.051(ms). Execute id is 55100. SQL> select name,instance_name,host_name from v$instance; LINEID NAME INSTANCE_NAME HOST_NAME ---------- ---- ------------- --------- 1 DSC1 DSC1 dsc02 used time: 17.985(ms). Execute id is 7.
檢查 ASM
SQL> select group_id,group_name,TOTAL_SIZE from v$asmgroup; LINEID GROUP_ID GROUP_NAME TOTAL_SIZE ---------- ----------- ---------- ----------- 1 0 DMDATA 10239 2 1 DMARCH 2047 3 125 VOTE 2048 4 126 DCR 2048 used time: 907.805(ms). Execute id is 55007. SQL> select disk_name,disk_path from v$asmdisk; LINEID DISK_NAME DISK_PATH ---------- ---------- ----------------- 1 DMASMDATA0 /dev/dm/asm-diskh 2 DMASMARCH0 /dev/dm/asm-diskg 3 DMASMvote /dev/dm/asm-diske 4 DMASMdcr /dev/dm/asm-diskf used time: 433.907(ms). Execute id is 55008. SQL> select * from V$ASMATTR; LINEID AU_SIZE EXTENT_SIZE LOCAL_CODE LOCAL_LANG USE_SHM EXTENT_ARR_SIZE ---------- ----------- ----------- ---------- ---------- ------- --------------- 1 1048576 4 PG_GB18030 EN TRUE 12351936 used time: 77.872(ms). Execute id is 55013. SQL> select file_id,type,path from v$asmfile; LINEID FILE_ID TYPE PATH ---------- -------------------- --------- ------------------------ 1 2147483649 DIRECTORY +DMDATA 2 2147483650 DIRECTORY +DMDATA/data 3 2147483651 DIRECTORY +DMDATA/data/DSC 4 2147483652 DIRECTORY +DMDATA/data/DSC/bak 5 2147483653 FILE +DMDATA/data/dm.ctl 6 2147483679 FILE +DMDATA/DSC0_LOG01.log 7 2147483680 FILE +DMDATA/DSC0_LOG02.log 8 2147483681 FILE +DMDATA/DSC1_LOG01.log 9 2147483682 FILE +DMDATA/DSC1_LOG02.log 10 2147483661 FILE +DMDATA/data/SYSTEM.dbf 11 2147483659 DIRECTORY +DMDATA/data/DSC/ctl_bak 12 2147483685 FILE +DMDATA/data/MAIN.dbf 13 2147483662 FILE +DMDATA/data/DSC/dm_service.prikey 14 2147483684 FILE +DMDATA/data/DSC/ctl_bak/dm_20221208175156_758750.ctl 15 2147483686 FILE +DMDATA/data/ROLL.dbf 16 2147483687 DIRECTORY +DMDATA/data/DSC/HMAIN 17 2147483688 FILE +DMDATA/data/DSC/TEMP0.DBF 18 2147483689 FILE +DMDATA/data/DSC/TEMP1.DBF 19 2147483692 FILE +DMDATA/data/DSC/rep_conflict.log 20 2147483691 FILE +DMDATA/data/DSC/ctl_bak/dm_20221208180445_380829.ctl 21 2147483694 FILE +DMDATA/data/DSC/ctl_bak/dm_20221208180608_533426.ctl 22 2164260865 DIRECTORY +DMARCH 23 4244635649 DIRECTORY +VOTE 24 4244635650 FILE +VOTE/VOTE 25 4261412865 DIRECTORY +DCR 26 4261412866 FILE +DCR/DCR 26 rows got used time: 485.758(ms). Execute id is 55009.
檢查 DCR
SQL> select * from V$DCR_INFO; LINEID VERSION N_GROUP VTD_PATH UDP_FLAG UDP_OGUID DCR_PATH ---------- ----------- ----------- ----------------- ----------- -------------------- ----------------- 1 259 3 /dev/dm/asm-diske 0 210715 /dev/dm/asm-diskf used time: 923.717(ms). Execute id is 55010. SQL> select * from V$DCR_GROUP; LINEID GROUP_TYPE GROUP_NAME N_EP DSKCHK_CNT NETCHK_TIME ---------- ---------- ---------- ----------- ----------- ----------- 1 CSS GRP_CSS 2 65 0 2 ASM GRP_ASM 2 61 0 3 DB GRP_DSC 2 57 0 used time: 903.076(ms). Execute id is 55011. SQL> select * from V$DCR_EP; LINEID GROUP_NAME EP_NAME EP_SEQNO EP_HOST EP_PORT UDP_PORT SHM_KEY SHM_SIZE ASM_LOAD_PATH ---------- ---------- ------- ----------- -------------- ----------- ----------- ----------- ----------- ------------- 1 GRP_CSS CSS0 0 192.168.33.200 11286 0 0 0 NULL 2 GRP_CSS CSS1 1 192.168.33.58 11286 0 0 0 NULL 3 GRP_ASM ASM0 0 192.168.33.200 11276 0 42424 1024 /dev/dm 4 GRP_ASM ASM1 1 192.168.33.58 11277 0 42425 1024 /dev/dm 5 GRP_DSC DSC0 0 5237 0 0 0 NULL 6 GRP_DSC DSC1 1 5237 0 0 0 NULL 6 rows got
建立測試資料
SQL> create table t1(id int,time datetime); executed successfully used time: 535.329(ms). Execute id is 55016. SQL> insert into t1 values(1,now()); affect rows 1 used time: 0.908(ms). Execute id is 55017. SQL> commit; executed successfully used time: 502.314(ms). Execute id is 55019. SQL> select * from t1; LINEID ID TIME ---------- ----------- -------------------------- 1 1 2022-12-08 18:24:26.540339 used time: 00:00:01.008. Execute id is 55018.
登入另一個節點,可以正常查到資料
[dmdba@dsc02 ~]$ disql SYSDBA/Dameng123:5237 SQL> select * from t1; LINEID ID TIME ---------- ----------- -------------------------- 1 1 2022-12-08 18:24:26.540339 used time: 00:00:03.320. Execute id is 2.
註冊服務
註冊 CSS 、 ASM 、 DMSERVER 後臺服務,必須 root 使用者執行
##dsc01 機器
/dm/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm/dmdbms/dsc_config/dmdcr.ini -p CSS /dm/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmdbms/dsc_config/dmdcr.ini -y DmCSSServiceCSS.service -p ASM /dm/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmdbms/dsc_config/DCS0/dm.ini -dcr_ini /dm/dmdbms/dsc_config/dmdcr.ini -y DmASMSvrServiceASM.service -m open -p DSC
##dsc02 機器
/dm/dmdbms/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm/dmdbms/dsc_config/dmdcr.ini -p CSS /dm/dmdbms/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmdbms/dsc_config/dmdcr.ini -y DmCSSServiceCSS.service -p ASM /dm/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmdbms/dsc_config/DCS1/dm.ini -dcr_ini /dm/dmdbms/dsc_config/dmdcr.ini -y DmASMSvrServiceASM.service -m open -p DSC
檢視服務
[root@dsc01 ~]# systemctl list-unit-files |grep -E "DmA|DmCSS|DmS" DmAPService.service enabled DmASMSvrServiceASM.service enabled DmCSSServiceCSS.service enabled DmServiceDSC.service enabled
叢集啟動和關閉
啟動叢集
啟動 CSS
[root@dsc01 ~]# systemctl start DmCSSServiceCSS.service [root@dsc02 ~]# systemctl start DmCSSServiceCSS.service
對應程式
[root@dsc01 ~]# ps -ef|grep -i dmc dmdba 25475 1 0 18:51 ? 00:00:00 /dm/dmdbms/bin/dmcss dcr_ini=/dm/dmdbms/dsc_config/dmdcr.ini -noconsole
啟動 ASM
[root@dsc01 ~]# systemctl start DmASMSvrServiceASM.service [root@dsc02 ~]# systemctl start DmASMSvrServiceASM.service
對應程式
[root@dsc01 ~]# ps -ef|grep -i dmasm dmdba 25612 1 2 18:53 ? 00:00:01 /dm/dmdbms/bin/dmasmsvr dcr_ini=/dm/dmdbms/dsc_config/dmdcr.ini -noconsole
啟動資料庫
[root@dsc01 ~]# systemctl start DmServiceDSC [root@dsc02 ~]# systemctl start DmServiceDSC
對應程式
[root@dsc01 ~]# ps -ef|grep -i dms dmdba 25875 1 1 18:55 ? 00:00:00 /dm/dmdbms/bin/dmserver path=/dm/dmdbms/dsc_config/DCS0/dm.ini dcr_ini=/dm/dmdbms/dsc_config/dmdcr.ini -noconsole
關閉叢集
關閉資料庫
[root@dsc01 ~]# systemctl stop DmServiceDSC [root@dsc02 ~]# systemctl stop DmServiceDSC
關閉 ASM
[root@dsc01 ~]# systemctl stop DmASMSvrServiceASM.service [root@dsc02 ~]# systemctl stop DmASMSvrServiceASM.service
關閉 CSS
[root@dsc01 ~]# systemctl stop DmCSSServiceCSS.service [root@dsc02 ~]# systemctl stop DmCSSServiceCSS.service
其他操作
關閉服務自動啟動
systemctl disable DmCSSServiceCSS.service systemctl disable DmASMSvrServiceASM.service systemctl disable DmServiceDSC systemctl disable DmAPService.service [root@dsc01 ~]# systemctl list-unit-files |grep -E "DmA|DmCSS|DmS" DmAPService.service disabled DmASMSvrServiceASM.service disabled DmCSSServiceCSS.service disabled DmServiceDSC.service disabled
刪除服務
/dm/dmdbms/script/root/dm_service_uninstaller.sh -n DmCSSServiceCSS /dm/dmdbms/script/root/dm_service_uninstaller.sh -n DmASMSvrServiceASM /dm/dmdbms/script/root/dm_service_uninstaller.sh -n DmServiceDSC
故障處理
錯誤一:啟動 CSS 服務失敗
報錯如下:
[dmdba@dsc01 ~]$ /dm/dmdbms/bin/dmcss DCR_INI=/dm/dmdbms/dsc_config/dmdcr.ini /dm/dmdbms/bin/dmcss: error while loading shared libraries: libdmcalc.so: cannot open shared object file: No such file or directory
需要進到 /dm/dmdbms/bin/ 目錄下執行,不能直接使用絕對路徑
[dmdba@dsc01 bin]$ ./dmcss DCR_INI=/dm/dmdbms/dsc_config/dmdcr.ini DMCSS V8 DMCSS IS READY [2022-12-08 16:21:47:027] [CSS]: Set EP CSS0[0] as Control node
錯誤二:啟動 ASM服務失敗
報錯如下:
[dmdba@dsc01 bin]$ /dm/dmdbms/bin/dmasmsvr DCR_INI=/dm/dmdbms/dsc_config/dmdcr.ini ASM SELF EPNO:0 DMASMSVR V8 dmasmsvr task worker thread startup shmget: Invalid argument create share memory failed[code: -9728], please check shm config and try again, errno:[22]
需要調大 kernel.shmmax 值
[root@dsc01 mnt]# vi /etc/sysctl.conf #kernel.shmmax = 858783744
調大 kernel.shmmax
[root@dsc01 mnt]# sysctl -p
錯誤三:建立資料庫失敗
報錯如下:
[dmdba@dsc01 dsc_config]$ /dm/dmdbms/bin/dminit control=/dm/dmdbms/dsc_config/dminit.ini ...... write to dir [+DMDATA/data/DSC]. fsm_file_add group_id 4, file_id 0, size_in_pages 32768, path +DMDATA/data/MAIN.dbf failed, code -7004 Please check whether exist file or directory with the same name, code:[-7014] You may get more details in file ../log/dm_DSC0_202212.log fail to init db.
檢視日誌 ../log/dm_DSC0_202212.log ,空間不足了 , 減小引數檔案裡配置的資料檔案大小,重新執行
2022-12-08 17:48:55.401 [ERROR] dminit P0000020632 T0000000000000020632 os_file_create_ex->os_asm_file_create: [path: +DMDATA/data/MAIN.dbf]: [CODE:-523] Out of space
錯誤四:達夢官方文件存在部分錯誤
1.2.8 初始化 DB 環境
## 在 db0 節點執行初始化 db 命令
[dmdba@~]# vi /dm/dmdbms/bin/dminit control=/dm/dmdbms/dsc_config/init/dminit.ini
沒有 vi 。
1.2.11 註冊 CSS 、 ASM 、 DMSERVER 後臺服務
[root@~]# /dm/dmdbms/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmdbms/dsc_config/DSC0/dm.ini -dcr_ini /dm/dmdbms/dsc_config/dmdcr.ini -y DmASMSvrServiceASM.service -m -p DSC
這裡的 -m 後需要接 mount 或 open 。
參考文件
https://eco.dameng.com/document/dm/zh-cn/ops/DSC-installation-cluster.html https://eco.dameng.com/document/dm/zh-cn/pm/dsc-monitor.html
###chenjuchao 20221208 20:25###
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2927393/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 搭建達夢DSC叢集
- 達夢DBlink叢集之間通訊搭建
- 達夢資料庫主備實時叢集搭建和維護資料庫
- 基於X-86平臺的達夢8守護叢集搭建
- 達夢DEM部署主備守護叢集
- 搭建zookeeper叢集(偽叢集)
- zookeeper叢集及kafka叢集搭建Kafka
- linux下搭建ZooKeeper叢集(偽叢集)Linux
- Redis系列:搭建Redis叢集(叢集模式)Redis模式
- 搭建ELK叢集
- Ambari叢集搭建
- kafka叢集搭建Kafka
- Hadoop搭建叢集Hadoop
- zookeeper 叢集搭建
- 搭建 Redis 叢集Redis
- nacos 叢集搭建
- mysql叢集搭建MySql
- redis叢集搭建Redis
- Hadoop叢集搭建Hadoop
- Zookeeper叢集搭建
- RabbitMQ叢集搭建MQ
- HBASE叢集搭建
- 達夢資料庫單例項轉實時同步叢集資料庫單例
- 【環境搭建】RocketMQ叢集搭建MQ
- 達夢資料庫DM8共享叢集測試記錄資料庫
- 4.4 Hadoop叢集搭建Hadoop
- Redis(5.0) 叢集搭建Redis
- MySQL 5.7 叢集搭建MySql
- 搭建spark on yarn 叢集SparkYarn
- ZooKeeper 搭建 solr 叢集Solr
- 搭建Redis原生叢集Redis
- 搭建MongoDB分片叢集MongoDB
- MySQL MGR 叢集搭建MySql
- 【greenplum】greenplum叢集搭建
- Kubernetes 叢集搭建(上)
- Kubernetes 叢集搭建(下)
- MongoDB 分片叢集搭建MongoDB
- ElasticSearch 7.8.1叢集搭建Elasticsearch