DSC 集群搭建
一 新增共享磁盘
1.第一台
2.第二台
在虚拟机路径下这个文件中,添加disk.locking=“false”
二 分区
1 在共享磁盘上裸设备划分
(1) 输入 fdisk /dev/sdb
(2) 依次输入n→p→1→回车→+200M→回车,完成第一块磁盘划分
(3) 依次输入 n →p →2 →回车→ +100M →回车,完成第二块磁盘划分
(4) 依次输入 n →p → 3 →回车→+2048M →回车,完成第三块磁盘划分
(5) 依次输入 n → p → 4 →回车→回车→回车,完成第四块磁盘划分
(6) 两节点编辑/etc/udev/rules.d/60-raw.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”
(7)两节点执行,通知分区
partprobe /dev/sdb
(8)101节点
udevadm trigger --action=add
(9)查看大小
blockdev --getsize64 /dev/raw/raw1
blockdev --getsize64 /dev/raw/raw2
blockdev --getsize64 /dev/raw/raw3
blockdev --getsize64 /dev/raw/raw4
三 配置集群(用户dmdba下完成)
创建data目录赋予dmdba权限
(1)101节点配置dmdcr_cfg.ini
vi /home/dmdba/data/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 = 192.168.100.101
DCR_EP_PORT = 9341
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.100.102
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 = 192.168.100.101
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 = 192.168.100.102
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
(2) 101节点使用DMASMCMD工具初始化
cd /home/dmdba/dmdbms/bin
./dmasmcmd
create dcrdisk '/dev/raw/raw1' 'dcr'
create votedisk '/dev/raw/raw2' 'vote'
create asmdisk '/dev/raw/raw3' 'LOG0'
create asmdisk '/dev/raw/raw4' 'DATA0'
init dcrdisk '/dev/raw/raw1' from '/home/data/dmdcr_cfg.ini' identified by 'abcd'
init votedisk '/dev/raw/raw2' from '/home/data/dmdcr_cfg.ini'
3).两节点配置dmasvrmal.ini和dmdcr.ini文件
101节点
vi /home/data/dmasvrmal.ini
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 192.168.100.101
MAL_PORT = 7236
[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST = 192.168.100.102
MAL_PORT = 7237
vi /home/data/dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/home/data/dmasvrmal.ini #dmasmsvr 使用的 MAL 配置文件路径
DMDCR_SEQNO = 0
#ASM 重启参数,命令行方式启动
DMDCR_ASM_RESTART_INTERVAL = 0
DMDCR_ASM_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmasmsvr dcr_ini=/home/data/dmdcr.ini
#DB 重启参数,命令行方式启动
DMDCR_DB_RESTART_INTERVAL = 0
DMDCR_DB_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver path=/home/data/dsc0_config/dm.ini dcr_ini=/home/data/dmdcr.ini
4)发送配置文件给102节点
scp dmasvrmal.ini dmdcr.ini dmdba@192.168.100.102:/home/data
节点2修改dmdcr.ini(dmasvrmal.ini一样的不用修改)
DMDCR_SEQNO = 1
DMDCR_DB_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver path=/home/data/dsc1_config/dm.ini
(5) 两节点先后启动(2个节点都要启动)
./dmcss DCR_INI=/home/data/dmdcr.ini
./dmasmsvr DCR_INI=/home/data/dmdcr.ini
两边都起来后101节点可看到
(6).101节点
cd /home/dmdba/dmdbms/bin
./dmasmtool DCR_INI=/home/data/dmdcr.ini
#创建日志磁盘组
create diskgroup ‘DMLOG’ asmdisk ‘/dev/raw/raw3’
#创建数据磁盘组
create diskgroup ‘DMDATA’ asmdisk ‘/dev/raw/raw4’
(7)101节点配置dmint.ini文件
vi /home/data/dminit.ini
db_name = dsc
system_path = +DMDATA/data
system = +DMDATA/data/dsc/system.dbf
system_size = 128
roll = +DMDATA/data/dsc/roll.dbf
roll_size = 128
main = +DMDATA/data/dsc/main.dbf
main_size = 128
ctl_path = +DMDATA/data/dsc/dm.ctl
ctl_size = 8
log_size = 256
dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备
dcr_seqno = 0
auto_overwrite = 1
[DSC0] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /home/data/dsc0_config
port_num = 5236
mal_host = 192.168.100.101
mal_port = 9340
log_path = +DMLOG/log/dsc0_log01.log
log_path = +DMLOG/log/dsc0_log02.log
[DSC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /home/dmdba/data/dsc1_config
port_num = 5236
mal_host = 192.168.100.102
mal_port = 9341
log_path = +DMLOG/log/dsc1_log01.log
log_path = +DMLOG/log/dsc1_log02.log
(8).初始数据库
101节点
cd /home/dmdba/dmdbms/bin
./dminit control=/home/data/dminit.ini
会在 config_path 目录(/home/data/dsc0_config 和/home/data/dsc1_config)下生成配置文件 dm.ini 和 dmmal.ini。
(9)将101节点的dsc1_config文件发送给102节点
scp -r /home/data/dsc1_config dmdba@192.168.100.102:/home/data
(10) 配置确认监视器
在192.168.100.102服务器上安装数据库,并配置确认监视器观察集群状态。路径为/home/dmdba/dmdbms/DMCSSM/dmcssm.ini,监视器日志路径为/home/dmdba/dmdbms/DMCSSM/cssmlog
配置dmcssm.ini文件
#取值和dmdcr_cfg.ini中的DCR_OGUID相同
CSSM_OGUID = 63635
#配置所有CSS的连接信息,和dmdcr_cfg.ini中CSS配置项的DCR_EP_HOST和DCR_EP_PORT保持一致
CSSM_CSS_IP =192.168.100.101:9341
CSSM_CSS_IP = 192.168.100.102:9341
CSSM_LOG_PATH = /home/dmdba/dmdbms/DMCSSM/cssmlog
CSSM_LOG_FILE_SIZE = 32
- 启动数据库实例
DSC0:
./dmserver /home/data/dsc0_config/dm.ini dcr_ini=/home/data/dmdcr.ini
DSC1:
./dmserver /home/data/dsc1_config/dm.ini dcr_ini=/home/data/dmdcr.ini
DSC集群搭建完成
三 注册服务
注册服务:root用户.
cd /home/dmdba/dmdbms/script/root
1 101节点,
(1)注册CSS服务
./dm_service_installer.sh -t dmcss -p DSC -dcr_ini /home/data/dmdcr.ini
(2)注册ASM服务
./dm_service_installer.sh -t dmasmsvr -p DSC -dcr_ini /home/data/dmdcr.ini -y DmCSSServiceDSC.service
(3)注册实例服务
./dm_service_installer.sh -t dmserver -p DSC -dm_ini /home/data/dsc0_config/dm.ini -dcr_ini /home/data/dmdcr.ini -y DmASMSvrServiceDSC.service
2 102节点
(1)注册CSS服务
./dm_service_installer.sh -t dmcss -p DSC -dcr_ini /home/data/dmdcr.ini
(2)注册ASM服务
./dm_service_installer.sh -t dmasmsvr -p DSC -dcr_ini /home/data/dmdcr.ini -y DmCSSServiceDSC.service
(3)注册实例服务
./dm_service_installer.sh -t dmserver -p DSC -dm_ini /home/data/dsc1_config/dm.ini -dcr_ini /home/data/dmdcr.ini -y DmASMSvrServiceDSC.service
四 关闭、打开DSC集群的顺序
关dsc集群顺序
关闭实例>关闭asm>关闭css
开dsc集群方式
启动css>启动asm>启动实例
1.启动集群
cd /home/dmdba/dmdbms/bin
(1)启动CSS
./DmCSSServiceDSC start(两节点)
(2)启动ASM
./DmASMSvrServiceDSC start(两节点)
(3)启动实例
./DmServiceDSC start (两节点)
(4)启动监视器
./dmcssm INI_PATH=/home/dmdba/dmdbms/DMCSSM/dmcssm.ini
2.关闭集群
(1)关闭实例
./DmServiceDSC start (两节点)
(2)关闭ASM
./DmASMSvrServiceDSC start(两节点)
(3)关闭CSS
./DmCSSServiceDSC start(两节点)
五 测试
1.101节点创建
2.102节点查看