1.环境准备
硬件:两台相同配置机器,8G内存,80G本地磁盘,2块网卡,另有6块共享磁盘大小分别为2G,2G,10G,10G,10G,10G 操作系统:RedHat Linux 64位。
网络配置:ens32网卡为10.10.10.0内网网段,两台机器分别为10.10.10.201/10.10.10.202;ens34为11.11.11.0外网网段,两台机器分别为11.11.11.11.1/11.11.11.2。内网网段用于MAL通讯。
DM各种工具位于目录:/dm8/dmdbms/bin。配置文件位于目录:/dm8/data。
搭建2节点DMDSC(DMASM)
1.环境准备
主机 IP地址(对外服务) IP地址(内部通信) 实例名 操作系统 dm8rac1 10.10.10.201 11.11.11.1 rac0 Redhat 7.8 dm8rac2 10.10.10.202 11.11.11.2 rac1 Redhat 7.8 共享存储 /dev/sdb /dev/raw/raw1 dcr disk 2G /dev/sdc /dev/raw/raw2 voting disk 2G /dev/sdd /dev/raw/raw3 log disk 10G /dev/sde /dev/raw/raw4 data disk1 10G /dev/sdf /dev/raw/raw5 data disk2 10G /dev/sdg /dev/raw/raw6 data disk3 10G
二、操作系统配置
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 06 17:22:42 gbase systemd[1]: Starting firewalld - dynamic firewall daemon... Dec 06 17:22:48 gbase systemd[1]: Started firewalld - dynamic firewall daemon. Dec 07 08:21:59 gbase systemd[1]: Stopping firewalld - dynamic firewall daemon... Dec 07 08:22:00 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 06 17:22:45 gbase systemd[1]: Starting firewalld - dynamic firewall daemon... Dec 06 17:22:51 gbase systemd[1]: Started firewalld - dynamic firewall daemon. Dec 07 08:19:39 gbase systemd[1]: Stopping firewalld - dynamic firewall daemon... Dec 07 08:19:40 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 ~]# hostname dm8rac1 [root@gbase ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm8rac1:g /etc/sysconfig/network [root@gbase ~]# echo " > 10.10.10.201 dm8rac1 > 10.10.10.202 dm8rac2" >> /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.10.201 dm8rac1 10.10.10.202 dm8rac2 [root@gbase ~]# hostname dm8rac2 [root@gbase ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm8rac2:g /etc/sysconfig/network [root@gbase ~]# [root@gbase ~]# echo " > 10.10.10.201 dm8rac1 > 10.10.10.202 dm8rac2" >> /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.10.201 dm8rac1 10.10.10.202 dm8rac2
三、 安装达梦软件
3.1检查Linux(Unix)系统信息
[root@dm8rac1 ~]# getconf LONG_BIT 64 [root@dm8rac2 ~]# getconf LONG_BIT 64
查询操作系统release信息
[root@dm8rac1 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.8 Beta (Maipo) [root@dm8rac2 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.8 Beta (Maipo)
3.2创建安装用户
为了减少对操作系统的影响,用户不应该以root系统用户来安装和运行DM。用户可以在安装之前为DM创建一个专用的系统用户。
1. 创建安装用户组dinstall。
[root@dm8rac1 ~]# groupadd dinstall [root@dm8rac2 ~]# groupadd dinstall
2. 创建安装用户dmdba。
[root@dm8rac1 ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba [root@dm8rac2 ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
3. 初始化用户密码。
[root@dm8rac1 ~]# passwd dmdba Changing password for user dmdba. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@dm8rac2 ~]# 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@dm8rac1 ~]# 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@dm8rac2 ~]# 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@dm8rac1 ~]# 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@dm8rac2 ~]# 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@dm8rac1 ~]# su - dmdba [dmdba@dm8rac1 ~]$ 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@dm8rac2 ~]# su - dmdba [dmdba@dm8rac2 ~]$ 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@dm8rac1 ~]# grep MemTotal /proc/meminfo MemTotal: 8009068 kB [root@dm8rac12 ~]# grep MemTotal /proc/meminfo MemTotal: 8009068 kB
#获取交换分区大小
[root@dm8rac1 ~]# grep SwapTotal /proc/meminfo SwapTotal: 8257532 kB [root@dm8rac2 ~]# grep SwapTotal /proc/meminfo SwapTotal: 8257532 kB
#获取内存使用详情
[root@dm8rac1 ~]# free -g total used free shared buff/cache available Mem: 7 0 6 0 0 6 Swap: 7 0 7 [root@dm8rac2 ~]# 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@dm8rac1 ~]# mkdir /dm8 [root@dm8rac1 ~]# chown -R dmdba:dinstall /dm8 [root@dm8rac1 ~]# chmod -R 775 /dm8 [root@dm8rac2 ~]# mkdir /dm8 [root@dm8rac2 ~]# chown -R dmdba:dinstall /dm8 [root@dm8rac2 ~]# chmod -R 775 /dm8 [root@dm8rac1 ~]# df -h /dm8 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% / [root@dm8rac2 ~]# df -h /dm8 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% /
2) DM安装程序在安装时将产生临时文件,临时文件需要1GB的存储空间,临时文件目录默认为/tmp。用户可以使用以下命令检查存储空间。
如下图所示:
[root@dm8rac1 ~]# df -h /tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% / [root@dm8rac2 ~]# 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@dm8rac1 ~]# cd /soft [root@dm8rac1 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@dm8rac1 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@dm8rac1 soft]# mv dm8_20211021_x86_rh6_64_ent dm8 [root@dm8rac1 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8 -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8rac1 soft]# mkdir dmsoft [root@dm8rac1 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@dm8rac1 soft]# cd dmsoft [root@dm8rac1 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@dm8rac12 ~]# cd /soft [root@dm8rac2 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@dm8rac2 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@dm8rac2 soft]# mv dm8_20211021_x86_rh6_64_ent dm8 [root@dm8rac2 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8 -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8rac2 soft]# mkdir dmsoft [root@dm8rac2 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@dm8rac2 soft]# cd dmsoft [root@dm8rac2 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@dm8rac1 dmsoft]# chmod 755 DMInstall.bin chmod: changing permissions of ‘DMInstall.bin’: Read-only file system [root@dm8rac2 dmsoft]# chmod 755 DMInstall.bin chmod: changing permissions of ‘DMInstall.bin’: Read-only file system
在现实中,许多Linux(Unix)操作系统上是没有图形化界面的,为了使DM能够在这些操作系统上顺利安装,DM提供了命令行的安装方式。在终端进入到安装程序所在文件夹,执行以下命令进行命令行安装:
[dmdba@dm8rac1 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-07 10:57:53 [INFO] Installing DM DBMS... 2021-12-07 10:57:54 [INFO] Installing BASE Module... 2021-12-07 10:57:56 [INFO] Installing SERVER Module... 2021-12-07 10:57:56 [INFO] Installing CLIENT Module... 2021-12-07 10:57:57 [INFO] Installing DRIVERS Module... 2021-12-07 10:57:57 [INFO] Installing MANUAL Module... 2021-12-07 10:57:57 [INFO] Installing SERVICE Module... 2021-12-07 10:58:03 [INFO] Move log file to log directory. 2021-12-07 10:58:05 [INFO] Installed DM DBMS completely. Please execute the commands by root: /dm8/script/root/root_installer.sh End
以root用户来执行上面的脚本
[root@dm8rac1 ~]# /dm8/script/root/root_installer.sh Move /dm8/bin/dm_svc.conf to /etc Modify the files' mode of DM Server [dmdba@dm8rac2 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-07 10:57:53 [INFO] Installing DM DBMS... 2021-12-07 10:57:54 [INFO] Installing BASE Module... 2021-12-07 10:57:56 [INFO] Installing SERVER Module... 2021-12-07 10:57:56 [INFO] Installing CLIENT Module... 2021-12-07 10:57:57 [INFO] Installing DRIVERS Module... 2021-12-07 10:57:57 [INFO] Installing MANUAL Module... 2021-12-07 10:57:57 [INFO] Installing SERVICE Module... 2021-12-07 10:58:03 [INFO] Move log file to log directory. 2021-12-07 10:58:05 [INFO] Installed DM DBMS completely. Please execute the commands by root: /dm8/script/root/root_installer.sh End
以root用户来执行上面的脚本
[root@dm8rac2 ~]# /dm8/script/root/root_installer.sh Move /dm8/bin/dm_svc.conf to /etc Modify the files' mode of DM Server
四、绑定UDEV
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=="sdd", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sde", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="sdf", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="sdg", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="raw[1-6]", OWNER="dmdba", GROUP="dinstall", MODE="660" [root@dm8rac1 rules.d]# /sbin/udevadm trigger --type=devices --action=change [root@dm8rac2 rules.d]# /sbin/udevadm trigger --type=devices --action=change
如果不能正常显示就重启操作系统
[root@dm8rac1 ~]# ls -lrt /dev/raw total 0 crw-rw---- 1 root disk 162, 0 Dec 7 14:59 rawctl crw-rw---- 1 dmdba dinstall 162, 5 Dec 7 14:59 raw5 crw-rw---- 1 dmdba dinstall 162, 6 Dec 7 14:59 raw6 crw-rw---- 1 dmdba dinstall 162, 4 Dec 7 14:59 raw4 crw-rw---- 1 dmdba dinstall 162, 3 Dec 7 14:59 raw3 crw-rw---- 1 dmdba dinstall 162, 2 Dec 7 14:59 raw2 crw-rw---- 1 dmdba dinstall 162, 1 Dec 7 14:59 raw1 [root@dm8rac2 ~]# ls -lrt /dev/raw total 0 crw-rw---- 1 root disk 162, 0 Dec 7 14:59 rawctl crw-rw---- 1 dmdba dinstall 162, 5 Dec 7 14:59 raw5 crw-rw---- 1 dmdba dinstall 162, 6 Dec 7 14:59 raw6 crw-rw---- 1 dmdba dinstall 162, 4 Dec 7 14:59 raw4 crw-rw---- 1 dmdba dinstall 162, 3 Dec 7 14:59 raw3 crw-rw---- 1 dmdba dinstall 162, 2 Dec 7 14:59 raw2 crw-rw---- 1 dmdba dinstall 162, 1 Dec 7 14:59 raw1
可以通过blockdev –getsize64 /dev/raw/raw1命令查看裸设备大小
[root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw1 2147483648 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw2 2147483648 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw3 10737418240 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw4 10737418240 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw5 10737418240 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw6 10737418240 [root@dm8rac2 ~]# blockdev --getsize64 /dev/raw/raw1 2147483648 [root@dm8rac2 ~]# blockdev --getsize64 /dev/raw/raw2 2147483648 [root@dm8rac3 ~]# blockdev --getsize64 /dev/raw/raw3 10737418240 [root@dm8rac4 ~]# blockdev --getsize64 /dev/raw/raw4 10737418240 [root@dm8rac5 ~]# blockdev --getsize64 /dev/raw/raw5 10737418240 [root@dm8rac6 ~]# blockdev --getsize64 /dev/raw/raw6 10737418240
五.配置dmdcr_cfg.ini文件
在2个节点的/dm8/data目录下创建配置文件dmdcr_cfg.ini,在文件中添加如下内容:
[root@dm8rac1 ~]# su - dmdba Last login: Tue Dec 7 10:58:27 CST 2021 on pts/0 [dmdba@dm8rac1 ~]$ mkdir /dm8/data [root@dm8rac2 ~]# su - dmdba Last login: Tue Dec 7 10:58:27 CST 2021 on pts/0 [dmdba@dm8rac2 ~]$ mkdir /dm8/data [dmdba@dm8rac1 ~]$ cd /dm8/data [dmdba@dm8rac1 data]$ vi dmdcr_cfg.ini DCR_N_GRP = 3 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.1 DCR_EP_PORT = 9541 [GRP_CSS] DCR_EP_NAME = CSS1 DCR_EP_HOST = 11.11.11.2 DCR_EP_PORT = 9541 [GRP] DCR_GRP_TYPE = ASM DCR_GRP_NAME = GRP_ASM DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_ASM] DCR_EP_NAME = ASM0 DCR_EP_SHM_KEY = 93360 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.10.201 DCR_EP_PORT = 9641 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP_ASM] DCR_EP_NAME = ASM1 DCR_EP_SHM_KEY = 93361 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.10.202 DCR_EP_PORT = 9641 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP] DCR_GRP_TYPE = DB DCR_GRP_NAME = GRP_RAC DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_RAC] DCR_EP_NAME = RAC0 DCR_EP_SEQNO = 0 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741 [GRP_RAC] DCR_EP_NAME = RAC1 DCR_EP_SEQNO = 1 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741 [dmdba@dm8rac2 ~]$ cd /dm8/data [dmdba@dm8rac2 data]$ vi dmdcr_cfg.ini DCR_N_GRP = 3 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.1 DCR_EP_PORT = 9541 [GRP_CSS] DCR_EP_NAME = CSS1 DCR_EP_HOST = 11.11.11.2 DCR_EP_PORT = 9541 [GRP] DCR_GRP_TYPE = ASM DCR_GRP_NAME = GRP_ASM DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_ASM] DCR_EP_NAME = ASM0 DCR_EP_SHM_KEY = 93360 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.10.201 DCR_EP_PORT = 9641 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP_ASM] DCR_EP_NAME = ASM1 DCR_EP_SHM_KEY = 93361 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.10.202 DCR_EP_PORT = 9641 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP] DCR_GRP_TYPE = DB DCR_GRP_NAME = GRP_RAC DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_RAC] DCR_EP_NAME = RAC0 DCR_EP_SEQNO = 0 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741 [GRP_RAC] DCR_EP_NAME = RAC1 DCR_EP_SEQNO = 1 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 9741
六.使用 DMASMCMD 工具初始化(任意一节点执行)
[dmdba@dm8rac1 ~]$ dmasmcmd DMASMCMD V8 ASM>create dcrdisk '/dev/raw/raw1' 'dcr' [Trace]The ASM initialize dcrdisk /dev/raw/raw1 to name DMASMdcr Used time: 202.727(ms). ASM>create votedisk '/dev/raw/raw2' 'vote' [Trace]The ASM initialize votedisk /dev/raw/raw2 to name DMASMvote Used time: 184.178(ms). ASM>create asmdisk '/dev/raw/raw3' 'LOG0' [Trace]The ASM initialize asmdisk /dev/raw/raw3 to name DMASMLOG0 Used time: 105.666(ms). ASM>create asmdisk '/dev/raw/raw4' 'DATA0' [Trace]The ASM initialize asmdisk /dev/raw/raw4 to name DMASMDATA0 Used time: 116.970(ms). ASM>create asmdisk '/dev/raw/raw5' 'LOG1' [Trace]The ASM initialize asmdisk /dev/raw/raw5 to name DMASMLOG1 Used time: 174.756(ms). ASM>create asmdisk '/dev/raw/raw6' 'DATA1' [Trace]The ASM initialize asmdisk /dev/raw/raw6 to name DMASMDATA1 Used time: 132.282(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.397. 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: 550.896(ms).
七.准备DMASM 的 MAL 配置文件
在2个节点的/dm8/data目录下创建 DMASM 的 MAL 配置文件(命名为 dmasvrmal.ini),使用 DMASM 的所有节点都要配置,内容完全一样。
[dmdba@dm8rac1 data]$ vi dmasvrmal.ini [MAL_INST1] MAL_INST_NAME = ASM0 MAL_HOST = 11.11.11.1 MAL_PORT = 7236 [MAL_INST2] MAL_INST_NAME = ASM1 MAL_HOST = 11.11.11.2 MAL_PORT = 7236 [dmdba@dm8rac2 data]$ vi dmasvrmal.ini [MAL_INST1] MAL_INST_NAME = ASM0 MAL_HOST = 11.11.11.1 MAL_PORT = 7236 [MAL_INST2] MAL_INST_NAME = ASM1 MAL_HOST = 11.11.11.2 MAL_PORT = 7236
八.准备dmdcr.ini 配置文件
dmdcr.ini 是 dmcss、dmasmsvr、dmasmtool 工具的输入参数。记录了当前节点序列号以及 DCR 磁盘路径。在2个节点的/dm/dmdbms/data目录下创建dmdcr.ini 配置文件,dmdcr_path 相同,dmasvrmal.ini 文件内容也相同,dmdcr_seqo 分别为 0 和 1。
节点 1:
[dmdba@dm8rac1 data]$ vi dmdcr.ini DMDCR_PATH = /dev/raw/raw1 DMDCR_MAL_PATH =/dm8/data/dmasvrmal.ini DMDCR_SEQNO = 0 #ASM DMDCR_ASM_RESTART_INTERVAL = 0 DMDCR_ASM_STARTUP_CMD = /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini #DB DMDCR_DB_RESTART_INTERVAL = 0 DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dm8/data/rac0_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini
节点2:
[dmdba@dm8rac2 data]$ vi dmdcr.ini DMDCR_PATH = /dev/raw/raw1 DMDCR_MAL_PATH =/dm8/data/dmasvrmal.ini DMDCR_SEQNO = 1 #ASM DMDCR_ASM_RESTART_INTERVAL = 0 DMDCR_ASM_STARTUP_CMD = /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini #DB DMDCR_DB_RESTART_INTERVAL = 0 DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dm8/data/rac1_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini
九.启动DMCSS、DMASM 服务程序
1、注册 DMCSS和DMASM服务
节点一:
[root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm8/data/dmdcr.ini -p rac1 Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicerac1.service to /usr/lib/systemd/system/DmCSSServicerac1.service. Finished to create the service (DmCSSServicerac1) [root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm8/data/dmdcr.ini -p rac1 -y DmCSSServicerac1 Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServicerac1.service to /usr/lib/systemd/system/DmASMSvrServicerac1.service. Finished to create the service (DmASMSvrServicerac1)
节点二:
[root@dm8rac2 ~]# /dm8/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm8/data/dmdcr.ini -p rac2 Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicerac2.service to /usr/lib/systemd/system/DmCSSServicerac2.service. Finished to create the service (DmCSSServicerac2) [root@dm8rac2 ~]# /dm8/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm8/data/dmdcr.ini -p rac2 -y DmCSSServicerac2 Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServicerac2.service to /usr/lib/systemd/system/DmASMSvrServicerac2.service. Finished to create the service (DmASMSvrServicerac2)
2、启动DMCSS和DMASM服务
节点一
[root@dm8rac1 ~]# service DmCSSServicerac1 start Redirecting to /bin/systemctl start DmCSSServicerac1.service [root@dm8rac1 ~]# service DmASMSvrServicerac1 start Redirecting to /bin/systemctl start DmASMSvrServicerac1.service [root@dm8rac1 ~]# service DmCSSServicerac1 status Redirecting to /bin/systemctl status DmCSSServicerac1.service DmCSSServicerac1.service - DM Cluster Synchronization Services Service(DmCSSServicerac1). Loaded: loaded (/usr/lib/systemd/system/DmCSSServicerac1.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-12-08 09:50:18 CST; 51s ago Process: 14654 ExecStart=/dm8/bin/DmCSSServicerac1 start (code=exited, status=0/SUCCESS) Main PID: 14682 (dmcss) Tasks: 10 CGroup: /system.slice/DmCSSServicerac1.service └─14682 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini Dec 08 09:50:03 dm8rac1 systemd[1]: Starting DM Cluster Synchronization Services Service(DmCSSServicerac1).... Dec 08 09:50:18 dm8rac1 DmCSSServicerac1[14654]: [38B blob data] Dec 08 09:50:18 dm8rac1 systemd[1]: Started DM Cluster Synchronization Services Service(DmCSSServicerac1).. [root@dm8rac1 ~]# service DmASMSvrServicerac1 status Redirecting to /bin/systemctl status DmASMSvrServicerac1.service DmASMSvrServicerac1.service - DM Auto Storage Manager Service(DmASMSvrServicerac1). Loaded: loaded (/usr/lib/systemd/system/DmASMSvrServicerac1.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-12-08 09:50:58 CST; 31s ago Process: 14729 ExecStart=/dm8/bin/DmASMSvrServicerac1 start (code=exited, status=0/SUCCESS) Main PID: 14755 (dmasmsvr) Tasks: 10 CGroup: /system.slice/DmASMSvrServicerac1.service └─14755 /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini Dec 08 09:50:43 dm8rac1 systemd[1]: Starting DM Auto Storage Manager Service(DmASMSvrServicerac1).... Dec 08 09:50:58 dm8rac1 DmASMSvrServicerac1[14729]: [41B blob data] Dec 08 09:50:58 dm8rac1 systemd[1]: Started DM Auto Storage Manager Service(DmASMSvrServicerac1)..
节点二:
[root@dm8rac2 ~]# service DmCSSServicerac2 start Redirecting to /bin/systemctl start DmCSSServicerac2.service [root@dm8rac2 ~]# service DmASMSvrServicerac2 start Redirecting to /bin/systemctl start DmASMSvrServicerac2.service [root@dm8rac2 ~]# service DmCSSServicerac2 status Redirecting to /bin/systemctl status DmCSSServicerac2.service DmCSSServicerac2.service - DM Cluster Synchronization Services Service(DmCSSServicerac2). Loaded: loaded (/usr/lib/systemd/system/DmCSSServicerac2.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-12-08 09:52:00 CST; 1min 54s ago Process: 14424 ExecStart=/dm8/bin/DmCSSServicerac2 start (code=exited, status=0/SUCCESS) Main PID: 14452 (dmcss) Tasks: 10 CGroup: /system.slice/DmCSSServicerac2.service └─14452 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini Dec 08 09:51:45 dm8rac2 systemd[1]: Starting DM Cluster Synchronization Services Service(DmCSSServicerac2).... Dec 08 09:52:00 dm8rac2 DmCSSServicerac2[14424]: [38B blob data] Dec 08 09:52:00 dm8rac2 systemd[1]: Started DM Cluster Synchronization Services Service(DmCSSServicerac2).. [root@dm8rac2 ~]# service DmASMSvrServicerac2 status Redirecting to /bin/systemctl status DmASMSvrServicerac2.service DmASMSvrServicerac2.service - DM Auto Storage Manager Service(DmASMSvrServicerac2). Loaded: loaded (/usr/lib/systemd/system/DmASMSvrServicerac2.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-12-08 09:52:58 CST; 1min 16s ago Process: 14499 ExecStart=/dm8/bin/DmASMSvrServicerac2 start (code=exited, status=0/SUCCESS) Main PID: 14525 (dmasmsvr) Tasks: 15 CGroup: /system.slice/DmASMSvrServicerac2.service └─14525 /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini Dec 08 09:52:43 dm8rac2 systemd[1]: Starting DM Auto Storage Manager Service(DmASMSvrServicerac2).... Dec 08 09:52:58 dm8rac2 DmASMSvrServicerac2[14499]: [41B blob data] Dec 08 09:52:58 dm8rac2 systemd[1]: Started DM Auto Storage Manager Service(DmASMSvrServicerac2)..
十、创建DMASM磁盘组
在任意节点使用 dmasmtool 工具创建 DMASM 磁盘组。
[dmdba@dm8rac1 ~]$ dmasmtool DCR_INI=/dm8/data/dmdcr.ini DMASMTOOL V8 ASM>create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3' Used time: 358.430(ms). ASM>create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4' Used time: 330.223(ms).
十一、准备dminit.ini 配置文件
在2个节点的/dm8/data目录下创建 dminit.ini 配置文件,添加如下内容。 在2个节点都创建。
[dmdba@dm8rac1 data]$ vi dminit.ini db_name = rac system_path = +DMDATA/data system = +DMDATA/data/rac/system.dbf system_size = 128 roll = +DMDATA/data/rac/roll.dbf roll_size = 128 main = +DMDATA/data/rac/main.dbf main_size = 128 ctl_path = +DMDATA/data/rac/dm.ctl ctl_size = 8 log_size = 256 dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备 dcr_seqno = 0 auto_overwrite = 1 [RAC0] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应 config_path = /dm8/data/rac0_config port_num = 5236 mal_host = 11.11.11.1 mal_port = 9340 log_path = +DMLOG/log/rac0_log01.log log_path = +DMLOG/log/rac0_log02.log [RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应 config_path = /dm8/data/rac1_config port_num = 5236 mal_host = 11.11.11.2 mal_port = 9340 log_path = +DMLOG/log/rac1_log01.log log_path = +DMLOG/log/rac1_log02.log [dmdba@dm8rac2 data]$ vi dminit.ini db_name = rac system_path = +DMDATA/data system = +DMDATA/data/rac/system.dbf system_size = 128 roll = +DMDATA/data/rac/roll.dbf roll_size = 128 main = +DMDATA/data/rac/main.dbf main_size = 128 ctl_path = +DMDATA/data/rac/dm.ctl ctl_size = 8 log_size = 256 dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备 dcr_seqno = 0 auto_overwrite = 1 [RAC0] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应 config_path = /dm8/data/rac0_config port_num = 5236 mal_host = 11.11.11.1 mal_port = 9340 log_path = +DMLOG/log/rac0_log01.log log_path = +DMLOG/log/rac0_log02.log [RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应 config_path = /dm8/data/rac1_config port_num = 5236 mal_host = 11.11.11.2 mal_port = 9340 log_path = +DMLOG/log/rac1_log01.log log_path = +DMLOG/log/rac1_log02.log
十二、使用dminit初始化数据库
在任意节点启动 dminit 工具初始化数据库。dminit 执行完成后,会在 config_path 目录(/dm8/data/rac0_config 和/dm8/data/rac1_config)下生成配置文件 dm.ini 和 dmmal.ini。
[dmdba@dm8rac1 ~]$ 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: +DMLOG/log/rac0_log01.log log file path: +DMLOG/log/rac0_log02.log log file path: +DMLOG/log/rac1_log01.log log file path: +DMLOG/log/rac1_log02.log write to dir [+DMDATA/data/rac]. create dm database success. 2021-12-08 10:17:36
将节点一上的/dm8/data/rac1_config的配置目录复制到节点二:
[dmdba@dm8rac1 data]$ scp -r rac1_config 10.10.10.202:`pwd` The authenticity of host '10.10.10.202 (10.10.10.202)' 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.10.202' (ECDSA) to the list of known hosts. dmdba@10.10.10.202's password: dmmal.ini 100% 200 18.1KB/s 00:00 dm.ini 100% 53KB 2.0MB/s 00:00 sqllog.ini 100% 481 79.8KB/s 00:00 [dmdba@dm8rac1 data]$
十三、启动数据库服务器
1、在2个节点分别注册DM 数据库服务:
节点一:
[root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm8/data/rac0_config/dm.ini -dcr_ini /dm8/data/dmdcr.ini -p rac1 -y DmASMSvrServicerac1 Created symlink from /etc/systemd/system/multi-user.target.wants/DmServicerac1.service to /usr/lib/systemd/system/DmServicerac1.service. Finished to create the service (DmServicerac1)
节点二:
[root@dm8rac2 ~]# /dm8/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm8/data/rac1_config/dm.ini -dcr_ini /dm8/data/dmdcr.ini -p rac2 -y DmASMSvrServicerac2 Created symlink from /etc/systemd/system/multi-user.target.wants/DmServicerac2.service to /usr/lib/systemd/system/DmServicerac2.service. Finished to create the service (DmServicerac2)
2、启动数据库
[root@dm8rac1 ~]# service DmServicerac1 start Redirecting to /bin/systemctl start DmServicerac1.service [root@dm8rac2 ~]# service DmServicerac2 start Redirecting to /bin/systemctl start DmServicerac2.service
手工启动命令如下,手工启动后窗口不能关闭,所以配置成服务。
./dmserver /dm8/data/rac0_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini ./dmserver /dm8/data/rac1_config/dm.ini dcr_ini=/dm8/data/dmdcr.ini
十四.连接数据库验证
1.配置服务名文件
[dmdba@dm8rac1 ~]$ vi /etc/dm_svc.conf TIME_ZONE=(480) LANGUAGE=(en) rac=(10.10.10.201:5236,10.10.10.202:5236) SWITCH_TIME=(10000) SWITCH_INTERVAL=(10) [dmdba@dm8rac2 ~]$ vi /etc/dm_svc.conf TIME_ZONE=(480) LANGUAGE=(en) rac=(10.10.10.201:5236,10.10.10.202:5236) SWITCH_TIME=(10000) SWITCH_INTERVAL=(10)
2.连接RAC集群
节点一:
[dmdba@dm8rac1 ~]$ disql SYSDBA/SYSDBA@rac Server[10.10.10.202:5236]:mode is normal, state is open login used time : 4.611(ms) disql V8 SQL> select instance_name from v$instance; LINEID INSTANCE_NAME ---------- ------------- 1 RAC1 used time: 13.949(ms). Execute id is 100. SQL> select * from v$dsc_ep_info; LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS ---------- ------- ----------- -------------------- -------------------- ------------ --------- 1 RAC0 0 2383210041 2383210694 Control Node OK 2 RAC1 1 2383231629 2383232261 Normal Node OK used time: 3.176(ms). Execute id is 101.
节点二:
[dmdba@dm8rac2 ~]$ disql SYSDBA/SYSDBA@rac Server[10.10.10.201:5236]:mode is normal, state is open login used time : 6.405(ms) disql V8 SQL> select instance_name from v$instance; LINEID INSTANCE_NAME ---------- ------------- 1 RAC0 used time: 5.710(ms). Execute id is 53500. SQL> select * from v$dsc_ep_info; LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS ---------- ------- ----------- -------------------- -------------------- ------------ --------- 1 RAC0 0 2383210041 2383210726 Control Node OK 2 RAC1 1 2383231629 2383232293 Normal Node OK used time: 2.979(ms). Execute id is 53501. SQL>