DM8 使用裸裝置搭建DMRAC
使用裸裝置搭建DMRAC
一、操作環境
主機 IP地址(對外服務) IP地址(內部通訊) 例項名 作業系統 dm8dsc1 10.10.13.205 11.11.11.3 dsc0 Redhat 7.8 dm8dsc2 10.10.13.206 11.11.11.4 dsc1 Redhat 7.8
共享儲存
/dev/sdb /dev/raw/raw1 dcr disk 2G /dev/sdc /dev/raw/raw2 voting disk 2G /dev/sdd1 /dev/raw/raw3 log disk1 2G /dev/sdd2 /dev/raw/raw4 log disk2 2G /dev/sdd3 /dev/raw/raw5 log disk3 2G /dev/sdd5 /dev/raw/raw6 log disk4 2G /dev/sde1 /dev/raw/raw7 data disk1 5G /dev/sde2 /dev/raw/raw8 data disk2 5G /dev/sdf1 /dev/raw/raw9 data disk3 5G /dev/sdf2 /dev/raw/raw10 data disk4 5G /dev/sdg1 /dev/raw/raw11 data disk5 5G /dev/sdg2 /dev/raw/raw12 data disk6 5G
二、作業系統配置
1、關閉防火牆和SELINUX
[root@gbase ~]# systemctl stop firewalld [root@gbase ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@gbase ~]# systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) Dec 08 10:57:13 gbase systemd[1]: Starting firewalld - dynamic firewall daemon... Dec 08 10:57:17 gbase systemd[1]: Started firewalld - dynamic firewall daemon. Dec 08 14:46:41 gbase systemd[1]: Stopping firewalld - dynamic firewall daemon... Dec 08 14:46:42 gbase systemd[1]: Stopped firewalld - dynamic firewall daemon. [root@gbase ~]# setenforce 0 [root@gbase ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config [root@gbase ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@gbase ~]# systemctl stop firewalld [root@gbase ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@gbase ~]# systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) Dec 08 10:57:19 gbase systemd[1]: Starting firewalld - dynamic firewall daemon... Dec 08 10:57:21 gbase systemd[1]: Started firewalld - dynamic firewall daemon. Dec 08 14:46:45 gbase systemd[1]: Stopping firewalld - dynamic firewall daemon... Dec 08 14:46:46 gbase systemd[1]: Stopped firewalld - dynamic firewall daemon. [root@gbase ~]# setenforce 0 [root@gbase ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config [root@gbase ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
2、修改主機名
[root@gbase ~]# hostnamectl set-hostname dm8dsc1 [root@gbase ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm8dsc1:g /etc/sysconfig/network [root@gbase ~]# echo " > 10.10.13.205 dm8dsc1 > 10.10.13.206 dm8dsc2" >> /etc/hosts [root@gbase ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.10.13.205 dm8dsc1 10.10.13.206 dm8dsc2 [root@gbase ~]# hostnamectl set-hostname dm8dsc2 [root@gbase ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm8dsc2:g /etc/sysconfig/network [root@gbase ~]# echo " > 10.10.13.205 dm8dsc1 > 10.10.13.206 dm8dsc2" >> /etc/hosts [root@gbase ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.10.13.205 dm8dsc1 10.10.13.206 dm8dsc2
三、 安裝達夢軟體
3.1檢查Linux(Unix)系統資訊
[root@dm8dsc1 ~]# getconf LONG_BIT 64 [root@dm8dsc2 ~]# getconf LONG_BIT 64
查詢作業系統release資訊
[root@dm8dsc1 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.8 Beta (Maipo) [root@dm8dsc2 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.8 Beta (Maipo)
3.2建立安裝使用者
為了減少對作業系統的影響,使用者不應該以root系統使用者來安裝和執行DM。使用者可以在安裝之前為DM建立一個專用的系統使用者。
1. 建立安裝使用者組dinstall。
[root@dm8dsc1 ~]# groupadd dinstall [root@dm8dsc2 ~]# groupadd dinstall
2. 建立安裝使用者dmdba。
[root@dm8dsc1 ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba [root@dm8dsc2 ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
3. 初始化使用者密碼。
[root@dm8dsc1 ~]# passwd dmdba Changing password for user dmdba. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@dm8dsc2 ~]# passwd dmdba Changing password for user dmdba. New password: Retype new password: passwd: all authentication tokens updated successfully.
3.3 Linux(Unix)下檢查作業系統限制
在Linux(Unix)系統中,因為ulimit命令的存在,會對程式使用作業系統資源進行限制。為了使DM能夠正常執行,建議使用者檢查當前安裝使用者的ulimit引數。
執行ulimit -a進行查詢。如下圖所示:
[root@dm8dsc1 ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 31152 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited [root@dm8dsc2 ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 31152 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
引數使用限制:
1.data seg size
data seg size (kbytes, -d)
建議使用者設定為1048576(即1GB)以上或unlimited(無限制),此引數過小將導致資料庫啟動失敗。
2. file size
file size(blocks, -f)
建議使用者設定為unlimited(無限制),此引數過小將導致資料庫安裝或初始化失敗。
3. open files
open files(-n)
建議使用者設定為65536以上或unlimited(無限制)。
4.virtual memory
virtual memory (kbytes, -v)
建議使用者設定為1048576(即1GB)以上或unlimited(無限制),此引數過小將導致資料庫啟動失敗。
如果使用者需要為當前安裝使用者更改ulimit的資源限制,請修改檔案/etc/security/limits.conf。
root@dm8dsc1 ~]# vi /etc/security/limits.conf dmdba soft data unlimited dmdba hard data unlimited dmdba soft fsize unlimited dmdba hard fsize unlimited dmdba soft nofile 65536 dmdba hard nofile 65536 [root@dm8dsc2 ~]# vi /etc/security/limits.conf dmdba soft data unlimited dmdba hard data unlimited dmdba soft fsize unlimited dmdba hard fsize unlimited dmdba soft nofile 65536 dmdba hard nofile 65536 [root@dm8dsc1 ~]# su - dmdba [dmdba@dm8dsc1 ~]$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 4096 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited [root@dm8dsc2 ~]# su - dmdba [dmdba@dm8dsc2 ~]$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 4096 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
3.4.檢查系統記憶體與儲存空間
1.檢查記憶體
為了保證DM的正確安裝和執行,要儘量保證作業系統至少1GB的可用記憶體(RAM)。如果可用記憶體過少,可能導致DM安裝或啟動失敗。使用者可以使用以下命令檢查操作記憶體:
#獲取記憶體總大小 [root@dm8dsc1 ~]# grep MemTotal /proc/meminfo MemTotal: 8009068 kB [root@dm8dsc2 ~]# grep MemTotal /proc/meminfo MemTotal: 8009068 kB #獲取交換分割槽大小 [root@dm8dsc1 ~]# grep SwapTotal /proc/meminfo SwapTotal: 8257532 kB [root@dm8dsc2 ~]# grep SwapTotal /proc/meminfo SwapTotal: 8257532 kB #獲取記憶體使用詳情 [root@dm8dsc1 ~]# free -g total used free shared buff/cache available Mem: 7 0 6 0 0 6 Swap: 7 0 7 [root@dm8dsc2 ~]# free -g total used free shared buff/cache available Mem: 7 0 6 0 0 6 Swap: 7 0 7
2.檢查儲存空間
1) DM完全安裝需要1GB的儲存空間,使用者需要提前規劃好安裝目錄,預留足夠的儲存空間。使用者在DM安裝前也應該為資料庫例項預留足夠的儲存空間,規劃好資料路徑和備份路徑。使用者可使用以下命令檢查儲存空間:
#查詢目錄/dm8可用空間 [root@dm8dsc1 ~]# mkdir /dm8 [root@dm8dsc1 ~]# chown -R dmdba:dinstall /dm8 [root@dm8dsc1 ~]# chmod -R 775 /dm8 [root@dm8dsc2 ~]# mkdir /dm8 [root@dm8dsc2 ~]# chown -R dmdba:dinstall /dm8 [root@dm8dsc2 ~]# chmod -R 775 /dm8 [root@dm8dsc1 ~]# df -h /dm8 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% / [root@dm8dsc2 ~]# df -h /dm8 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% /
2) DM安裝程式在安裝時將產生臨時檔案,臨時檔案需要1GB的儲存空間,臨時檔案目錄預設為/tmp。使用者可以使用以下命令檢查儲存空間。
如下圖所示:
[root@dm8dsc1 ~]# df -h /tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% / [root@dm8dsc2 ~]# df -h /tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% /
3.5.安裝DM
建立目錄/soft/dmsoft用來儲存掛載iso檔案後來顯示軟體包中的文
[root@dm8dsc1 ~]# cd /soft [root@dm8dsc1 soft]# unzip dm8_20211021_x86_rh6_64_ent.zip Archive: dm8_20211021_x86_rh6_64_ent.zip creating: dm8_20211021_x86_rh6_64_ent/ inflating: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso extracting: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso_SHA256.txt extracting: dm8_20211021_x86_rh6_64_ent/verinfo.txt [root@dm8dsc1 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8_20211021_x86_rh6_64_ent -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8dsc1 soft]# mv dm8_20211021_x86_rh6_64_ent dm8 [root@dm8dsc1 soft]# mkdir dmsoft [root@dm8dsc1 soft]# mount -t iso9660 -o loop dm8/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso /soft/dmsoft mount: /dev/loop0 is write-protected, mounting read-only [root@dm8dsc1 soft]# cd dmsoft [root@dm8dsc1 dmsoft]# ls -lrt total 790160 -r-xr-xr-x. 1 root root 2802503 Oct 21 14:04 DM8 Install.pdf -r-xr-xr-x. 1 root root 806320703 Oct 21 14:11 DMInstall.bin [root@dm8dsc2 ~]# cd /soft [root@dm8dsc2 soft]# unzip dm8_20211021_x86_rh6_64_ent.zip Archive: dm8_20211021_x86_rh6_64_ent.zip creating: dm8_20211021_x86_rh6_64_ent/ inflating: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso extracting: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso_SHA256.txt extracting: dm8_20211021_x86_rh6_64_ent/verinfo.txt [root@dm8dsc2 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8_20211021_x86_rh6_64_ent -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8dsc2 soft]# mv dm8_20211021_x86_rh6_64_ent dm8 [root@dm8dsc2 soft]# mkdir dmsoft [root@dm8dsc2 soft]# mount -t iso9660 -o loop dm8/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso /soft/dmsoft mount: /dev/loop0 is write-protected, mounting read-only [root@dm8dsc2 soft]# cd dmsoft [root@dm8dsc2 dmsoft]# ls -lrt total 790160 -r-xr-xr-x. 1 root root 2802503 Oct 21 14:04 DM8 Install.pdf -r-xr-xr-x. 1 root root 806320703 Oct 21 14:11 DMInstall.bin
在/soft/dmsoft目錄下存在DMInstall.bin檔案, DMInstall.bin檔案就是DM的安裝程式。在執行安裝程式前,需要賦予DMInstall.bin檔案執行許可權。具體命令如下所示:
[root@dm8dsc1 dmsoft]# chmod 755 DMInstall.bin chmod: changing permissions of ‘DMInstall.bin’: Read-only file system [root@dm8dsc2 dmsoft]# chmod 755 DMInstall.bin chmod: changing permissions of ‘DMInstall.bin’: Read-only file system
在現實中,許多Linux(Unix)作業系統上是沒有圖形化介面的,為了使DM能夠在這些作業系統上順利安裝,DM提供了命令列的安裝方式。在終端進入到安裝程式所在資料夾,執行以下命令進行命令列安裝:
[dmdba@dm8dsc1 dmsoft]$ ./DMInstall.bin -i Please select the installer's language (E/e:English C/c:Chinese) [E/e]:e Extract install files......... Welcome to DM DBMS Installer Whether to input the path of Key File? (Y/y:Yes N/n:No) [Y/y]:n Whether to Set The TimeZone? (Y/y:Yes N/n:No) [Y/y]:y TimeZone: [ 1]: GTM-12=West Date Line [ 2]: GTM-11=Samoa [ 3]: GTM-10=Hawaii [ 4]: GTM-09=Alaska [ 5]: GTM-08=Pacific(America and Canada) [ 6]: GTM-07=Arizona [ 7]: GTM-06=Central(America and Canada) [ 8]: GTM-05=East(America and Canada) [ 9]: GTM-04=Atlantic(America and Canada) [10]: GTM-03=Brasilia [11]: GTM-02=Middle Atlantic [12]: GTM-01=Azores [13]: GTM=Greenwich Mean Time [14]: GTM+01=Sarajevo [15]: GTM+02=Cairo [16]: GTM+03=Moscow [17]: GTM+04=AbuDhabi [18]: GTM+05=Islamabad [19]: GTM+06=Dakar [20]: GTM+07=BangKok,Hanoi [21]: GTM+08=China [22]: GTM+09=Seoul [23]: GTM+10=Guam [24]: GTM+11=Solomon [25]: GTM+12=Fiji [26]: GTM+13=Nukualofa [27]: GTM+14=Kiribati Please Select the TimeZone [21]:21 Installation Type: 1 Typical 2 Server 3 Client 4 Custom Please Input the number of the Installation Type [1 Typical]:4 1 Server component 2 Client component 2.1 Manager 2.2 Monitor 2.3 DTS 2.4 Console 2.5 Analyzer 2.6 DISQL 3 DM Drivers 4 Manual component 5 DBMS Service 5.1 Realtime Audit Service 5.2 Job Service 5.3 Instance Monitor Service 5.4 Assistant Plug-In Service Please Input the number of the Installation Type [1 2 3 4 5]:1 2 3 4 5 Require Space: 1242M Please Input the install path [/home/dmdba/dmdbms]:/dm8 Available Space:39G Please Confirm the install path(/dm8)? (Y/y:Yes N/n:No) [Y/y]:y Pre-Installation Summary Installation Location: /dm8 Require Space: 1242M Available Space: 39G Version Information: Expire Date: Installation Type: Custom Confirm to Install? (Y/y:Yes N/n:No):y 2021-12-08 15:24:33 [INFO] Installing DM DBMS... 2021-12-08 15:24:34 [INFO] Installing BASE Module... 2021-12-08 15:24:36 [INFO] Installing SERVER Module... 2021-12-08 15:24:36 [INFO] Installing CLIENT Module... 2021-12-08 15:24:37 [INFO] Installing DRIVERS Module... 2021-12-08 15:24:37 [INFO] Installing MANUAL Module... 2021-12-08 15:24:37 [INFO] Installing SERVICE Module... 2021-12-08 15:24:43 [INFO] Move log file to log directory. 2021-12-08 15:24:45 [INFO] Installed DM DBMS completely. Please execute the commands by root: /dm8/script/root/root_installer.sh End
以root使用者來執行上面的指令碼
[root@dm8dsc1 dmsoft]# /dm8/script/root/root_installer.sh Move /dm8/bin/dm_svc.conf to /etc Modify the files' mode of DM Server [root@dm8dsc1 dmsoft]# su - dmdba Last login: Wed Dec 8 15:22:23 CST 2021 on pts/2 [dmdba@dm8dsc1 ~]$ cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/dm8/bin" export DM_HOME="/dm8" [dmdba@dm8dsc1 ~]$ vi .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/dm8/bin" export DM_HOME="/dm8" export PATH=$PATH:$LD_LIBRARY_PATH [dmdba@dm8dsc2 dmsoft]$ ./DMInstall.bin -i Please select the installer's language (E/e:English C/c:Chinese) [E/e]:e Extract install files......... Welcome to DM DBMS Installer Whether to input the path of Key File? (Y/y:Yes N/n:No) [Y/y]:n Whether to Set The TimeZone? (Y/y:Yes N/n:No) [Y/y]:y TimeZone: [ 1]: GTM-12=West Date Line [ 2]: GTM-11=Samoa [ 3]: GTM-10=Hawaii [ 4]: GTM-09=Alaska [ 5]: GTM-08=Pacific(America and Canada) [ 6]: GTM-07=Arizona [ 7]: GTM-06=Central(America and Canada) [ 8]: GTM-05=East(America and Canada) [ 9]: GTM-04=Atlantic(America and Canada) [10]: GTM-03=Brasilia [11]: GTM-02=Middle Atlantic [12]: GTM-01=Azores [13]: GTM=Greenwich Mean Time [14]: GTM+01=Sarajevo [15]: GTM+02=Cairo [16]: GTM+03=Moscow [17]: GTM+04=AbuDhabi [18]: GTM+05=Islamabad [19]: GTM+06=Dakar [20]: GTM+07=BangKok,Hanoi [21]: GTM+08=China [22]: GTM+09=Seoul [23]: GTM+10=Guam [24]: GTM+11=Solomon [25]: GTM+12=Fiji [26]: GTM+13=Nukualofa [27]: GTM+14=Kiribati Please Select the TimeZone [21]:21 Installation Type: 1 Typical 2 Server 3 Client 4 Custom Please Input the number of the Installation Type [1 Typical]:4 1 Server component 2 Client component 2.1 Manager 2.2 Monitor 2.3 DTS 2.4 Console 2.5 Analyzer 2.6 DISQL 3 DM Drivers 4 Manual component 5 DBMS Service 5.1 Realtime Audit Service 5.2 Job Service 5.3 Instance Monitor Service 5.4 Assistant Plug-In Service Please Input the number of the Installation Type [1 2 3 4 5]:1 2 3 4 5 Require Space: 1242M Please Input the install path [/home/dmdba/dmdbms]:/dm8 Available Space:39G Please Confirm the install path(/dm8)? (Y/y:Yes N/n:No) [Y/y]:y Pre-Installation Summary Installation Location: /dm8 Require Space: 1242M Available Space: 39G Version Information: Expire Date: Installation Type: Custom Confirm to Install? (Y/y:Yes N/n:No):y 2021-12-08 15:26:51 [INFO] Installing DM DBMS... 2021-12-08 15:26:51 [INFO] Installing BASE Module... 2021-12-08 15:26:54 [INFO] Installing SERVER Module... 2021-12-08 15:26:55 [INFO] Installing CLIENT Module... 2021-12-08 15:27:03 [INFO] Installing DRIVERS Module... 2021-12-08 15:27:03 [INFO] Installing MANUAL Module... 2021-12-08 15:27:03 [INFO] Installing SERVICE Module... 2021-12-08 15:27:10 [INFO] Move log file to log directory. 2021-12-08 15:27:15 [INFO] Installed DM DBMS completely. Please execute the commands by root: /dm8/script/root/root_installer.sh End
以root使用者來執行上面的指令碼
[root@dm8dsc2 dmsoft]# /dm8/script/root/root_installer.sh Move /dm8/bin/dm_svc.conf to /etc Modify the files' mode of DM Server [root@dm8dsc2 dmsoft]# su - dmdba Last login: Wed Dec 8 15:22:48 CST 2021 on pts/2 [dmdba@dm8dsc2 ~]$ cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/dm8/bin" export DM_HOME="/dm8" [dmdba@dm8dsc2 ~]$ vi .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/dm8/bin" export DM_HOME="/dm8" export PATH=$PATH:$LD_LIBRARY_PATH
四、繫結UDEV
編輯/etc/udev/rules.d/99-dm-devices.rules檔案
[root@dm8dsc1 dmsoft]# cd /etc/udev/rules.d/ [root@dm8dsc1 rules.d]# vi 99-dm-devices.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=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sdd2", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="sdd3", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="sdd4", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw7 %N" ACTION=="add", KERNEL=="sde2", RUN+="/bin/raw /dev/raw/raw8 %N" ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw9 %N" ACTION=="add", KERNEL=="sdf2", RUN+="/bin/raw /dev/raw/raw10 %N" ACTION=="add", KERNEL=="sdg1", RUN+="/bin/raw /dev/raw/raw11 %N" ACTION=="add", KERNEL=="sdg2", RUN+="/bin/raw /dev/raw/raw12 %N" ACTION=="add", KERNEL=="raw[1-12]", OWNER="dmdba", GROUP="dinstall", MODE="660" [root@dm8dsc2 dmsoft]# cd /etc/udev/rules.d/ [root@dm8dsc2 rules.d]# vi 99-dm-devices.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=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sdd2", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="sdd3", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="sdd4", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw7 %N" ACTION=="add", KERNEL=="sde2", RUN+="/bin/raw /dev/raw/raw8 %N" ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw9 %N" ACTION=="add", KERNEL=="sdf2", RUN+="/bin/raw /dev/raw/raw10 %N" ACTION=="add", KERNEL=="sdg1", RUN+="/bin/raw /dev/raw/raw11 %N" ACTION=="add", KERNEL=="sdg2", RUN+="/bin/raw /dev/raw/raw12 %N" ACTION=="add", KERNEL=="raw[1-12]", OWNER="dmdba", GROUP="dinstall", MODE="660" ~ [root@dm8dsc1 rules.d]# /sbin/udevadm trigger --type=devices --action=change [root@dm8dsc1 rules.d]# ls -lrt /dev/raw total 0 crw-rw----. 1 root disk 162, 0 Dec 8 15:37 rawctl [root@dm8dsc2 rules.d]# /sbin/udevadm trigger --type=devices --action=change [root@dm8dsc2 rules.d]# ls -lrt /dev/raw total 0 crw-rw----. 1 root disk 162, 0 Dec 8 15:37 rawctl
如果不能正常顯示就重啟作業系統
[root@dm8dsc1 ~]# ls -lrt /dev/raw total 0 crw-rw---- 1 root disk 162, 0 Dec 8 15:38 rawctl crw-rw---- 1 root disk 162, 5 Dec 8 15:38 raw5 crw-rw---- 1 root disk 162, 4 Dec 8 15:38 raw4 crw-rw---- 1 root disk 162, 3 Dec 8 15:38 raw3 crw-rw---- 1 dmdba dinstall 162, 2 Dec 8 15:38 raw2 crw-rw---- 1 dmdba dinstall 162, 1 Dec 8 15:38 raw1 crw-rw---- 1 root disk 162, 9 Dec 8 15:38 raw9 crw-rw---- 1 root disk 162, 8 Dec 8 15:38 raw8 crw-rw---- 1 root disk 162, 7 Dec 8 15:38 raw7 crw-rw---- 1 root disk 162, 6 Dec 8 15:38 raw6 crw-rw---- 1 root disk 162, 12 Dec 8 15:38 raw12 crw-rw---- 1 root disk 162, 11 Dec 8 15:38 raw11 crw-rw---- 1 root disk 162, 10 Dec 8 15:38 raw10 [root@dm8dsc2 ~]# ls -lrt /dev/raw total 0 crw-rw---- 1 root disk 162, 0 Dec 8 15:38 rawctl crw-rw---- 1 root disk 162, 7 Dec 8 15:38 raw7 crw-rw---- 1 dmdba dinstall 162, 2 Dec 8 15:38 raw2 crw-rw---- 1 dmdba dinstall 162, 1 Dec 8 15:38 raw1 crw-rw---- 1 root disk 162, 9 Dec 8 15:38 raw9 crw-rw---- 1 root disk 162, 8 Dec 8 15:38 raw8 crw-rw---- 1 root disk 162, 5 Dec 8 15:38 raw5 crw-rw---- 1 root disk 162, 4 Dec 8 15:38 raw4 crw-rw---- 1 root disk 162, 3 Dec 8 15:38 raw3 crw-rw---- 1 root disk 162, 11 Dec 8 15:38 raw11 crw-rw---- 1 root disk 162, 10 Dec 8 15:38 raw10 crw-rw---- 1 root disk 162, 6 Dec 8 15:38 raw6 crw-rw---- 1 root disk 162, 12 Dec 8 15:38 raw12 [root@dm8dsc1 ~]# vi /etc/rc.d/rc.local #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In contrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot. touch /var/lock/subsys/local chown dmdba:dinstall /dev/raw/raw[1-12] chmod 660 /dev/raw/raw[1-12] [root@dm8dsc1 ~]# vi /etc/rc.d/rc.local #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In contrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot. touch /var/lock/subsys/local chown dmdba:dinstall /dev/raw/raw[1-12] chmod 660 /dev/raw/raw[1-12]
修改裸裝置的許可權防止因為重啟許可權不正確導致dmasmcmd不能識別
[root@dm8dsc1 ~]# ls -lrt /dev/raw/ total 0 crw-rw---- 1 root disk 162, 0 Dec 8 16:27 rawctl crw-rw---- 1 dmdba dinstall 162, 9 Dec 8 16:27 raw9 crw-rw---- 1 dmdba dinstall 162, 10 Dec 8 16:27 raw10 crw-rw---- 1 dmdba dinstall 162, 6 Dec 8 16:27 raw6 crw-rw---- 1 dmdba dinstall 162, 5 Dec 8 16:27 raw5 crw-rw---- 1 dmdba dinstall 162, 3 Dec 8 16:27 raw3 crw-rw---- 1 dmdba dinstall 162, 2 Dec 8 16:27 raw2 crw-rw---- 1 dmdba dinstall 162, 1 Dec 8 16:27 raw1 crw-rw---- 1 dmdba dinstall 162, 8 Dec 8 16:27 raw8 crw-rw---- 1 dmdba dinstall 162, 7 Dec 8 16:27 raw7 crw-rw---- 1 dmdba dinstall 162, 4 Dec 8 16:27 raw4 crw-rw---- 1 dmdba dinstall 162, 12 Dec 8 16:27 raw12 crw-rw---- 1 dmdba dinstall 162, 11 Dec 8 16:27 raw11 [root@dm8dsc2 ~]# ls -lrt /dev/raw/ total 0 crw-rw---- 1 root disk 162, 0 Dec 8 16:26 rawctl crw-rw---- 1 dmdba dinstall 162, 1 Dec 8 16:26 raw1 crw-rw---- 1 dmdba dinstall 162, 5 Dec 8 16:26 raw5 crw-rw---- 1 dmdba dinstall 162, 2 Dec 8 16:26 raw2 crw-rw---- 1 dmdba dinstall 162, 8 Dec 8 16:26 raw8 crw-rw---- 1 dmdba dinstall 162, 7 Dec 8 16:26 raw7 crw-rw---- 1 dmdba dinstall 162, 6 Dec 8 16:26 raw6 crw-rw---- 1 dmdba dinstall 162, 4 Dec 8 16:26 raw4 crw-rw---- 1 dmdba dinstall 162, 3 Dec 8 16:26 raw3 crw-rw---- 1 dmdba dinstall 162, 11 Dec 8 16:26 raw11 crw-rw---- 1 dmdba dinstall 162, 9 Dec 8 16:26 raw9 crw-rw---- 1 dmdba dinstall 162, 12 Dec 8 16:26 raw12 crw-rw---- 1 dmdba dinstall 162, 10 Dec 8 16:26 raw10
可以透過blockdev --getsize64 /dev/raw/raw1命令檢視裸裝置大小
[root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw1 2147483648 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw2 2147483648 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw3 2147483648 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw4 2147483648 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw5 2147483648 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw6 2147483648 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw7 5368709120 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw8 5367660544 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw9 5368709120 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw10 5367660544 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw11 5368709120 [root@dm8dsc1 ~]# blockdev --getsize64 /dev/raw/raw12 5367660544 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw1 2147483648 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw2 2147483648 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw3 2147483648 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw4 2147483648 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw5 2147483648 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw6 2147483648 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw7 5368709120 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw8 5367660544 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw9 5368709120 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw10 5367660544 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw11 5368709120 [root@dm8dsc2 ~]# blockdev --getsize64 /dev/raw/raw12 5367660544
五.配置dmdcr_cfg.ini檔案
在2個節點的/dm8/data目錄下建立配置檔案dmdcr_cfg.ini,在檔案中新增如下內容:
[root@dm8dsc1 ~]# su - dmdba Last login: Wed Dec 8 15:27:56 CST 2021 on pts/1 [dmdba@dm8dsc1 ~]$ mkdir /dm8/data [root@dm8dsc2 ~]# su - dmdba Last login: Wed Dec 8 15:27:32 CST 2021 on pts/1 [dmdba@dm8dsc2 ~]$ mkdir /dm8/data [dmdba@dm8dsc1 ~]$ cd /dm8/data [dmdba@dm8dsc1 data]$ vi dmdcr_cfg.ini DCR_N_GRP = 2 DCR_VTD_PATH = /dev/raw/raw2 DCR_OGUID = 63635 [GRP] DCR_GRP_TYPE = CSS DCR_GRP_NAME = GRP_CSS DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_CSS] DCR_EP_NAME = CSS0 DCR_EP_HOST = 11.11.11.3 DCR_EP_PORT = 9541 [GRP_CSS] DCR_EP_NAME = CSS1 DCR_EP_HOST = 11.11.11.4 DCR_EP_PORT = 9541 [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 = DSC0 DCR_EP_SEQNO = 0 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741 [GRP_DSC] DCR_EP_NAME = DSC1 DCR_EP_SEQNO = 1 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741 [dmdba@dm8dsc2 ~]$ cd /dm8/data [dmdba@dm8dsc2 data]$ vi dmdcr_cfg.ini DCR_N_GRP = 2 DCR_VTD_PATH = /dev/raw/raw2 DCR_OGUID = 63635 [GRP] DCR_GRP_TYPE = CSS DCR_GRP_NAME = GRP_CSS DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_CSS] DCR_EP_NAME = CSS0 DCR_EP_HOST = 11.11.11.3 DCR_EP_PORT = 9541 [GRP_CSS] DCR_EP_NAME = CSS1 DCR_EP_HOST = 11.11.11.4 DCR_EP_PORT = 9541 [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 = DSC0 DCR_EP_SEQNO = 0 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741 [GRP_DSC] DCR_EP_NAME = DSC1 DCR_EP_SEQNO = 1 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741
六、使用 DMASMCMD 工具初始化(任意一節點執行)
[dmdba@dm8dsc1 ~]$ dmasmcmd DMASMCMD V8 ASM>create dcrdisk '/dev/raw/raw1' 'dcr' [Trace]The ASM initialize dcrdisk /dev/raw/raw1 to name DMASMdcr Used time: 269.118(ms). ASM>create votedisk '/dev/raw/raw2' 'vote' [Trace]The ASM initialize votedisk /dev/raw/raw2 to name DMASMvote Used time: 108.701(ms). ASM>init dcrdisk '/dev/raw/raw1' from '/dm8/data/dmdcr_cfg.ini' identified by 'dameng123' [Trace]DG 126 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1). [Trace]DG 126 allocate 4 extents for file 0xfe000002. [Trace]DG 126 alloc 4 extents for 0xfe000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1. Used time: 00:00:02.244. ASM>init votedisk '/dev/raw/raw2' from '/dm8/data/dmdcr_cfg.ini' [Trace]DG 125 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1). [Trace]DG 125 allocate 4 extents for file 0xfd000002. [Trace]DG 125 alloc 4 extents for 0xfd000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1. Used time: 431.131(ms).
七.準備dmdcr.ini 配置檔案
dmdcr.ini 是 dmcss、dmasmsvr、dmasmtool 工具的輸入引數。記錄了當前節點序列號以及 DCR 磁碟路徑。在2個節點的/dm8/data目錄下建立dmdcr.ini 配置檔案,dmdcr_path 相同,dmasvrmal.ini 檔案內容也相同,dmdcr_seqo 分別為 0 和 1。
節點 1:
[dmdba@dm8dsc1 data]$ vi dmdcr.ini DMDCR_PATH = /dev/raw/raw1 DMDCR_SEQNO = 0 #DB DMDCR_DB_RESTART_INTERVAL = 0 DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dm8/data/dsc0_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini
節點2:
[dmdba@dm8dsc2 data]$ vi dmdcr.ini DMDCR_PATH = /dev/raw/raw1 DMDCR_SEQNO = 1 #DB DMDCR_DB_RESTART_INTERVAL = 0 DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dm8/data/dsc1_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini
八.啟動DMCSS服務程式
1、註冊 DMCSS
節點一:
[root@dm8dsc1 ~]# /dm8/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm8/data/dmdcr.ini -p dsc1 Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicedsc1.service to /usr/lib/systemd/system/DmCSSServicedsc1.service. Finished to create the service (DmCSSServicedsc1)
節點二:
[root@dm8dsc2 ~]# /dm8/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm8/data/dmdcr.ini -p dsc2 Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicedsc2.service to /usr/lib/systemd/system/DmCSSServicedsc2.service. Finished to create the service (DmCSSServicedsc2)
2、啟動DMCSS 服務
節點一:
[root@dm8dsc1 ~]# service DmCSSServicedsc1 start Redirecting to /bin/systemctl start DmCSSServicedsc1.service [root@dm8dsc1 ~]# service DmCSSServicedsc1 status Redirecting to /bin/systemctl status DmCSSServicedsc1.service DmCSSServicedsc1.service - DM Cluster Synchronization Services Service(DmCSSServicedsc1). Loaded: loaded (/usr/lib/systemd/system/DmCSSServicedsc1.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-12-08 17:19:47 CST; 38s ago Process: 3776 ExecStart=/dm8/bin/DmCSSServicedsc1 start (code=exited, status=0/SUCCESS) Main PID: 3800 (dmcss) Tasks: 9 CGroup: /system.slice/DmCSSServicedsc1.service └─3800 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini Dec 08 17:19:32 dm8dsc1 systemd[1]: Starting DM Cluster Synchronization Services Service(DmCSSServicedsc1).... Dec 08 17:19:47 dm8dsc1 DmCSSServicedsc1[3776]: [38B blob data] Dec 08 17:19:47 dm8dsc1 systemd[1]: Started DM Cluster Synchronization Services Service(DmCSSServicedsc1)..
節點二:
[root@dm8dsc2 ~]# service DmCSSServicedsc2 start Redirecting to /bin/systemctl start DmCSSServicedsc2.service [root@dm8dsc2 ~]# service DmCSSServicedsc2 status Redirecting to /bin/systemctl status DmCSSServicedsc2.service DmCSSServicedsc2.service - DM Cluster Synchronization Services Service(DmCSSServicedsc2). Loaded: loaded (/usr/lib/systemd/system/DmCSSServicedsc2.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-12-08 17:20:19 CST; 13s ago Process: 3546 ExecStart=/dm8/bin/DmCSSServicedsc2 start (code=exited, status=0/SUCCESS) Main PID: 3569 (dmcss) Tasks: 9 CGroup: /system.slice/DmCSSServicedsc2.service └─3569 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini Dec 08 17:20:04 dm8dsc2 systemd[1]: Starting DM Cluster Synchronization Services Service(DmCSSServicedsc2).... Dec 08 17:20:19 dm8dsc2 DmCSSServicedsc2[3546]: [38B blob data] Dec 08 17:20:19 dm8dsc2 systemd[1]: Started DM Cluster Synchronization Services Service(DmCSSServicedsc2)..
九.作業系統配置準備配置dminit.ini檔案,存放在/dm8/data目錄中(資料檔案儲存在/dev/raw/raw3-6裸裝置上,日誌檔案儲存在/dev/raw/raw7-10
[dmdba@dm8dsc1 data]$ vi dminit.ini system_path = /dm8/data db_name=dsc main = /dev/raw/raw3 main_size = 128 roll = /dev/raw/raw4 roll_size = 128 system = /dev/raw/raw5 system_size = 128 ctl_path = /dev/raw/raw6 ctl_size = 8 dcr_path=/dev/raw/raw1 dcr_seqno=0 [dsc0] config_path=/dm8/data/dsc0_config port_num = 5236 mal_host = 11.11.11.3 mal_port = 9340 log_size = 256 log_path = /dev/raw/raw7 log_path = /dev/raw/raw8 [dsc1] config_path=/dm8/data/dsc1_config port_num = 5236 mal_host = 11.11.11.4 mal_port = 9341 log_size = 256 log_path = /dev/raw/raw9 log_path = /dev/raw/raw10
十、作業系統配置使用dminit初始化DB環境
在任意節點啟動 dminit 工具初始化資料庫。dminit 執行完成後,會在 config_path 目錄(/dm8/data/dsc0_config 和/dm8/data/dsc1_config)下生成配置檔案 dm.ini 和 dmmal.ini。
[dmdba@dm8dsc1 data]$ dminit control=/dm8/data/dminit.ini initdb V8 db version: 0x7000c file dm.key not found, use default license! License will expire on 2022-10-21 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL log file path: /dev/raw/raw7 log file path: /dev/raw/raw8 log file path: /dev/raw/raw9 log file path: /dev/raw/raw10 FILE "/dev/raw/raw5" has already existed FILE "/dev/raw/raw4" has already existed FILE "/dev/raw/raw3" has already existed FILE "/dev/raw/raw6" has already existed FILE "/dev/raw/raw7" has already existed FILE "/dev/raw/raw8" has already existed FILE "/dev/raw/raw9" has already existed FILE "/dev/raw/raw10" has already existed File "/dev/raw/raw5" has already existed, whether overwrite(y/n, 1/0): y File "/dev/raw/raw4" has already existed, whether overwrite(y/n, 1/0): y File "/dev/raw/raw3" has already existed, whether overwrite(y/n, 1/0): y File "/dev/raw/raw6" has already existed, whether overwrite(y/n, 1/0): y File "/dev/raw/raw7" has already existed, whether overwrite(y/n, 1/0): y File "/dev/raw/raw8" has already existed, whether overwrite(y/n, 1/0): y File "/dev/raw/raw9" has already existed, whether overwrite(y/n, 1/0): y File "/dev/raw/raw10" has already existed, whether overwrite(y/n, 1/0): y write to dir [/dm8/data/dsc]. create dm database success. 2021-12-08 17:30:36 [dmdba@dm8dsc1 data]$ ls -lrt total 12 -rw-r--r-- 1 dmdba dinstall 563 Dec 8 16:49 dmdcr_cfg.ini -rw-r--r-- 1 dmdba dinstall 182 Dec 8 17:05 dmdcr.ini -rw-r--r-- 1 dmdba dinstall 546 Dec 8 17:28 dminit.ini drwxr-xr-x 2 dmdba dinstall 87 Dec 8 17:30 dsc0_config drwxr-xr-x 2 dmdba dinstall 55 Dec 8 17:30 dsc1_config drwxr-xr-x 5 dmdba dinstall 70 Dec 8 17:30 dsc
將節點一的配置檔案複製到節點二:
[dmdba@dm8dsc1 data]$ scp -r dsc1_config 10.10.13.206:`pwd` The authenticity of host '10.10.13.206 (10.10.13.206)' can't be established. ECDSA key fingerprint is SHA256:6O8c9WEeEYPbL4ncdRR1RsrjxxmfzPq9Tkq4/6uLSP4. ECDSA key fingerprint is MD5:e1:73:3e:8d:79:be:5c:82:0f:c7:58:79:45:ad:df:86. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.10.13.206' (ECDSA) to the list of known hosts. dmdba@10.10.13.206's password: dmmal.ini 100% 200 17.0KB/s 00:00 dm.ini 100% 52KB 2.2MB/s 00:00 sqllog.ini 100% 481 53.4KB/s 00:00
一定要將節點一/dm8/data/目錄中生成的dsc目錄複製到節點二的/dm8/data目錄中,否則在節點二中啟動資料庫時會出現以下錯誤,原因就是因為使用裸裝置時生成的dsc目錄及其檔案不是儲存在共享儲存中可以讓叢集節點都能訪問。
Starting DmServicerac2: [ FAILED ] file dm.key not found, use default license! Read ini warning, default dm.ctl backup path [/dm8/data/dsc/ctl_bak] does not exist. Read ini error, name:SYSTEM_PATH, value:/dm8/data/dsc dmserver startup failed, code = -803 [Invalid ini config value]
將節點一/dm8/data/目錄中生成的dsc目錄複製到節點二的/dm8/data目錄
[dmdba@dm8dsc1 data]$ scp -r dsc 10.10.13.206:`pwd` dmdba@10.10.13.206's password: dm_20211208173029_111982.ctl 100% 6144 493.8KB/s 00:00 dm_service.prikey 100% 633 57.0KB/s 00:00
十一. 啟動資料庫伺服器
1、在2個節點分別註冊DM 資料庫服務:
節點一:
[root@dm8dsc1 init.d]# /dm8/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm8/data/dsc0_config/dm.ini -dcr_ini /dm8/data/dmdcr.ini -p dsc1 dmserver(RAC) need to be set the dependent service(dmasmsvr)!
提示需要依賴服務dmasmsvr,但使用裸裝置沒有配置dmasm例項,所以只能手動啟動服務
手工啟動命令如下,手工啟動後視窗不能關閉
[dmdba@dm8dsc1 ~]$ dmserver /dm8/data/dsc0_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini & [dmdba@dm8dsc2 ~]$ dmserver /dm8/data/dsc1_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini &
如果DMCSS配置有自動拉起dmserver的功能,可以等待DMCSS自動拉起例項,不需要手動啟動。在dmdcr.ini檔案中配置如下選項
#DB DMDCR_DB_RESTART_INTERVAL = 10 DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dm8/data/dsc0_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini
十二.連線資料庫驗證
1.配置服務名檔案
[dmdba@dm8dsc1 ~]$ vi /etc/dm_svc.conf TIME_ZONE=(480) LANGUAGE=(en) rac=(10.10.13.205:5236,10.10.13.206:5236) SWITCH_TIME=(10000) SWITCH_INTERVAL=(10) [dmdba@dm8dsc2 ~]$ vi /etc/dm_svc.conf TIME_ZONE=(480) LANGUAGE=(en) rac=(10.10.13.205:5236,10.10.13.206:5236) SWITCH_TIME=(10000) SWITCH_INTERVAL=(10)
2.連線RAC叢集
節點一:
[dmdba@dm8dsc1 ~]$ disql SYSDBA/SYSDBA@rac Server[10.10.13.205:5236]:mode is normal, state is open login used time : 4.303(ms) disql V8 SQL> select * from v$instance; LINEID NAME INSTANCE_NAME INSTANCE_NUMBER HOST_NAME SVR_VERSION DB_VERSION START_TIME STATUS$ MODE$ OGUID DSC_SEQNO DSC_ROLE ---------- ---- ------------- --------------- --------- -------------------------- ------------------- ------------------- ------- ------ ----------- ----------- ------------ 1 DSC0 DSC0 1 dm8dsc1 DM Database Server x64 V8 DB Version: 0x7000c 2021-12-09 12:56:06 OPEN NORMAL 0 0 Control node used time: 6.832(ms). Execute id is 400. SQL> select * from v$dsc_ep_info; LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS ---------- ------- ----------- -------------------- -------------------- ------------ --------- 1 DSC0 0 2477818562 2477826305 Control Node OK 2 DSC1 1 2477823752 2477831486 Normal Node OK used time: 1.221(ms). Execute id is 401. SQL>
節點二:
[dmdba@dm8dsc2 ~]$ disql SYSDBA/SYSDBA@rac Server[10.10.13.205:5236]:mode is normal, state is open login used time : 3.048(ms) disql V8 SQL> select * from v$instance; LINEID NAME INSTANCE_NAME INSTANCE_NUMBER HOST_NAME SVR_VERSION DB_VERSION START_TIME STATUS$ MODE$ OGUID DSC_SEQNO DSC_ROLE ---------- ---- ------------- --------------- --------- -------------------------- ------------------- ------------------- ------- ------ ----------- ----------- ------------ 1 DSC0 DSC0 1 dm8dsc1 DM Database Server x64 V8 DB Version: 0x7000c 2021-12-09 12:56:06 OPEN NORMAL 0 0 Control node used time: 5.261(ms). Execute id is 500. SQL> select * from v$dsc_ep_info; LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS ---------- ------- ----------- -------------------- -------------------- ------------ --------- 1 DSC0 0 2477818562 2477826342 Control Node OK 2 DSC1 1 2477823752 2477831523 Normal Node OK used time: 1.499(ms). Execute id is 501.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2871091/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DM7使用裸裝置搭建DMRAC
- DM8使用共享儲存DMASM搭建DMRACASM
- raw 裸裝置資料檔案更改其他raw裸裝置位置
- Linux裸裝置總結Linux
- AIX中的裸裝置AI
- DM7使用DMASM安裝DMRACASM
- linux udev裸裝置繫結Linuxdev
- rhel 7.x 使用 udev scsi rules 配置裸裝置dev
- vmware + 裸裝置 + crs + oracle10g RAC搭建步驟(二):安裝linuxOracleLinux
- 記錄一則AIX使用裸裝置安裝OracleRAC的問題AIOracle
- 基於裸裝置的ASM磁碟組擴容方案ASM
- DM8搭建MPP叢集
- Linux下基於裸裝置建立10g資料庫Linux資料庫
- DM8搭建2節點DMDSC
- DM8 MPP主備環境搭建
- DM8 實時主備環境搭建
- 在 Android 裝置上搭建 Web 伺服器AndroidWeb伺服器
- emc cx500上的基於linux的3節點rac上的裸裝置的使用和效能測試Linux
- DM8 資料守護實時主備搭建
- 使用adb如何批量給裝置安裝apkAPK
- 遠端裝置管理opendx平臺搭建-server,agent以及front實際搭建Server
- 使用者不是外圍裝置
- 利用rman copy的方法實現儲存上裸裝置資料檔案的遷移ITPUB
- modbustcp封裝使用獲取裝置資料示例TCP封裝
- Steam:有1.29%的Steam使用者使用VR裝置VR
- 原型裝置使用使用者的身體來防止可穿戴裝置和植入物遭黑客攻擊原型黑客
- GPU 環境搭建指南:如何在裸機、Docker、K8s 等環境中使用 GPUGPUDockerK8S
- 使用 EMQX 接入 MQTT-SN 協議裝置MQQT協議
- 【達夢】Docker安裝達夢資料庫 dm8Docker資料庫
- 裝置地址
- linux 系統上搭建 ios 測試環境可以使用什麼工具連線到 ios 裝置LinuxiOS
- 字元裝置驅動 —— 字元裝置驅動框架字元框架
- 使用無線模組構建可穿戴裝置
- Linux 下使用 NetLink 檢測裝置的熱插拔Linux
- 使用 Syncthing 在多個裝置間同步檔案
- 如何使用藍芽裝置喚醒您的Mac藍芽Mac
- 使用lsblk命令列出系統中的塊裝置命令列
- win10禁用所有usb儲存裝置方法 win10如何禁止使用usb儲存裝置Win10