在$INFORMIXDIR/bin目录下创建文件passwords.txt的内容为:
ifx_ids ifx_ids informix password1
ifx_hdr ifx_hdr informix password2
ifx_sds ifx_sds informix password3
运行以下命令加密该文件(123456是加密密钥)
onpassword -k 123456 -e ./passwords.txt
备注:在sinodb版本onpassword工具未编译,可以通过安装RSH建立双机信任跳过该步骤
export INFORMIXDIR=/home/informix/sinodb
export PATH=/home/informix/sinodb/bin:$PATH
export INFORMIXSQLHOSTS=/home/informix/sinodb/etc/sqlhosts.cm
在$INFORMIXDIR/etc目录下创建文件cmconfig的内容为:
NAME cm1
LOG 1
LOGFILE ${INFORMIXDIR}/tmp/cmlog
CLUSTER g1
{
INFORMIXSERVER ifx_ids
SLA oltp DBSERVERS=primary
SLA payroll DBSERVERS=HDR,primary
SLA report DBSERVERS=SDS,HDR
FOC ORDER=ifx_sds,ifx_hdr PRIORITY=1 TIMEOUT=10 RETRY=2
}
备注:多个CM必须设定不同的PRIORITY值,并且PRIORITY必须设置在ORDER之后,顺序不能放后面
#dbservername nettype hostname servicename options
ifx_ids onsoctcp host1 port1
ifx_hdr onsoctcp host2 port2
ifx_sds onsoctcp host3 port3
#dbservername nettype hostname servicename options
g1 group - - i=10
ifx_ids onsoctcp host1 port1 g=g1
ifx_hdr onsoctcp host2 port2 g=g1
ifx_sds onsoctcp host3 port3 g=g1
oltp onsoctcp cmhost1 cmport1
report onsoctcp cmhost1 cmport2
payroll onsoctcp cmhost1 cmport3
oncmsm -c cmconfig
oncmsm -k cm1