Sunday, June 1, 2008

Using Virtual Hostname When Installing an Oracle AS Instance

Print this post

 

How to force the Oracle Installer to use a virtual hostname rather than the 'real' hostname when installing an OracleAS instance?

solution

To ensure that the Oracle Installer picks up the desired hostname follow the steps below:

In this example the virtual hostname is virtualhost.oracle.com, and the real hostname is realhost.oracle.com

1. Set the ORACLE_HOSTNAME environment variable

ORACLE_HOSTNAME=virtualhost.oracle.com; export ORACLE_HOSTNAME

2. Edit the operating system hosts file and ensure that the virtual hostname is listed before the real host name (the file can be changed back after the install is complete) e.g

/etc/hosts

127.0.0.1 localhost
10.3.3.333 virtualhost.oracle.com
10.4.4.444 realhost.oracle.com

3. Install OracleAS using the runInstaller command line:

./runInstaller OUI_HOSTNAME=virtualhost.oracle.com

4. During the install you may hit

Bug 4290200 Abstract: OPMN CONFIG ASSISTANT FAILS WHEN INSTALLING "ON" A SECONDARY NIC

Do not exit the installer, instead follow the advice in the Release Notes, for example:

Oracle� Application Server Release Notes 10g Release 2 (10.1.2)

3.1.24 Additional Step Required When Installing OracleAS Web Cache on Multihomed (Multi-IP) Computers

and change the hostname in webcache.xml. Once this is done, retry the failed assistant and the install should complete successfully.

Important to note:

1. Setting OUI_HOSTNAME will change the ServerName HTTP Server directive to the value specified for OUI_HOSTNAME. You will still find, however, that the HTTP Server, Web Cache and AS Console components still listen on the ANY ip address, not just the particular IP address associated with the virtual hostname. It is expected behaviour and means that if you have 2 IP addresses on a machine, post install an OracleAS instance will be accessible via both IPs.

The HTTP Server, Web Cache and AS Console can be re-configured post install to listen only on a specific IP address.

a) HTTP Server: configure the Listen directive.

Reference:
Oracle� HTTP Server Administrator's Guide 10g Release 2 (10.1.2)
Chapter 5 Managing the Network Connections

b) Oracle Web Cache: configure the Listen Port section to specify a particular ip address

Reference:
Oracle� Application Server Web Cache Administrator's Guide 10g Release 2 (10.1. 2)
Chapter 8 Setup and Configuration
Task 6: Configure OracleAS Web Cache with Listening Ports for Client Requests 

c) AS Console: The console is accessed via it's own 'oc4j-based' lightweight listener. To force the AS Console to listen for requests against a particular ip address.

- Stop the AS Console
- Back up and then edit [ORACLE_HOME]/sysman/j2ee/config/emd-web-site.xml
- Change the line

<web-site host="[ALL]" port="18100" display-name="Oracle Enterprise Manager iAS Console Website" secure="false">

to

<web-site host="11.22.33.444" port="18100" display-name="Oracle Enterprise Manager iAS Console Website" secure="false">

where in this example the chosen ip address is 11.22.33.444.

- Start the AS Console

2. Let's say a machine, configured with multiple network cards (NICs) / virtual hosts, is to host two OracleAS instances. The business requirement is to have one OracleAS instance configured against one virtual host and the other OracleAS instance
configured against the other virtual host. In terms of the URLs the business would like to see the same listen ports number being used. Thus at install time the proposal is to use OUI_HOSTNAME and staticports.ini (the latter to ensure the same ports are used)

Given that each OracleAS instance will be configured against a different virtual host / ip address can the instances have the same ports defined in staticports.ini at install time?

The answer is no. The staticports.ini cannot be the same for both instances at install time. This is because using OUI_HOSTNAME at install time will only change the ServerName HTTP Server directive to the value specified for OUI_HOSTNAME. As stated above the HTTP Server, Web Cache and AS Console components listen on the ANY ip address, not a particular IP address. Consequently there is a potential for port conflict, for example:

OracleAS instance1 - virtual host=inst1, OHS port =7777. Out of the box OHS will listen on 7777 on ANY ip address
OracleAS instance2 - virtual host=inst2, OHS port =7777. Out of the box OHS will listen on 7777 on ANY ip address

The installer 'recognizes' this behaviour and validates whether the ports given in the staticports.ini have been used before in a previous OracleAS install on the same machine. If staticports.ini is not used then the installer will dynamically allocate port numbers which have not been used in the previous install.

Configuring components to listen on a specific ip address is, as described already above, has to be done post install. Therefore to allow the install of the second (and subsequent) OracleAS instances to be successful:

- the ports in staticports.ini must be different from what was specified for the first OracleAS instance install
OR
- do not use staticports.ini and let the installer allocate the ports for you.

 

1 comment:

Anonymous said...

Hi Rasheed,


No need of setting ORACLE_HOSTNAME if u have the privilege of editing the /etc/host.
steps are follows.
1. edit /etc/host with the first entry as vrtualhost.oracle.com
2.start the installation, application server will directly take the /etc/hosts first entry and you will get the AS URL with virtualhost name.

Regards
falah