關於10g RAC監聽設定,tnsnames.ora設定,VIP及客戶端配置問題。

tolywang發表於2007-12-13

[float=left][float=left]按照文件安裝完成,但是lsnrctl status 沒有發現節點2

gnd-rac01$lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 13-DEC-2007 11:29:16

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                13-DEC-2007 11:00:20
Uptime                    0 days 0 hr. 28 min. 55 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/product/oracle/network/admin/listener.ora
Listener Log File         /u01/product/oracle/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gnd-rac01)(PORT=1521)))
Services Summary...
Service "tpc" has 1 instance(s).
  Instance "tpc1", status READY, has 2 handler(s) for this service...
Service "tpcXDB" has 1 instance(s).
  Instance "tpc1", status READY, has 1 handler(s) for this service...
Service "tpc_XPT" has 1 instance(s).
  Instance "tpc1", status READY, has 2 handler(s) for this service...
The command completed successfully



----------------------------------------------------------------------------------------------------   



SQL> show parameter  listener        

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string
remote_listener                   string      LISTENERS_TPC
SQL>




---------------------------------------------------------------------------------------------------------------   


gnd-rac01$cat hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
# 127.0.0.1     gnd-rac01

127.0.0.1               localhost.localdomain    localhost

172.20.1.19     gnd-rac01
10.1.0.1           gnd-pri01
172.20.1.29     gnd-vip01

172.20.1.18     gnd-rac02
10.1.0.2           gnd-pri02
172.20.1.28     gnd-vip02


---------------------------------------------------------------------------------------------------------------   


監聽預設設定:    (這裡的10.155.4.95是另外一個public nic , 在安裝crs的時候do not use )

gnd-rac01$cat listener.ora
# listener.ora.gnd-rac01 Network Configuration File: /u01/product/oracle/network/admin/listener.ora.gnd-rac01
# Generated by Oracle configuration tools.

LISTENER_GND-RAC01 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521)(IP = FIRST))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.155.4.95)(PORT = 1521)(IP = FIRST))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
    )
  )




---------------------------------------------------------------------------------------------------------------   



tnsnames.ora 設定:


gnd-rac01$cat    tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/product/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

TPC2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = tpc)
      (INSTANCE_NAME = tpc2)
    )
  )

TPC1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = tpc)
      (INSTANCE_NAME = tpc1)
    )
  )

TPC =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = tpc)
    )
  )

LISTENERS_TPC =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
  )




--------------------------------------------------------------------------------------------------------------------------------  




這樣的預設設定需要如何更改 ?  

在DBCA的時候沒有配置TAF , 客戶端如何設定連線 ?   

目前用單機連線方式  (ADDRESS = (PROTOCOL = TCP)(HOST = 10.155.4.95)(PORT = 1521)(IP = FIRST)) 可以,配置如下:


GND-RAC1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.155.4.95)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = tpc)
      (INSTANCE_NAME = tpc1)
    )
  )


只有 10.155.4.95 能連線,  其他ip配置都不能連線

 

----------------- 

RAC 客戶端程式設定tnsnames.ora  

TPC_RAC =
  (DESCRIPTION =
    (FAILOVER=ON)
    (LOAD_BALANCE = ON)
      (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = TPC)
      (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))
    )
  )


其中VIP名稱更改為虛擬IP也可以 .   

 

  [/float][/float]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-127530/,如需轉載,請註明出處,否則將追究法律責任。

相關文章