DM8数据库DSC集群安装

一、引言

  DM 共享存储数据库集群的英文全称 DM Data Shared Cluster,简称 DMDSC。 DM 共享存储数据库集群,允许多个数据库实例同时访问、操作同一数据库,具有高可用、高性能、负载均衡等特性。DMDSC 支持故障自动切换和故障自动重加入,某一个数据库实例故障后,不会导致数据库服务无法提供。

二、DMDSC概述

  DMDSC 集群是一个多实例、单数据库的系统。多个数据库实例可以同时访问、修改同一个数据库的数据。用户可以登录集群中的任意一个数据库实例,获得完整的数据库服务。 数据文件、控制文件在集群系统中只有一份,不论有几个节点,这些节点都平等地使用这些文件,这些文件保存在共享存储上。每个节点有自己独立的联机日志和归档日志,其中联机日志保存在共享存储上,归档日志可以保存在本地存储上也可以保存在共享存储上。

三、前期准备

3.1硬件准备

服务器2台数据库虚拟机
操作系统Linux dmtest1-10-0-0-1.novalocal 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
网卡每台1块网卡
磁盘阵列共享存储,两台虚拟机都连接到同一个存储上(共享存储只需要映射到服务器端fdisk -l可以查看到就行,不需要格式化)。归档日志和备份数据在本地。
存储规划20G配置文件, 20G配置文件, 100G存储LOG文件 , 其他存放数据文件 , 将归档日志和备份文件放在数据库本地磁盘。

3.2修改系统参数

[root@dmtest1-10-0-0-1 ~]# ulimit –n 65536
[root@dmtest1-10-0-0-1 ~]# vi /etc/security/limits.conf
dmdba soft core unlimited
dmdba hard core unlimited
dmdba soft nofile 65536
dmdba hard nofile 65536
dmdba soft nproc  65536
dmdba hard nproc  65536
dmdba soft stack  65536
dmdba hard stack  65536
[root@dmtest1-10-0-0-1 ~]# vi /etc/profile
  ulimit -SHn 65536
[root@dmtest1-10-0-0-1 ~]# vi /etc/sysctl.conf
[root@dmtest1-10-0-0-1 ~]# sysctl -p
vm.swappiness = 0

3.3关闭防火墙

关闭防火墙,并禁止防火墙服务开机自启。

[root@dmtest1-10-0-0-1 ~]# service iptables stop
[root@dmtest1-10-0-0-1 ~]# service iptables disable

注意:两台机器均需要修改。

四、创建目录并安装数据库

4.1 dmtest1-10-0-0-1.novalocal机器安装数据库

创建dmdba用户,并切换到dmdba用户下,数据库安装在/dm/dmdbms/dmdbms目录下;详细安装步骤参考

https://eco.dameng.com/document/dm/zh-cn/ops/installation-install.html

4.2 dmtest2-10-0-0-2.novalocal机器安装数据库

创建dmdba用户,并切换到dmdba用户下,数据库安装在/dm/dmdbms/dmdbms目录下;

五、存储准备

5.1划存储

用途空间规划
vdb1用于存放dcr配置信息20G
vdb2用于存放vote信息20G
vdb3用于存放redo log100G
vdb4用于存放data其余空间

fdisk /dev/vdb

  1) 依次输入  n p  1  回车  +20480M,完成第一块磁盘划分
  2) 依次输入  n p  2  回车  +20480M,完成第二块磁盘划分
  3) 依次输入  n p  3  回车  +102400M,完成第三块磁盘划分
  4) 依次输入  n p  回车  回车  回车,完成第四块磁盘划分
  5) 输入w命令,将裸设备划分的设置进行保存

5.1.1 挂存储方法一:

[root@dmtest2-10-0-0-2 raw]# cat /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="fa:16:3e:40:0c:3d", NAME="eth0"
ACTION=="add", KERNEL=="vdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="vdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="vdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="vdb4", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="raw[1-4]", OWNER="dmdba", GROUP="dmdba", MODE="660"
[root@dmtest2-10-0-0-2 raw]#chown dmdba:dinstall /dev/raw/raw*
[root@dmtest2-10-0-0-2 raw]#chmod 660 /dev/raw/raw*

5.1.2挂存储方法二:
手动执行类似如下命令,“vdb”等换成实际的裸设备名称;

raw/dev/raw/raw1 /dev/vdb1
raw/dev/raw/raw2 /dev/vdb2
raw/dev/raw/raw3 /dev/vdb3
raw/dev/raw/raw4 /dev/vdb4
chown dmdba:dinstall /dev/raw/raw*
chmod 660 /dev/raw/raw*
[root@dmtest1-10-0-0-1 ~]# blockdev --getsize64 /dev/raw/raw*
21474836480
21474836480
107374182400
386546008064
blockdev: ioctl error on BLKGETSIZE64: Invalid argument

六、搭建DSC

6.1 配置 dmdcr_cfg.ini

在/dm/dmdbms/data/DAMENG下新建dmdcr_cfg.ini文件;

 DCR_N_GRP            = 3
  DCR_VTD_PATH         = /dev/raw/raw2
  DCR_OGUID            = 45330
[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          = 10.0.0.1
  DCR_EP_PORT          = 9341
[GRP_CSS]
  DCR_EP_NAME          = CSS1
  DCR_EP_HOST          = 10.0.0.2
  DCR_EP_PORT          = 9343
[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.0.0.1
  DCR_EP_PORT          = 9349
  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.0.0.2
  DCR_EP_PORT          = 9351
  DCR_EP_ASM_LOAD_PATH = /dev/raw
[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       = 9742

6.2初始化磁盘组

注意:两台机器该文件相同。


[dmdba@dmtest1-10-0-0-1 bin]$ ./dmasmcmd
DMASMCMD V8
ASM>create dcrdisk '/dev/raw/raw1' 'dcr'
ASM>create votedisk '/dev/raw/raw2' 'vote'
ASM>create asmdisk '/dev/raw/raw3' 'LOG0'
ASM>create asmdisk '/dev/raw/raw4' 'DATA0'
[Trace]The ASM initialize asmdisk /dev/raw/raw4 to name DMASMDATA0
Used time: 1.913(ms).
ASM>Init dcrdisk '/dev/raw/raw1' from '/dm/dmdbms/data/DAMENG/DAMENG/dmdcr_cfg.ini' identified by 'abcd'
[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: 128.247(ms).
ASM>Init votedisk '/dev/raw/raw2' from '/dm/dmdbms/data/DAMENG/DAMENG/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: 63.869(ms).
注意:以上初始化只需在一个节点上执行。

6.3 配置 dmasvrmal.ini

在/dm/dmdbms/data/DAMENG/DAMENG下新建dmasvrmal.ini文件;

[MAL_INST1]
  MAL_INST_NAME        = ASM0
  MAL_HOST             = 10.0.0.1
  MAL_PORT             = 7236
[MAL_INST2]
  MAL_INST_NAME        = ASM1
  MAL_HOST             = 10.0.0.2
  MAL_PORT             = 7237

注意:两台机器该文件相同。

6.4配置 dmdcr.ini

在dmtest1-10-0-0-1机器的/dm/dmdbms/data/DAMENG下新建dmdcr.ini文件;

DMDCR_PATH= /dev/raw/raw1
DMDCR_MAL_PATH= /dm/dmdbms/data/DAMENG/dmasvrmal.ini
DMDCR_SEQNO= 0

DMDCR_ASM_RESTART_INTERVAL = 30
DMDCR_ASM_STARTUP_CMD = /dm/dmdbms/dmdbms/bin/dmasmsvr dcr_ini=/dm/dmdbms/data/DAMENG/dmdcr.ini

DMDCR_DB_RESTART_INTERVAL = 60
DMDCR_DB_STARTUP_CMD = /dm/dmdbms/dmdbms/bin/dmserver path=/dm/dscdata/dsc0_config/dm.ini dcr_ini=/dm/dmdbms/data/DAMENG/dmdcr.ini

在dmtest2-10-0-0-2 机器的/dm/dmdbms/data/DAMENG下新建dmdcr.ini文件;

DMDCR_PATH= /dev/raw/raw1
DMDCR_MAL_PATH= /dm/dmdbms/data/DAMENG/dmasvrmal.ini
DMDCR_SEQNO= 1

DMDCR_ASM_RESTART_INTERVAL = 30
DMDCR_ASM_STARTUP_CMD = /dm/dmdbms/dmdbms/bin/dmasmsvr dcr_ini=/dm/dmdbms/data/DAMENG/dmdcr.ini

DMDCR_DB_RESTART_INTERVAL = 60
DMDCR_DB_STARTUP_CMD = /dm/dmdbms/dmdbms/bin/dmserver path=/dm/dscdata/dsc1_config/dm.ini dcr_ini=/dm/dmdbms/data/DAMENG/dmdcr.ini

注:
dmdcr.ini中先将ASM和DMSERVER配置为手动服务,待所有配置完成后,再修改dmdcr.ini将ASM和DMSERVER配置成自动拉起。
节点一:DMDCR_SEQNO =0
节点二:DMDCR_SEQNO =1

6.5 启动DMCSS、DMASM 服务程序

6.5.1分别在2个节点注册DMCSS和DMASM服务

节点一:


[root@dmtest1-10-0-0-1 root]# ./dm_service_installer.sh -t dmcss -dcr_ini /dm/dmdbms/data/DAMENG/dmdcr.ini -p CSS0

Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServiceCSS
Finished to create the service (DmCSSServiceCSS0)

[root@dmtest1-10-0-0-1 root]# ./dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmdbms/data/DAMENG/dmdcr.ini -p css0 -y DmCSSServiceCSS0               
                                                                                             
Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrService                                                                                                             css0.service to /usr/lib/systemd/system/DmASMSvrServicecss0.service.
Finished to create the service (DmASMSvrServicecss0)

节点二:

[root@dmtest2-10-0-0-2 root]# ./dm_service_installer.sh -t dmcss -dcr_ini /dm/dmdbms/data/DAMENG/dmdcr.ini -p CSS1

Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServiceCSS1.service to /usr/lib/systemd/system/DmCSSServiceCSS1.service.
Finished to create the service (DmCSSServiceCSS1)

[root@dmtest2-10-0-0-2 root]# ./dm_service_installer.sh -t dmasmsvr -dcr_ini /dm/dmdbms/data/DAMENG/dmdcr.ini -p css1 -y DmCSSServiceCSS1

Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServicecss1.service to /usr/lib/systemd/system/DmASMSvrServicecss1.service.
Finished to create the service (DmASMSvrServicecss1)

6.5.2 启动DMCSS和DMASM 服务

节点1:

[root@dmtest1-10-0-0-1 root]# systemctl start DmCSSServiceCSS0.service
[root@dmtest1-10-0-0-1 root]# systemctl start DmASMSvrServicecss0.service

节点2:

[root@dmtest2-10-0-0-2 root]# systemctl  start DmCSSServiceCSS1.service
[root@dmtest2-10-0-0-2 root]# systemctl start DmASMSvrServicecss1.service

6.6创建DMASM磁盘组

在任意节点使用 dmasmtool 工具创建 DMASM 磁盘组。

[dmdba@dmtest1-10-0-0-1 bin]$ ./dmasmtool DCR_INI=/dm/dmdbms/data/DAMENG/dmdcr.ini
DMASMTOOL V8
ASM>create diskgroup 'dmlog' asmdisk '/dev/raw/raw3'
Used time: 109.607(ms).
ASM>create diskgroup 'dmdata' asmdisk '/dev/raw/raw4'

6.7准备dminit.ini 配置文件

在2个节点的/dm/dmdbms/data/DAMENG目录下创建 dminit.ini 配置文件,添加如下内容。

  db_name              = dsc
  system_path          = +dmdata
  system              = +dmdata/dsc/system.dbf
  system_size          = 128
  roll                = +dmdata/dsc/roll.dbf
  roll_size            = 128
  main                = +dmdata/dsc/main.dbf
  main_size            = 128
  ctl_path             = +dmdata/dsc/dm.ctl
  ctl_size             = 8
  log_size             = 2048
  dcr_path             = /dev/raw/raw1
  dcr_seqno            = 0
  auto_overwrite       = 1
  charset                      =1

[DSC0]
  config_path          = /dm/dscdata/dsc0_config
  port_num             = 5236
  mal_host             = 10.0.0.1
  mal_port             = 9340
  log_path             = +dmlog/log/dsc0_log01.log
  log_path             = +dmlog/log/dsc0_log02.log
  page_size            = 16
  case_sensitive       = y
[DSC1]
  config_path          = /dm/dscdata/dsc1_config
  port_num             = 5236
  mal_host             = 10.0.0.2
  mal_port             = 9341
  log_path             = +dmlog/log/dsc1_log01.log
  log_path             = +dmlog/log/dsc1_log02.log
  page_size            = 16
  case_sensitive       = y

注意:只在一台机器配置。注意+dmdata大小写

6.8初始化数据库

在节点一机器上启动dminit工具初始化数据库,然后会在config_path配置的目录下生成dsc0_config和dsc1_config目录,每个目录下都有dm.ini和dmmal.ini。将A机器上生成的dsc1_config目录剪贴到节点二机器的config目录下

[dmdba@dmtest1-10-0-0-1 bin]$ ./dminit  control=/dm/dmdbms/data/DAMENG/dminit.ini
[dmdba@dmtest1-10-0-0-1 dscdata]$ ll
总用量 0
drwxr-xr-x 2 dmdba dinstall 57  3月  23 12:43 dsc0_config
drwxr-xr-x 2 dmdba dinstall 38  3月  23 12:48 dsc1_config
[dmdba@dmtest1-10-0-0-1 dscdata]$ scp -r dsc1_config 10.0.0.2:/dm/dscdata/

6.9配置dmarch.ini

将两台机器上dm.ini中的ARCH_INI设置为1,然后配置dmarch.ini文件
在节点一机器的/dm/dscdata/dsc0_config下新建dmarch.ini文件

[ARCHIVE_LOCAL1]
  ARCH_TYPE            = LOCAL
  ARCH_DEST            = /dmarch/arch_rac0
  ARCH_FILE_SIZE       = 2048
  ARCH_SPACE_LIMIT     = 150000
[ARCH_REMOTE1]
  ARCH_TYPE            = REMOTE
  ARCH_DEST            = DSC1
  ARCH_INCOMING_PATH   = /dmarch/arch_rac0_1
  ARCH_FILE_SIZE       = 2048
  ARCH_SPACE_LIMIT     = 150000

在节点二机器的/dm/dscdata/dsc1_config下新建dmarch.ini文件

[ARCHIVE_LOCAL1]
  ARCH_TYPE            = LOCAL
  ARCH_DEST            = /dmarch/arch_rac1
  ARCH_FILE_SIZE       = 2048
  ARCH_SPACE_LIMIT     = 150000
[ARCH_REMOTE1]
  ARCH_TYPE            = REMOTE
  ARCH_DEST            = DSC0
  ARCH_INCOMING_PATH   = /dmarch/arch_rac1_0
  ARCH_FILE_SIZE       = 2048
  ARCH_SPACE_LIMIT     = 150000

6.10启动DMSERVER服务

节点一机器

[dmdba@dmtest1-10-0-0-1 bin]$ ./dmserver /dm/dscdata/dsc0_config/dm.ini dcr_ini=/dm/dmdbms/data/DAMENG/dmdcr.ini

节点二机器


[dmdba@dmtest2-10-0-0-2 bin]$ ./dmserver /dm/dscdata/dsc1_config/dm.ini  dcr_ini=/dm/dmdbms/data/DAMENG/dmdcr.ini

6.11注册服务

节点一注册DM 数据库服务:

[root@dmtest1-10-0-0-1 root]# ./dm_service_installer.sh -t dmserver -dm_ini /dm/dscdata/dsc0_config/dm.ini -dcr_ini  /dm/dmdbms/data/DAMENG/dmdcr.ini -p css0 -y DmASMSvrServicecss0
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServicecss0.service to /usr/lib/systemd/system/DmServicecss0.service.
Finished to create the service (DmServicecss0)

节点二注册DM 数据库服务:

[root@dmtest2-10-0-0-2 root]# ./dm_service_installer.sh -t dmserver -dm_ini /dm/dscdata/dsc1_config/dm.ini -dcr_ini  /dm/dmdbms/data/DAMENG/dmdcr.ini -p css1 -y DmASMSvrServicecss1
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServicecss0.service to /usr/lib/systemd/system/DmServicecss0.service.
Finished to create the service (DmServicecss0)

6.12 启动数据库

[root@dmtest1-10-0-0-1 root]# systemctl start DmServicecss0.service
[root@dmtest2-10-0-0-2 root]# systemctl start DmServicecss1.service

七、配置 DMCSSM监控器

7.1配置步骤

[dmdba@dmtest1-10-0-0-1 DAMENG]$ cat dmcssm.ini

CSSM_OGUID = 45330
CSSM_CSS_IP = 10.0.0.1:9341
CSSM_CSS_IP = 10.0.0.2:9343
CSSM_LOG_PATH =/dm/dmdbms/data/DAMENG
CSSM_LOG_FILE_SIZE = 32
CSSM_LOG_SPACE_LIMIT = 0

7.2启动监视器

[dmdba@dmtest1-10-0-0-1 bin]$ ./dmcssm /dm/dmdbms/data/DAMENG/dmcssm.ini 


monitor current time:2023-06-08 09:21:53, n_group:3
=================== group[name = GRP_CSS, seq = 0, type = CSS, Control Node = 1] ========================================

[CSS0] auto check = TRUE, global info:
[ASM0] auto restart = TRUE
[DSC0] auto restart = TRUE

[CSS1] auto check = TRUE, global info:
[ASM1] auto restart = TRUE
[DSC1] auto restart = TRUE


ep:     css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid              ts
        2023-06-08 09:21:54    CSS0          0         9341    Normal Node  OPEN               WORKING      OK           TRUE         3286              4233
        2023-06-08 09:21:54    CSS1          1         9343    Control Node OPEN               WORKING      OK           TRUE         3759              4710

=================== group[name = GRP_ASM, seq = 1, type = ASM, Control Node = 1] ========================================

n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)

sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL

crash process over flag is TRUE
ep:     css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid              ts
        2023-06-08 09:21:54    ASM0          0         9349    Normal Node  OPEN               WORKING      OK           TRUE         9506              10431
        2023-06-08 09:21:54    ASM1          1         9351    Control Node OPEN               WORKING      OK           TRUE         9975              10909

=================== group[name = GRP_DSC, seq = 2, type = DB, Control Node = 0] ========================================

n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)

sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL

crash process over flag is TRUE
ep:     css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid              ts
        2023-06-08 09:21:54    DSC0          0         5236    Control Node OPEN               WORKING      OK           TRUE         4158              5051
        2023-06-08 09:21:54    DSC1          1         5236    Normal Node  OPEN               WORKING      OK           TRUE         3175              4088

==================================================================================================================

show

monitor current time:2023-06-08 09:22:49, n_group:3
=================== group[name = GRP_CSS, seq = 0, type = CSS, Control Node = 1] ========================================

[CSS0] auto check = TRUE, global info:
[ASM0] auto restart = TRUE
[DSC0] auto restart = TRUE

[CSS1] auto check = TRUE, global info:
[ASM1] auto restart = TRUE
[DSC1] auto restart = TRUE


ep:     css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid              ts
        2023-06-08 09:22:50    CSS0          0         9341    Normal Node  OPEN               WORKING      OK           TRUE         3286              4289
        2023-06-08 09:22:50    CSS1          1         9343    Control Node OPEN               WORKING      OK           TRUE         3759              4766

=================== group[name = GRP_ASM, seq = 1, type = ASM, Control Node = 1] ========================================

n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)

sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL

crash process over flag is TRUE
ep:     css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid              ts
        2023-06-08 09:22:50    ASM0          0         9349    Normal Node  OPEN               WORKING      OK           TRUE         9506              10486
        2023-06-08 09:22:50    ASM1          1         9351    Control Node OPEN               WORKING      OK           TRUE         9975              10964

=================== group[name = GRP_DSC, seq = 2, type = DB, Control Node = 0] ========================================

n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)

sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL

crash process over flag is TRUE
ep:     css_time               inst_name     seqno     port    mode         inst_status        vtd_status   is_ok        active       guid              ts
        2023-06-08 09:22:50    DSC0          0         5236    Control Node OPEN               WORKING      OK           TRUE         4158              5107
        2023-06-08 09:22:50    DSC1          1         5236    Normal Node  OPEN               WORKING      OK           TRUE         3175              4143

=

八、其他配置

8.1配置dm_svc.conf

以下配置是每次定向连接 DMDSC 服务名的第一个服务(10.0.0.1:5236),当服务器故障后,以间隔 1000 毫秒的节奏尝试连接第一个服务 60 次,若连接成功则进行使用,若连接失败则连接下一个服务(10.0.0.2:5236)。假设 2 号服务先连接成功,由于 AUTO_RECONNECT=(1),因此当 1 号服务可以正常连接后当前连接也不会切换到 1 号服务。

TIME_ZONE=(480)
LANGUAGE=(cn) 
DMDSC=(10.0.0.1:5236,10.0.0.2:5236) 
SWITCH_TIMES=(60) 
SWITCH_INTERVAL=(1000) 
EP_SELECTOR=(1) 
AUTO_RECONNECT=(1) 

8.2应用连接

8.2.1文件存放:
Linux:将dm_svc.cof文件放在应用服务器/etc目录下。
Windows32位:将dm_svc.conf文件放在应用服务器system32目录下。
Windows64位:将dm_svc.conf文件放在应用服务器system32和syswow64目录下。

8.2.2配置应用连接串:
连接串格式:
jdbc:dm://ip:port?参数名=参数值&参数名=参数值&参数名=参数值

// 定义 DM JDBC 驱动串
static String jdbcString = "dm.jdbc.driver.DmDriver";
// 定义 DM URL 连接串
static String urlString = "jdbc:dm://DMDSC";
// 定义连接用户名
static String userName = "SYSDBA";
// 定义连接用户口令
static String password = "SYSDBA";
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值