Onsctl 配置ONS服务(10G)

Onsctl

 

Onsctl这个命令是用来管理ONS(Oracle Notification Service)是OracleClustser实现FAN Event Push模型的基础。

 

在RAC环境下,需要使用$CRS_HOME下的ONS,而不是$ORACLE_HOME下的ONS,这点需要注意。配置文件位于$CRS_HOME/opmn/conf/ons.config。

[oracle@felix2 conf]$ pwd

/u01/oracle/10.2.0/crs_1/opmn/conf

[oracle@felix2 conf]$ cat ons.config

localport=6113

remoteport=6200

loglevel=3

useocr=on

[oracle@felix2 conf]$ netstat  -ano | grep 6200

tcp       0      0 0.0.0.0:6200                0.0.0.0:*                   LISTEN      off (0.00/0/0)

tcp       0      0 192.168.10.102:8471         192.168.10.101:6200         ESTABLISHED off (0.00/0/0)

[oracle@felix2 conf]$ netstat  -ano | grep 6113

tcp       0      0 127.0.0.1:6113              0.0.0.0:*                   LISTEN      off (0.00/0/0)

tcp       0      0 127.0.0.1:42331             127.0.0.1:6113              ESTABLISHED keepalive (2251.34/0/0)

tcp        0     0 127.0.0.1:42328            127.0.0.1:6113             ESTABLISHED keepalive (2185.99/0/0)

tcp       0      0 127.0.0.1:6113              127.0.0.1:42331             ESTABLISHED off (0.00/0/0)

tcp       0      0 127.0.0.1:6113              127.0.0.1:42328             ESTABLISHED off (0.00/0/0)

unix  3      [ ]         STREAM     CONNECTED     6113  

[oracle@felix2 conf]$

 

 

配置ONS:

 

添加ONS:

[oracle@felix2 conf]$ racgons add_configfelix11:6200 felix22:6200

 

删除ONS:

[oracle@felix2 conf]$ racgons remove_configfelix11:6200 felix22:6200

[oracle@felix2 conf]$

 

 

 

Onsctl命令:

使用onsctl命令可以启动、停止、调试ONS,并重新载入配置文件,其命令格式如下:

注意:

ONS进程运行,并不一定代表ONS正常工作,需要使用ping命令来确认。

[oracle@felix2 conf]$ onsctl 

usage: /u01/oracle/10.2.0/db_1/bin/onsctlstart|stop|ping|reconfig|debug

 

start                            - Start opmn only.

stop                             - Stop ons daemon

ping                             - Test to see ifons daemon is running

debug                            - Display debuginformation for the ons daemon

reconfig                         - Reload the onsconfiguration

help                             - Print a shortsyntax description (this).

detailed                         - Print a verbosesyntax description.

 

(1)在os级别查看进程

[oracle@felix2 conf]$ ps -ef  | grep ons

root     2530     1  0 20:19 ?        00:00:00 sendmail: acceptingconnections

oracle   5223     1  0 20:22 ?        00:00:00/u01/oracle/10.2.0/crs_1/opmn/bin/ons -d

oracle   5224  5223  0 20:22 ?        00:00:00 /u01/oracle/10.2.0/crs_1/opmn/bin/ons-d

oracle  10833 29589  0 21:59 pts/2    00:00:00 grep ons

[oracle@felix2 conf]$

 

(2)确认ONS服务的状态

 

[oracle@felix2 conf]$ onsctl ping

Number of configuration nodes retrieved: 2

0: {node = felix1, port = 6200}

Adding remote host felix1:6200

1: {node = felix2, port = 6200}

Remote port for local node in local config doesnot match that from OCR.

ons is not running ...

[oracle@felix2 conf]$

 

从输出的信息课件,ONS服务是停止的。

 

(3)启动ONS服务

[oracle@felix2 conf]$ onsctl start

Number of configuration nodes retrieved: 2

0: {node = felix1, port = 6200}

Adding remote host felix1:6200

1: {node = felix2, port = 6200}

……

……

【参考大话RAC--张晓明】

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值