本篇内容介绍了“GBase8s cm配置方法有哪些”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
一、 单独CM
1. 在$GBASEDBTDIR/etc目录下创建sqlhosts.cm1文件,内容如下:
g_west group – – i=10
ol_54_pri onsoctcp 192.168.152.25 23701 g=g_west
ol_54_sds onsoctcp 192.168.152.26 23702 g=g_west
cm_update group – – i=12,c=0
oltp onsoctcp 192.168.152.25 25000 g=cm_update
2. 在$GBASEDBTDIR/etc目录下创建onconfig.cm1文件,内容如下:
NAME cm1
LOGFILE ${GBASEDBTDIR}/tmp/cm1.log
CM_TIMEOUT 40
SECONDARY_EVENT_TIMEOUT 20
EVENT_TIMEOUT 30
SQLHOSTS LOCAL
LOG 1
DEBUG 1
CLUSTER main
{
GBASEDBTSERVER g_west
SLA oltp DBSERVERS=PRI+SDS WORKERS=16
FOC ORDER=ENABLED TIMEOUT=10 RETRY=1 PRIORITY=1
}
3. 启停CM
启动cm
export GBASEDBTSQLHOSTS=$GBASEDBTDIR/etc/sqlhosts.cm1
oncmsm -c $GBASEDBTDIR/etc/config.cm1
关闭CM
oncmsm -k cm1
二、 CM集群
1. 配置CM集群:
在主节点创建sqlhosts.cm1:内容
g_west group – – i=10
ol_54_pri onsoctcp 192.168.152.25 23701 g=g_west
ol_54_sds onsoctcp 192.168.152.26 23702 g=g_west
cm_update group – – i=12,c=0
oltp_all1 onsoctcp 192.168.152.25 23000 g=cm_update
oltp_all2 onsoctcp 192.168.152.26 23000 g=cm_update
cm_read group – – i=14,c=0
oltp_read1 onsoctcp 192.168.152.25 23001 g=cm_read
oltp_read2 onsoctcp 192.168.152.26 23001 g=cm_read
2. 创建etc/onconfig.cm1文件,内容如下:
NAME cm1
LOGFILE ${GBASEDBTDIR}/tmp/cm1.log
CM_TIMEOUT 40
SECONDARY_EVENT_TIMEOUT 20
EVENT_TIMEOUT 30
SQLHOSTS LOCAL
LOG 1
DEBUG 1
CLUSTER main
{
GBASEDBTSERVER g_west
SLA oltp_all1 DBSERVERS=PRI WORKERS=16
SLA oltp_read1 DBSERVERS=SDS WORKERS=16
FOC ORDER=ENABLED TIMEOUT=10 RETRY=1 PRIORITY=1
}
3. 更改 sqlhosts.cm1,onconfig.cm1两个文件的权限:
chown GBASEDBT:GBASEDBT sqlhosts.cm1 onconfig.cm1
chmod 660 sqlhosts.cm1 onconfig.cm1
4. 在命令行执行
export GBASEDBTDIR=/home/54_For_SSC/
export GBASEDBTSQLHOSTS=/home/54_For_SSC/etc/sqlhosts.cm1
5. 在SDS节点配置CM,创建etc/sqlhosts.cm2,内容如下:
g_west group – – i=10
ol_54_pri onsoctcp 192.168.152.25 23701 g=g_west
ol_54_sds onsoctcp 192.168.152.26 23702 g=g_west
cm_update group – – i=12,c=0
oltp_all1 onsoctcp 192.168.152.25 23000 g=cm_update
oltp_all2 onsoctcp 192.168.152.26 23000 g=cm_update
cm_read group – – i=14,c=0
oltp_read1 onsoctcp 192.168.152.25 23001 g=cm_read
oltp_read2 onsoctcp 192.168.152.26 23001 g=cm_read
6. 创建etc/config.cm2文件,内容如下:
NAME cm2
LOGFILE ${GBASEDBTDIR}/tmp/cm2.log
CM_TIMEOUT 40
SECONDARY_EVENT_TIMEOUT 20
EVENT_TIMEOUT 30
SQLHOSTS LOCAL
LOG 1
DEBUG 1
CLUSTER main
{
GBASEDBTSERVER g_west
SLA oltp_all2 DBSERVERS=PRI WORKERS=16
SLA oltp_read2 DBSERVERS=SDS WORKERS=16
FOC ORDER=ENABLED TIMEOUT=10 RETRY=1 PRIORITY=2}
7. 更改 sqlhosts.cm2,config.cm2两个文件的权限:
chown GBASEDBT:GBASEDBT sqlhosts.cm2 onconfig.cm2
chmod 660 sqlhosts.cm2 onconfig.cm2
8. 在SDS节点执行下列语句
export GBASEDBTDIR=/home/54_For_SDS/
export GBASEDBTSQLHOSTS=/home/54_For_SDS/etc/sqlhosts.cm1
9. 在PRI节点启动cm1管理器:
oncmsm -c /home/54_For_SSC/etc/config.cm1
在SDS节点启动cm2管理器:
oncmsm -c /home/54_For_SSC/etc/config.cm2
10. 在集群中任意节点均可查看到cm状态。
onstat -g cmsm
“GBase8s cm配置方法有哪些”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/203733.html