DSC启停顺序:
起:CSS、ASM、DB
停:DB、ASM、CSS
1、添加共享磁盘
建议使用vmware-vdiskmanager.exe的方式添加共享磁盘,直接在其中一台机器创建磁盘,第二台再关联的方式可能会在后面启动css时出现问题。
不建议:
将虚拟机关机-编辑虚拟机设置-硬盘-添加-安装硬盘-下一步-创建新虚拟磁盘-高级-虚拟设备节点
将虚拟机关机-编辑虚拟机设置-硬盘-添加-安装硬盘-下一步-使用现有虚拟磁盘-高级-虚拟设备节点
建议:使用vmware-vdiskmanager.exe创建共享磁盘
打开cmd进入到虚拟机安装目录
执行:.\vmware-vdiskmanager.exe -c -s 20G -a lsilogic -t 2 "D:\Virtual\SHARE.vmdk"
创建完成之后,可在目录中看到
1.2两台机器都添加刚才创建的共享磁盘
注意将两台scsi设置成一样的
2、修改相关虚拟机文件
两台虚拟机添加的vmx文件下都添加一下信息:
disk.locking = "false" diskLib.dataCacheMaxSize = "0" diskLib.dataCacheMaxReadAheadSize = "0" diskLib.DataCacheMinReadAheadSize = "0" diskLib.dataCachePageSize = "10240" diskLib.maxUnsyncedWrites = "0" scsi1:0.deviceType = "disk" scsi1:1.deviceType = "disk" scsi1:2.deviceType = "disk" scsi1:3.deviceType = "disk" scsi1.sharedBus = "VIRTUAL"
3、查看下共享磁盘是否添加成功
fdisk -l
4、进行裸设备划分-----------只需在其中一台机器上执行
输入 fdisk /dev/sdb
依次输入 n → p → 1 →回车→ +100M →回车,完成第一块磁盘划分
依次输入 n → p → 2 →回车→ +100M →回车,完成第二块磁盘划分
依次输入 n → p → 3 →回车→ +2048M →回车,完成第三块磁盘划分
依次输入 n → p →回车→回车,完成第四块磁盘划分
wq保存配置并退出 fdisk -l或者lsblk可以查看分区是否成功
5、编辑/etc/udev/rules.d/70-raw.rules文件,2台服务器均需增加以下语句
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"
6、两个节点上都运行以下语句,完成裸设备的绑定或者重启机器
partprobe /dev/sdb
7、可以通过以下命令查看是否绑定成功以及裸设备大小
ll /dev/raw/ blockdev --getsize64 /dev/raw/raw1
8、配置dmdcr_cfg.ini,只需在控制节点配置
保存在/home/dmdba/dsc_config下
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.10.141
DCR_EP_PORT = 9341
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.10.142
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 = 20
DCR_EP_HOST = 192.168.10.141
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 = 20
DCR_EP_HOST = 192.168.10.142
DCR_EP_PORT = 9351
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_DAMENG
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_DAMENG]
DCR_EP_NAME = DAMENG0
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[GRP_DAMENG]
DCR_EP_NAME = DAMENG1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9742
9、初始化磁盘
在其中一个节点上启动dmasmcmd工具,依次输入以下命令
cd /home/dmdba/dmdbms/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/dmdba/dsc_config/dmdcr_cfg.ini'identified by 'abcd'
init votedisk '/dev/raw/raw2' from '/home/dmdba/dsc_config/dmdcr_cfg.ini'
10、配置dmasvrmal.ini文件,两个节点都要配置,内容完全一样
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 192.168.10.141
MAL_PORT = 7236
[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST = 192.168.10.142
MAL_PORT = 7237
11、配置dmdcr.ini文件,两个节点分别配置dmdcr.ini,dmdcr_path相同,dmasvrmal.ini文件内容也相同,dmdcr_seqo分别为0和1
控制节点:
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH = /home/dmdba/dsc_config/dmasvrmal.ini
DMDCR_SEQNO = 0
#ASM重启参数,命令行方式启动
#DMDCR_ASM_RESTART_INTERVAL = 30
#DMDCR_ASM_STARTUP_CMD = /home/dmdba/dmdbms/bin/DmASMSvrServiceDAMENG0 start
#DB重启参数,命令行方式启动
#DMDCR_DB_RESTART_INTERVAL = 60
#DMDCR_DB_STARTUP_CMD =/home/dmdba/dmdbms/bin/DmServiceDAMENG0 start
DMDCR_AUTO_OPEN_CHECK=60
普通节点:
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/me/dmdba/dsc_config/dmasvrmal.ini
DMDCR_SEQNO = 1 #ASM重启参数,命令行方式启动
#DMDCR_ASM_RESTART_INTERVAL = 30
#DMDCR_ASM_STARTUP_CMD =/home/dmdba/dmdbms/bin/DmASMSvrServiceDAMENG1 start
#DB重启参数,命令行方式启动
#DMDCR_DB_RESTART_INTERVAL = 60
#DMDCR_DB_STARTUP_CMD = /home/dmdba/dmdbms/bin/DmServiceDAMENG1 start
DMDCR_AUTO_OPEN_CHECK=60
注:配置过程中dmdcr.ini中先不将ASM服务和DMSERVER自动拉起,配置过程中先手动启动DMCSS、DMASM、DMSERVER服务,待所有配置都完成后,再修改dmdcr.ini将ASM服务和DMSERVER服务配置成自动拉起。
12、启动DMCSS、DMASM服务
2节点分别前台启动dmcss、dmasmsvr
./dmcss DCR_INI=/home/dmdba/dsc_config/dmdcr.ini ./dmasmsvr DCR_INI=/home/dmdba/dsc_config/dmdcr.ini
13、创建DMASM磁盘组(选择其中一个节点即可)
./dmasmtool DCR_INI=/home/dmdba/dsc_config/dmdcr.ini
#创建日志磁盘组
create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3'
#创建数据磁盘组
create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4'
14、配置dminit.ini文件(控制节点配置)
db_name = DAMENG
system_path = +DMDATA/data
system = +DMDATA/data/DAMENG/system.dbf
system_size = 128
roll = +DMDATA/data/DAMENG/roll.dbf
roll_size = 128
main = +DMDATA/data/DAMENG/main.dbf
main_size = 128
ctl_path = +DMDATA/data/DAMENG/dm.ctl
ctl_size = 8
log_size = 512
dcr_path = /dev/raw/raw1
dcr_seqno = 0
auto_overwrite = 1
PAGE_SIZE = 32
EXTENT_SIZE = 32
CASE_SENSITIVE =0
CHARSET = 1
[DAMENG0]
config_path = /home/dmdba/dsc_config/DAEMNG0_config
port_num = 5236
mal_host = 192.168.10.141
mal_port = 9140
log_path = +DMLOG/log/DAMENG0_log01.log
log_path = +DMLOG/log/DAMENG0_log02.log
[DAMENG1]
config_path = /home/dmdba/dsc_config/DAEMNG1_config
port_num = 5236
mal_host = 192.168.10.142
mal_port = 9141
log_path = +DMLOG/log/DAMENG1_log01.log
log_path = +DMLOG/log/DAMENG1_log02.log
15、初始化数据库,选择其中一个节点
./dminit control=/home/dmdba/dsc_config/dminit.ini
dminit执行完成后,会在config_path目录(/home/dmdba/dsc_config/DAEMNG0_config和/home/dmdba/dsc_config/DAEMNG1_config)下生成配置文件dm.ini和dmmal.ini。
注:初始化数据库完成之后,将192.168.10.141节点上生成的DAEMNG1_config文件拷贝到192.168.10.142的/home/dmdba/dsc_config/目录下,然后将192.168.10.141上/home/dmdba/dsc_config目录下的DAEMNG1_config文件夹删掉,或者改名dAEMNG1_config。
16、配置远程归档
先将两个节点上的dm.ini中的ARCH_INI设置为1,然后配置dmarch.ini文件
节点192.168.10.141:放在/home/dmdba/dmdbms/config/rac0_config目录下
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /home/dmdba/dmarch/DAMENG/arch_0
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 40960
[ARCH_REMOTE1]
ARCH_TYPE = REMOTE
ARCH_DEST = DAMENG1
ARCH_INCOMING_PATH =/home/dmdba/dmarch/DAMENG/arch_0_remote
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 40960
节点192.168.10.142:放在/home/dmdba/dmdbms/config/rac1_config目录下
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /home/dmdba/dmarch/DAMENG/arch_1
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 40960
[ARCH_REMOTE1]
ARCH_TYPE = REMOTE
ARCH_DEST = DAMENG0
ARCH_INCOMING_PATH =/home/dmdba/dmarch/DAMENG/arch_1_remote
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 40960
17、启动DMSERVER服务(两节点都启动)
./dmserver /home/dmdba/dsc_config/DAEMNG0_config/dm.ini dcr_ini=/home/dmdba/dsc_config/dmdcr.ini
18、设置后台启动脚本 cd /home/dmdba/dmdbms/script/root/
[root@localhost ~]# cd /home/dmdba/dmdbms/script/root
注册CSS服务
./dm_service_installer.sh -t dmcss -dcr_ini /home/dmdba/dsc_config/dmdcr.ini -p DAMENG0
注册ASM服务
./dm_service_installer.sh -t dmasmsvr -dcr_ini /home/dmdba/dsc_config/dmdcr.ini -p DAMENG0 -y DmCSSServiceDAMENG0
注册SERVER服务
./dm_service_installer.sh -t dmserver -dm_ini /home/dmdba/dsc_config/DAEMNG0_config/dm.ini -dcr_ini /home/dmdba/dsc_config/dmdcr.ini -p DAMENG0 -y DmASMSvrServiceDAMENG0
19、配置监控器
在192.168.4.32机器上配置监视器,查看DMDSC集群的整体运行情况,编辑一个dmcssm.ini文件,放在/home/dmdba/dsc_config目录下,内容如下:
IP:DCR_EP_PORT
CSSM_OGUID = 63635
CSSM_CSS_IP = 192.168.10.141:9341
CSSM_CSS_IP = 192.168.10.142:9343
CSSM_LOG_PATH = ../log
CSSM_LOG_FILE_SIZE = 32
CSSM_LOG_SPACE_LIMIT = 0
20、将自动拉起服务打开,开启CSS服务
21、启动监视器
./dmcssm INI_PATH=/home/dmdba/dsc_config/dmcssm.ini