设为首页 加入收藏

TOP

管理ONS(OracleNotificationService)(一)
2015-07-24 11:36:15 来源: 作者: 【 】 浏览:15
Tags:管理 ONS OracleNotificationService

Onsctl

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

Oracle Notification Service (ONS)--A publish and subscribe service for communicating Fast Application Notification (FAN) events.

在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}

……

……?

Configuring ONS for Fast Connection Failover

In order for Fast Connection Failover to work, you must configure ONS correctly. ONS is shipped as part of Oracle Database 11g.

This section covers the following topics:

ONS Configuration File

Client-Side ONS Configuration

Server-Side ONS Configuration Using racgons

Remote ONS Subscription

ONS Configuration File

ONS configuration is controlled by the ONS configuration file, ORACLE_HOME/opmn/conf/ons.config. This file tells the ONS daemon details about how it should behave and who it should talk to. Configuration information within ons.config is defined in simple name and value pairs. There are three values that should always be configured within ons.config. The first is localport, the port that ONS binds to

首页 上一页 1 2 3 4 5 下一页 尾页 1/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇纠正要求修改数据库NLS_LENGTH_SE.. 下一篇四:redis的sets类型相关操作(有..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·哈希表 - 菜鸟教程 (2025-12-24 20:18:55)
·MySQL存储引擎InnoDB (2025-12-24 20:18:53)
·索引堆及其优化 - 菜 (2025-12-24 20:18:50)
·Shell 中各种括号的 (2025-12-24 19:50:39)
·Shell 变量 - 菜鸟教 (2025-12-24 19:50:37)