目录
1.设置共享存储
2.裸设备划分
3.dmdcr_cfg.ini配置文件设置
4.dmasvrmal.ini配置文件设置
5.dmdcr.ini配置文件设置
6.启动服务
7.创建磁盘组(单节点执行)
8.dminit.ini配置文件设置
9.初始化DB环境
10.启动数据库服务器
11.效果测试
(1)机器一:
(1)输入划分命令(n->p->1(2,3,4)+内存大小)进行裸设备划分(200M/200M/4G/剩余全部),输入“w”保存设置(单节点执行),退出:
fdisk /dev/sdb
(2)编辑/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="root", GROUP="root", MODE="660"
(3)执行命令blockdev --getsize64 /dev/raw/raw1,查看裸设备大小
准备配置文件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.75.132
DCR_EP_PORT = 9341
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.75.133
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.75.132
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.75.133
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
准备DMASM的MAL文件(两个节点的内容相同,无需更改):dmasvrmal.ini,添加内容:
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 192.168.75.132
MAL_PORT = 7236
[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST = 192.168.75.133
MAL_PORT = 7237
准备dmdcr.ini配置文件(另外一个节点保证:dmdcr_path相同、dmavrmal.ini配置文件内容相同,且dmdcr_seqo分别为0和1)
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/home/dmdba/dmdbms/dsc_data/dmasvrmal.ini #dmasmsvr 使用的 MAL 配置文件路径
DMDCR_SEQNO = 0
#ASM 重启参数,命令行方式启动
DMDCR_ASM_RESTART_INTERVAL = 0(若为1,则为自动拉起dmasmsvr服务,只启动dmcss,等待拉起dmasmsvr即可)
DMDCR_ASM_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmasmsvr
dcr_ini=/home/dmdba/dmdbms/dsc_data/dmdcr.ini
#DB 重启参数,命令行方式启动
DMDCR_DB_RESTART_INTERVAL = 0(若为1,则为自动拉起dmasmsvr服务,只启动dmcss,等待拉起dmasmsvr即可)
DMDCR_DB_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver
path=/home/data/dsc1_config/dm.ini dcr_ini=/home/dmdba/dmdbms/dsc_data/dmdcr.ini
启动dmcss和dmasmsvr服务,若DMCSS配置的是自动拉起dmasmsvr。则启动dmcss等待dmasmsvr被拉起即可(两节点执行)。
dmcss手动启动示例:
[root@localhost bin]# ./dmcss DCR_INI=/home/dmdba/dmdbms/dsc_data/dmdcr.ini
dmasmsvr手动启动示例:
[root@localhost bin]# ./dmasmsvr DCR_INI=/home/dmdba/dmdbms/dsc_data/dmdcr.ini
使用dmasmtool工具,创建磁盘组,这里只需要创建日志磁盘组和数据磁盘组即可。
(1)启动dmasmtool工具:
[root@localhost bin]# ./dmasmtool DCR_INI=/home/dmdba/dmdbms/dsc_data/dmdcr.ini
(2)创建日志磁盘组:
create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3'
(3)创建数据磁盘组:
create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4'
配置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.75.132
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/data/dsc1_config
port_num = 5236
mal_host = 192.168.75.133
mal_port = 9341
log_path = +DMLOG/log/dsc1_log01.log
log_path = +DMLOG/log/dsc1_log02.log
使用dminit初始化DB环境,初始化之后会生成目录(dsc0_config和dsc1_config),且目录下生成的配置文件中含有:dm.ini和dmmal.ini,将dsc1_config拷贝到另外一个节点上。
初始化命令示例:
./dminit control=/home/data/dminit.ini/dminit.ini
命令示例:
./dmserver /home/data/dsc0_config/dm.ini dcr_ini=/home/dmdba/dmdbms
/dsc_data/dmdcr.ini
可通过disql工具,操作sql语句,完成效果测试