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.

发表评论

电子邮件地址不会被公开。