| A机器 | B机器 | ||
业务IP | 192.168.87.11 | 192.168.87.12 | ||
心跳IP | 10.12.10.68 | 10.12.10.69 | ||
安装目录 | /dm | /dm | ||
dmdcr_cfg | CSS | DCR_EP_NAME | CSS0 | CSS1 |
DCR_EP_HOST | 192.168.179.130 | 192.168.179.131 | ||
DCR_EP_PORT | 5336 | 5337 | ||
ASM | DCR_EP_NAME | ASM0 | ASM1 | |
DCR_EP_HOST | 192.168.179.130 | 192.168.179.131 | ||
DCR_EP_PORT | 5436 | 5437 | ||
DB | DCR_EP_NAME | DSC0 | DSC1 | |
DCR_EP_PORT | 5236 | 5236 | ||
DCR_CHECK_PORT | 5536 | 5537 | ||
dmasvrmal | MAL_INST_NAME | ASM0 | ASM1 | |
MAL_HOST | 192.168.179.130 | 192.168.179.131 | ||
MAL_PORT | 5636 | 5637 | ||
dminit | PORT_NUM | 5236 | 5236 | |
MAL_HOST | 192.168.179.130 | 192.168.179.131 | ||
MAL_PORT | 5736 | 5737 | ||
归档上限 | 10240 | 10240 | ||
OGUID | 220615 |
- 安装前准备
1.1修改主机名
A机器:
[root@localhost ~]# hostname dsc1
[root@localhost ~]#vim /etc/sysconfig/network
添加:
NETWORKING=yes
HOSTNAME=dsc1
[root@localhost ~]# vim /etc/hosts
添加:
10.12.10.68 dsc1
B 机器
[root@localhost ~]# hostname dsc2
[root@localhost ~]#vim /etc/sysconfig/network
添加:
NETWORKING=yes
HOSTNAME=dsc2
[root@localhost ~]# vim /etc/hosts
添加:
10.12.10.69 dsc2
1.2关闭防火墙和安全策略
A、B机器依次执行
关闭防火墙:
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# systemctl status firewalld
禁用安全策略:
[root@localhost ~]# vim /etc/sysconfig/selinux
修改SELINUX=disabled
- 存储准备
2.1配置共享磁盘
C:\Users\Administrator\Desktop\DM集群搭建\共享存储搭建步骤.docx
2.2进行分区划分
A机器:进行分区划分
[root@dsc1 ~]# fdisk -l
[root@dsc1 ~]# fdisk /dev/sdb
1) 依次输入 n p 1 回车 +100M,完成第一块磁盘划分
2) 依次输入 n p 2 回车 +100M,完成第二块磁盘划分
3) 依次输入 n p 3 回车 +15360M,完成第三块磁盘划分
4) 依次输入 n p 回车 回车 回车,完成第四块磁盘划分
5) 输入w命令,将裸设备划分的设置进行保存
A、B机器依次执行:[root@dsc1~]# partprobe /dev/sdb
2.3挂存储
[root@dsc1 ~]# vim /etc/udev/rules.d/70-persistent-ipoib.rules
添加:
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdb4", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="raw[1-4]", OWNER="dmdba", GROUP="dinstall", MODE="660"
Chown dmdba:dinstall 70-persistent-ipoib.rules
[root@dsc1 ~]# partprobe /dev/sdb
[root@dsc1 ~]# reboot
注意:可通过blockdev --getsize64 /dev/raw/raw*命令查看设备大小。
- 搭建DSC
3.1创建dmdcr_cfg.ini
A、B机器配置相同
[dmdba@dsc1~]$ vim /dm/config/dmdcr_cfg.ini
DCR_N_GRP = 3 #集群环境有多少个GROUP,范围:1~16
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 220615
[GRP] #新建一个GROUP
DCR_GRP_TYPE = CSS #组类型(CSS/ASM/DB)
DCR_GRP_NAME = GRP_CSS #组名
DCR_GRP_N_EP = 2 #组内节点个数
DCR_GRP_DSKCHK_CNT = 60 #磁盘心跳容错时间,单位:秒
[GRP_CSS]
DCR_EP_NAME = CSS0 #CSS节点名
DCR_EP_HOST = 10.12.10.68 #心跳地址
DCR_EP_PORT = 5336 #CSS端口
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 10.12.10.69
DCR_EP_PORT = 5337
[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 #ASM节点名,和dmasvrmal的MAL_INST_NAME一致
DCR_EP_SHM_KEY = 93360 #共享内存标识
DCR_EP_SHM_SIZE = 10 #共享内存大小
DCR_EP_HOST = 10.12.10.68 #心跳地址
DCR_EP_PORT = 5436 #ASM端口
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.12.10.69
DCR_EP_PORT = 5437
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 #实例名,和dm.ini的INSTANCE_NAME一致
DCR_EP_SEQNO = 0 #组内序号,不能重复
DCR_EP_PORT = 5236 #实例端口,和dm.ini的PORT_NUM一致
DCR_CHECK_PORT = 5536 #DCR检查端口
[GRP_DSC]
DCR_EP_NAME = DSC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 5537
3.2初始化磁盘组
A机器:
[dmdba@dsc1~]$ cd /dm/bin
[dmdba@dsc1 bin]$ ./dmasmcmd
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'
ASM> init dcrdisk '/dev/raw/raw1' from '/dm/config/dmdcr_cfg.ini' identified by 'admin1234'
ASM> init votedisk '/dev/raw/raw2' from '/dm/config/dmdcr_cfg.ini'
3.3创建dmasvrmal.ini
A、B机器配置相同
[dmdba@dsc1~]$ vim /dm/config/dmasvrmal.ini
添加:
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 10.12.10.68 #心跳地址
MAL_PORT = 5636 #监听端口
[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST = 10.12.10.69
MAL_PORT = 5637
3.4创建dmdcr.ini
A机器:
[dmdba@dsc1~]$ vim /dm/config/dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH = /dm/config/dmasvrmal.ini
DMDCR_SEQNO = 0
DMDCR_AUTO_OPEN_CHECK = 90
#DMDCR_ASM_RESTART_INTERVAL = 30 #CSS认定ASM故障重启的时间
#DMDCR_ASM_STARTUP_CMD = /dm/bin/dmasmsvr dcr_ini=/dm/config/dmdcr.ini
#DMDCR_DB_RESTART_INTERVAL = 60 #CSS认定DSC故障重启的时间
#DMDCR_DB_STARTUP_CMD = /dm/bin/dmserver path=/dm/config/dsc0_config/dm.ini dcr_ini=/dm/config/dmdcr.ini
B机器:
[dmdba@dsc2~]$ vim /dm/config/dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH = /dm/config/dmasvrmal.ini
DMDCR_SEQNO = 0
DMDCR_AUTO_OPEN_CHECK = 90
#DMDCR_ASM_RESTART_INTERVAL = 30 #CSS认定ASM故障重启的时间
#DMDCR_ASM_STARTUP_CMD = /dm/bin/dmasmsvr dcr_ini=/dm/config/dmdcr.ini
#DMDCR_DB_RESTART_INTERVAL = 60 #CSS认定DSC故障重启的时间
#DMDCR_DB_STARTUP_CMD = /dm/bin/dmserver path=/dm/config/dsc1_config/dm.ini dcr_ini=/dm/config/dmdcr.ini
3.5启动CSS、ASM服务
A机器、B机器依次执行注意:当前为手动拉起A机器和B机器的ASM和DMSERVER服务。
待集群配置完成后,再修改为自动拉起(删除dmdcr.ini中红色井号)。
[dmdba@dsc1~]$ cd /dm/bin
[dmdba@dsc1 bin]$ ./dmcss DCR_INI=/dm/config/dmdcr.ini
A机器、B机器依次执行:
[dmdba@dsc1~]$ cd /dm/bin
[dmdba@dsc1 bin]$ ./dmasmsvr DCR_INI=/dm/config/dmdcr.ini
3.6创建DMASM磁盘组
A机器:
[dmdba@dsc1~]$ cd /dm/bin
[dmdba@dsc1 bin~]$ ./dmasmtool DCR_INI=/dm/config/dmdcr.ini
ASM> create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3'
ASM> create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4'
3.7创建dminit.ini
A、B机器配置相同
[dmdba@dsc1~]$ vim /dm/config/dminit.ini
db_name = dsc
system_path = +DMDATA/data
main = +DMDATA/data/dsc/main.dbf
main_size = 128
roll = +DMDATA/data/dsc/roll.dbf
roll_size = 128
system = +DMDATA/data/dsc/system.dbf
system_size = 128
ctl_path = +DMDATA/data/dsc/dm.ctl
ctl_size = 8
log_size = 2048
dcr_path = /dev/raw/raw1
dcr_seqno = 0
auto_overwrite = 1
PAGE_SIZE = 32
CASE_SENSITIVE = Y
CHARSET = 0
[DSC0]
config_path = /dm/config/dsc0_config
port_num = 5236
mal_host = 10.12.10.68
mal_port = 5736
log_path = +DMLOG/log/dsc0_log01.log
log_path = +DMLOG/log/dsc0_log02.log
[DSC1]
config_path = /dm/config/dsc1_config
port_num = 5236
mal_host = 10.12.10.69
mal_port = 5737
log_path = +DMLOG/log/dsc1_log01.log
log_path = +DMLOG/log/dsc1_log02.log
3.8初始化实例
A机器:
[dmdba@dsc1~]$ cd /dm/bin
[dmdba@dsc1 bin~]$ ./dminit control=/dm/config/dminit.ini
[dmdba@dsc1~]$ cd /dm/config
[dmdba@dsc1 config~]$ scp dsc1_config dmdba@10.12.10.69:/dm/config/
3.9创建dmarch.ini
A机器:
修改dm.ini文件
[dmdba@dsc1~]$ vim /dm/config/dsc0_config/dm.ini
ARCH_INI = 1
创建dmarch.ini文件
[dmdba@dsc1~]$ vim /dm/config/dsc0_config/dmarch.ini
[ARCHIVE_LOCAL]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm/arch_0
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 10240
[ARCHIVE_REMOTE]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC1
ARCH_INCOMING_PATH = /dm/arch_0_remote
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 10240
B机器:
修改dm.ini文件
[dmdba@dsc1~]$ vim /dm/config/dsc1_config/dm.ini
ARCH_INI = 1
[dmdba@dsc1~]$ vim /dm/config/dsc1_config/dmarch.ini
[ARCHIVE_LOCAL]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm/arch_1
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 10240
[ARCHIVE_REMOTE]
ARCH_TYPE = REMOTE
ARCH_DEST = DSC0
ARCH_INCOMING_PATH = /dm/arch_1_remote
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 10240
4.配置监视器
配置在B机器上
[dmdba@dsc2~]$ cd /dm
[dmdba@dsc2 dmdbms~]$ vim dmcssm.ini
添加:
CSSM_OGUID = 220615
CSSM_CSS_IP = 10.12.10.68:5336
CSSM_CSS_IP = 10.12.10.69:5337
CSSM_LOG_PATH = /dm/log
CSSM_LOG_FILE_SIZE = 512
CSSM_LOG_SPACE_LIMIT = 2048
注册服务
[root@dsc2~]# cd /dm/script/root
[root@dsc2 root~]# ./dm_service_installer.sh -t dmcssm -cssm_ini /opt/dsc/dmdbms/dmcssm.ini -p Monitor
启动监视器
[dmdba@dsc2~]$ /dm/bin/DmCSSMonitorServiceMonitor start
达梦技术社区:https://eco.dameng.com