Oracle rac不能监听public ip

0    106    2

Tags:

👉 本文共约2078个字,系统预计阅读时间或需8分钟。

现象

Oracle 11.2.0.4的rac不能监听public ip,很奇怪:

解决

修改监听文件/u01/app/11.2.0.4/grid/network/admin/listener.ora文件,增加如下内容:

查看:

然后重启监听即可:

结果:

可见,public和vip都已经被监听了。

其它原因 (Doc ID 1597716.1)

文件/etc/nsswitch.conf的权限问题:

日志文件:/u01/app/11.2.0.4/grid/log/oarac2/agent/crsd/oraagent_grid/oraagent_grid.log

文件endpoints_listener.ora不能直接修改,因为重启监听又回到最初的状态了。

Public IP Endpoint is not registered for Listener in 11.2 RAC (Doc ID 1597716.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.1 to 11.2.0.4 [Release 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Generic (Platform Independent)

SYMPTOMS

This is two node RAC, ONS fails to start, listener starts successful, but Public IP ENDPOINT is not dynamically registered to the Listener.

- lsnrctl status shows only VIP Endpoint registered, Public IP Endpoint not registered.

$ lsnrctl status

...

Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))) <<<<< only VIP Endpoint

- oraagent_grid.log shows ONS fails to start.

2013-08-26 13:14:11.097: [ AGFW][10] {2:27079:629} Agent sending reply for: RESOURCE_START[ora.ons 1] ID 4098:744107
2013-08-26 13:14:11.098: [ora.ons][14] {2:27079:629} [check] OnsAgent::check {
2013-08-26 13:14:11.098: [ora.ons][14] {2:27079:629} [check] getOracleHomeAttrib: oracle_home =
2013-08-26 13:14:11.099: [ AGFW][10] {2:27079:629} Agent sending reply for: RESOURCE_START[ora.ons 1] ID 4098:744107
2013-08-26 13:14:11.099: [ora.ons][14] {2:27079:629} [check] Utils:execCmd action = 3 flags = 6 ohome = /opmn/ cmdname = onsctli.
2013-08-26 13:14:11.213: [ora.ons][14] {2:27079:629} [check] (:CLSN00010:)getaddrinfo(localhost, 6100, 1) failed (host nor service provided, or not known):
2013-08-26 13:14:11.214: [ora.ons][14] {2:27079:629} [check] (:CLSN00010:)Can not resolve localhost for interface any
2013-08-26 13:14:11.214: [ora.ons][14] {2:27079:629} [check] (:CLSN00010:)ons is not running ...

- oraagent_grid.log shows VIP is registered, but public IP is Null.

2013-08-26 13:17:00.537: [ USRTHRD][27] {2:27079:638} Thread:RegEndpointThread:LISTENER start {
2013-08-26 13:17:00.537: [ USRTHRD][27] {2:27079:638} Thread:RegEndpointThread:LISTENER start }
2013-08-26 13:17:00.538: [ USRTHRD][408] {2:27079:638} Thread:RegEndpointThread:LISTENER Registering Endpoint nsgfei_EndpointInit() (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
2013-08-26 13:17:00.538: [ USRTHRD][408] {2:27079:638} Thread:RegEndpointThread:LISTENER Registering Endpoint nsgfei_EndpointInit() (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521)(IP=FIRST))
2013-08-26 13:17:00.551: [ USRTHRD][408] {2:27079:638} Thread:RegEndpointThread:LISTENER LsnrAgent, registered endpoint (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
2013-08-26 13:17:00.551: [ USRTHRD][408] {2:27079:638} Thread:RegEndpointThread:LISTENER LsnrAgent, registered endpoint (ADDRESS=(PROTOCOL=TCP)(*HOST=*)(PORT=1521)(IP=FIRST))

- Normally both Public IP and VIP should register to the listener dynamically. For Example:

$ lsnrctl status

...

Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))) <<<<<<< Public IP Endpoint registered
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))) <<<<<<< VIP Endpoint registered

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信db_bao,谢谢!

CHANGES

New Installation.

CAUSE

Start from 11.2 GRID Agent dynamically registers endpoints (VIP and Public IP) with the listener. Agent gets Public IP from /etc/hosts (if no DNS). If Agent fails to get Public IP, then the listener end point will not be created.

In this case, the root cause is incorrect permission of /etc/nsswitch.conf, which prevent Agent to get correct Public IP:

-rw-r----- 1 root sys 23 Oct 30 2012 /etc/nsswitch.conf

SOLUTION

Please contact OS Admin to check and correct the permission of /etc/nsswitch.conf. It should be like:

-rw-rw-rw- 1 root sys 23 Oct 30 2012 /etc/nsswitch.conf

The correct permission allows ora.ons to start and the end point of Public IP created for the listener.

REFERENCES

NOTE:1107295.1 - Linux: How to Configure the DNS Server for 11gR2 SCAN

总结

1、检查local_listener和remote_listener的值,且必须使用sid参数

2、检查/u01/app/11.2.0.4/grid/network/admin/listener.ora文件,添加如下内容,注意是grid用户,而不是oracle用户

3、启动和关闭监听需要使用srvctl命令:

标签:

头像

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复

嘿,我是小麦,需要帮助随时找我哦
  • 18509239930
  • 个人微信

  • 麦老师QQ聊天
  • 个人邮箱
  • 点击加入QQ群
  • 个人微店

  • 回到顶部
返回顶部