Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Chapter 3: Configuring the Operating System for Adaptive Server [Table of Contents] Chapter 5: Using dsedit

Configuring Adaptive Server Enterprise for UNIX Platforms

[-] Chapter 4: The Interfaces File

Chapter 4

The Interfaces File

This chapter provides reference information about interfaces files in general and specific configuration information about server interfaces files. It includes the following topics:

Adaptive Servers and clients have their own interfaces files. Interfaces files of either type contain entries for all Adaptive Servers, Backup Servers, and other server products on the network.

Table 4-1 shows where to find further information on server and client interfaces file tasks and topics.

Table 4-1: Where to find interfaces file tasks and topics

Type of Interfaces File

Task or Topic

See

UNIX server or client

Adding entries for multiple Adaptive Server installations

Chapter 5, "Using dsedit." or Chapter 6, "Using dscp."

Modifying or deleting entries

Chapter 5, "Using dsedit." or Chapter 6, "Using dscp."

Reference information

"Understanding the Format of the Interfaces File"

Creating a master interfaces file for multiple installations

"Creating One Interfaces File for Multiple Installations"

Configuring for multiple networks

"Configuring Interfaces Files for Multiple Networks"

PC client

Configuring a client

Installing Adaptive Server and OmniConnect on UNIX Platforms

Reference information and instructions for advanced tasks

Open Client Supplement for your PC client platform or the appropriate Open Client(TM) documentation

Client platform not listed above

Configuring, reference information, and instructions for advanced tasks

Open Client Supplement for your client platform or the appropriate Open Client documentation

What Is an Interfaces File?

An interfaces file contains information about the network locations of servers.

In the Sybase client/server environment, a client can connect with Adaptive Server if it knows where the server resides on the network and if the server supports the client's language or character set. When a client initiates a connection, it looks in its interfaces file for the network location of the target server.

The interfaces file lists the name and address of every known server (including Backup Servers). When you are using a client program, and you want to connect with a particular server, the client program looks up the server name in the interfaces file and connects to that server. You can also supply the name of the server by using the DSQUERY environment variable.

Servers also need network information. When a server starts up, it looks in its interfaces file to determine where to listen for client connection requests. In addition, Adaptive Server can take on a client role when it makes remote procedure calls (RPCs) to other Adaptive Servers.

Creation and Location of an Interfaces File

The installation program, srvbuild, automatically creates an interfaces file for each server and client installation. The default location for an interfaces file is the Sybase installation directory (as determined by the value of the SYBASE environment variable on UNIX platforms).

The file name for an interfaces file varies by platform, as shown below.

Platform

File Name

Default Location

UNIX

interfaces

Sybase installation directory

PC/desktop (Windows, Windows 95, Windows NT, OS/2, DOS)

sql.ini

SYBASE_root/ini

Macintosh and Power Macintosh

interfaces

SYBASE_root:sybase

NetWare

interfac

SYBASE_root

In addition, the formats for the entries in an interfaces file vary by platform. This chapter describes the format of the interfaces file for UNIX platforms only.

Contents of an Interfaces File

An interfaces file contains network information about all servers on your network, including Adaptive Server, Backup Server, XP Server, plus any other server applications such as Adaptive Server Monitor(TM) Server, Replication Server(R) and Open Server.

The network information in the file includes the server name, network name or address of the host machine, and the port, object, or socket number (depending on the network protocol) on which the server listens for queries. See "Understanding the Format of the Interfaces File" for the specific makeup of the interfaces file entry.

An entry in the interfaces files can contain two types of lines:

The network information contained in master and query lines for a server is identical, because a server listens for connection requests on the same port that clients use to request connections.

Differences Between Client and Server Interfaces Files

A server needs both master and query lines in its interfaces file, since servers sometimes act as clients to other servers.

A client's interfaces file does not need a master line. It functions correctly with only a query line.

Multiple Installations

If you have more than one Adaptive Server installation, each server's interfaces file should contain information about all servers on the network. See Chapter 5, "Using dsedit," for information about adding entries for additional servers.

If all of your server products are running on the same platform, you can create one master interfaces file and copy that file to each machine. See "Creating One Interfaces File for Multiple Installations" for more information.

If the host machine supports multiple networks, see "Configuring Interfaces Files for Multiple Networks".

How Adaptive Server Uses an Interfaces File

Adaptive Server uses its interfaces file to listen for clients. To listen for queries, the server:

How a Client Uses an Interfaces File

In order for a client, or a server acting as a client, to connect to a server, it does the following:

Heterogeneous Environments

You can run Adaptive Server and clients on different platforms. Each platform may require a different format and configuration for its interfaces file.

Figure 4-1 illustrates how a client PC uses network information in its interfaces file (sql.ini) to connect to Adaptive Server running under UNIX and how Adaptive Server uses its interfaces file (interfaces) to connect to another server during a remote procedure call. Because the two Adaptive Servers in Figure 4-2 are running under the same operating system, they can use the same interfaces file or exact copies of the same file.

Figure 4-1: Establishing network connections in a heterogeneous environment
raster

Homogeneous Example

If both a client and a server are running under UNIX, a copy of the same interfaces file is valid for both. Figure 4-2 illustrates how clients and Adaptive Servers running in a homogeneous environment can use copies of the interfaces file to establish connections.

Figure 4-2: Establishing network connections in a homogeneous environment
raster

Utilities for Editing the Interfaces File

The Sybase utilities in Table 4-2 are provided for editing the network information in the interfaces file.

Table 4-2: Utilities for editing the interfaces file

Utility Name

Interface

Use to Edit

dsedit

X-Windows GUI

Sybase interfaces file (UNIX only).
See Chapter 5, "Using dsedit."

dscp

Command line

Sybase interfaces file (UNIX only). This utility is provided for users who do not have X-Windows functionality.
See Chapter 6, "Using dscp."

Creating One Interfaces File for Multiple Installations

Distributing copies of one consistent interfaces file (a "master" file) with entries for all Adaptive Servers is the easiest way to maintain consistency in the interfaces files in a homogeneous environment on a network.

You make all changes to one version of the file and then copy the updated master file to all appropriate UNIX Sybase directories.

You can make a master file in one of two ways:

Using dsedit or dscp to Create a Master Interfaces File

You can use the dsedit or dscp utility to create a master interfaces file, which you can then distribute to all servers. If you are not an experienced Sybase user, you may find that using dsedit or dscp is easier than using a text editor. Using dsedit or dscp also ensures that your interfaces file is consistent in format (no aberrant spaces, tabs, and so forth).

  1. Select the interfaces file that contains the most complete, up-to-date information.

  2. Begin a dsedit session in your latest Sybase installation to edit this interfaces file. Add entries for any Adaptive Servers or Backup Servers that are not listed in this file. Follow the instructions in Chapter 5, "Using dsedit."

Using a Text Editor to Create a Master Interfaces File

To construct a single master interfaces file from several individual interfaces files, concatenate the individual interfaces files. Make a copy of the file, and then use a text editor to modify the resulting file. The following elements must be correct and unambiguous in the resulting file:

Understanding the Format of the Interfaces File

When Adaptive Server is installed, srvbuild creates an entry for it in the interfaces file. Examine this entry for an example of the proper syntax of the interfaces file entry elements described in the following sections.

Format by Platform

Each Adaptive Server that you plan to use has only one entry, although there may be multiple lines in the entry. Each interfaces file entry has the following format:

For Digital UNIX:

# put comments here<newline>
SERVERNAME<tab>retry_attemps<tab>delay_interval<newline>
<tab>service_type protocol network host port/object_number<newline>
<blank lines or comments between entries for different servers>

For HP-UX:

# put comments here<newline>
SERVERNAME<tab>retry_attemps<tab>delay_interval<newline>
<tab>service_type protocol network machine port<newline>
<blank lines or comments between entries for different servers>

For IBM RS/6000:

# put comments here<newline>
SERVERNAME<tab>retry_attempts<tab>delay_interval<newline>
<tab>service_type protocol network machine port<newline>
<blank lines or comments between entries for different SQL Servers>

For Sun Solaris:

# put comments here<newline> 
SERVERNAME<tab>retry_attempts<tab>delay_interval<newline>
<tab>service_type<tab>api<tab>protocol<tab>device <tab>address<newline>
<blank lines between entries for different servers>

Description of the Components of an Interface File Entry

Note: Each entry line that follows the "SERVERNAME" line must begin with a space or a character tab. Otherwise, the entry will not work. Use a single space between each element on the entry line.

Table 4-3 describes the components of an interfaces file entry.

Table 4-3: Components of an interfaces file for UNIX

Component

Value

SERVERNAME

Name of Adaptive Server or Backup Server.

Requirements for a server name:

  • It can be no more than 30 characters long.
  • First character must be a letter (ASCII a-z, A-Z).
  • The characters that follow must be letters, numbers, or underscores (_).

retry_attempts (optional)

Number of times you want the client to try to connect to a server after initial failure. Default is 0.

delay_interval (optional)

Number of seconds between connection attempts. Default is 0.

service_type

Type of service defined by entry. Must be one of three values:

protocol

Name of the network protocol. Protocols available are:

  • TCP/IP, represented by the letters "tcp". (HP-UX, IBM RS/6000, Sun Solaris)
  • SPX, represented by the letters "spx". (HP-UX, IBM RS/6000, Sun Solaris)
  • DECnet, represented by the letters "decnet". (Digital UNIX)

network

Name of the network; not currently used by Adaptive Server. srvbuild enters "ether" as a placeholder.

host

Network name or address of server's host machine.

  • For TCP/IP, use either the host name or internet address. Maximum size of entry is 32 bytes.

    To determine the host name of a machine, log into that machine and enter:
    /bin/hostname

  • For DECnet, use the node name. Maximum size of entry is 6 bytes.

machine

Network name or address of server's host machine.

You can use either the host name or internet address. Maximum size of entry is 32 bytes.

To determine the host name of a machine, log into that machine and enter:
/bin/hostname

port/object number

  • For TCP/IP networks, port is a unique port number between 1025 and 65535. Check the /etc/services file on each machine on the network to see what port numbers are in use. Enter the Adaptive Server port number in a new section of /etc/services labeled "Sybase specific services." You do not have to make this entry for the operating system to function properly, but the presence of the port number in the file may prevent other users from using that number.
  • For DECnet networks, object is an object number between 128 and 253. The number must be unique to the node on which the server is running.

port

A unique port number between 1025 and 65535. Check the /etc/services file on each machine on the network to see what port numbers are in use. Enter the Adaptive Server port number in a new section of /etc/services labeled "Sybase specific services." You do not have to make this entry for the operating system to function properly, but the presence of the port number in the file may prevent other users from using that port number.

SPX Format

If you have obtained and installed Novell Protocol Suite Version 3.0.1, you can create interfaces file entries to support the SPX/IPX protocol. Interfaces file entries for SPX have the format:

# put comments here<newline> 
SERVERNAME<tab>retry_attempts<tab>delay_interval<newline>
<tab>service_type api protocol device address<newline>
<blank lines between entries for different servers>
Note: Each entry line that follows the "SERVERNAME" line must begin with a <tab> character or a blank space. Also, use a single space between each element on an entry line.

The SERVERNAME, retry_attempts, delay_interval, and service_type elements have the same meaning in an SPX entry as in a TCP entry.

The following sections describe the remaining elements in the interfaces file.

api

api is the application programming interface to the network. Since Adaptive Server always uses the Transport Layer Interface (TLI) for SPX protocol connections, always use the letters "tli" for this field.

protocol

protocol is the name of the network protocol. Use the letters "spx" to designate the SPX protocol.

device

device is the network device endpoint supplied for SPX networks. The device that is supplied with the Novell Protocol Suite network software is named /dev/nspx.

address

address is a composite entry generated from the network number, node, and socket number, as described below:

For example, if your machine has a network number of 4D160D14, a node number of 000000000001, and you use socket number 86bb, sybinit adds the address entry:

/x4D160D1400000000000186bb

Interfaces File Example

Figure 4-3 illustrates an environment with three UNIX Adaptive Servers and one UNIX client. The interfaces file shown is a master interfaces file that works for each server and the client on the four machines shown:

Figure 4-3: An interfaces file for three Adaptive Servers
raster

Configuring Interfaces Files for Multiple Networks

On some platforms, Adaptive Server can accommodate multiple networks. This allows Adaptive Server to listen for clients over multiple network interfaces. You must add an entry for each network interface to the interfaces file.

Configuring the Server for Multiple Network Handlers

Follow these steps to configure multiple network listeners:

  1. Define a unique host name for each network interface in your operating system's host database.

  2. In your interfaces file, use a text editor to add copies of the "master" line for your Adaptive Server, one for each additional interface you want the server to listen on.

  3. Include a unique host name on each line to configure a network handler for each network interface.

  4. Port numbers within the interface need not be the same, but they can be. They fall under the same rules for naming and numeric range as the primary network interface.

    Following is an example interfaces file for an Adaptive Server with two network interfaces, each connected to a different network. The server host machine is connected to a TCI/IP network, on which it is called serv_corpnet, and a DECnet network, on which it is called serv_engnet.

    # PRODUCTION server with two network listeners
    PRODUCTION<tab>3<tab>3<newline>
    master tcp ether serv_corpnet 6464
    master decnet ether serv_engnet 150
    query tcp ether zeppo 6464
    The following is an example interfaces file for an Adaptive Server with two network interfaces. The server host machine is known as serv_corpnet on the corporate network and serv_engnet on the engineering network.

    # PRODUCTION server with two network listeners
    PRODUCTION<tab>3<tab>3<newline>
    master tcp ether serv_corpnet 4559
    master tcp ether serv_engnet 5479
    query tcp ether serv_corpnet 4559
    The next time Adaptive Server is restarted, it spawns a network handler process for each "master" line in the entry that corresponds to the server's DSLISTEN value. Connections made on each interface will be handled equally, as peers.

Configuring the Client Connections

When an Adaptive Server client scans the interfaces file for a server name, the client uses the first "query" entry it encounters for the server's entry. This makes configuring clients to use multiple network connections less straightforward than configuring the server ports. You have two choices:

Using Different DSQUERY Names

The steps for using different DSQUERY names for each network listener are as follows:

  1. Choose an additional server name. You can concatenate the original server name and the network name. For example, if your server is named PRODUCTION, you might choose the names PRODUCTION_network1 and PRODUCTION_network2.

  2. For PC clients, use sqledit to create multiple sql.ini file entries for the server, one for each network. In our example, you would create one entry for PRODUCTION_network 1 and one for PRODUCTION_network2.

    See the Open Client documentation for your client platform for more information.

    For UNIX clients, you can edit the interfaces files with a text editor. From the server's interfaces files, copy the server name line and the "master" line for each network into the client interfaces file. Add the appropriate server name for each entry, and change "master" to "query." See the examples below.

    # Client entry for PRODUCTION on network1
    PRODUCTION_network1 3 3
    query tcp ether zeppo 6464

    # Client entry for PRODUCTION on network2
    PRODUCTION_network2 3 3
    query decnet ether chico 150
    # Client entry for PRODUCTION on network1
    PRODUCTION_network1<tab>3<tab>3<newline>
    query tcp ether serv_corpnet 4559
    # Client entry for PRODUCTION on network2
    PRODUCTION_network2<tab>3<tab>3<newline>
    query tcp ether serv_engnet 5479

Clients on each network must use the DSQUERY value that corresponds to the network the client is on, in the above example either PRODUCTION_network1 or PRODUCTION_network2.

Using One, Network-Independent DSQUERY Name

If uniform client DSQUERY naming is important, you can mask the necessary difference in the network addressing of the clients in the interfaces file. You can install separate $SYBASE installation directories and distinct interfaces files on client file servers on each network to allow users to connect to the correct network address. Instead of altering the DSQUERY name the clients use, you maintain one DSQUERY name for all clients, on all networks, and alter each network's interfaces file accordingly.

This method assumes that:

Using this method, the preceding interfaces file example adapted for this "single DSQUERY" method would look like this on the "corporate" network in a homogeneous environment:

#PRODUCTION server network1
PRODUCTION 3 3
query tcp ether zeppo 6464
master tcp ether zeppo 6464
master decnet ether chico 150
# PRODUCTION server network1
PRODUCTION<tab>3<tab>3<newline>
query tcp ether serv_corpnet 4559
master tcp ether serv_corpnet 4559
master tcp ether serv_engnet 5479

And like this on the "engineering" network:

#PRODUCTION server network2
PRODUCTION 3 3
query decnet ether chico 150
master tcp ether zeppo 6464
master decnet ether chico 150
# PRODUCTION server network2
PRODUCTION<tab>3<tab>3<newline>
query tcp ether serv_engnet 5470
master tcp ether serv_corpnet 4559
master tcp ether serv_engnet 5479

The "query" line in each file name is different, depending on the network to be used.

The full "master" entry is present in both files. This is allowed because only Adaptive Server will use the "master" lines. Assuming that the server host machine can see both networks (both host names are interchangeable), it doesn't matter which interfaces file is used for Adaptive Server start-up.

Query Port Backup Configuration

Another use for multiple network interfaces is to provide a backup in case of network failure. If a client is connected to a server via two networks, the client can establish a connection via the second network if the first one goes down.

Install multiple "master" and "query" lines in a server entry in the interfaces file. This configuration sets up multiple network handlers; Adaptive Server listens for connections at both ports. Clients looking for a host name and a port number for a connection to an Adaptive Server will try the port on each "query" line in order, until they establish a connection.

For example, to configure a backup network that will be used only if the normal connection fails, make the second network "network2", as in this example:

#PRODUCTION server with two network listeners
PRODUCTION 3 3
query tcp ether zeppo 6464
query decnet ether chico 150
master tcp ether zeppo 6464
master decnet ether chico 150
# PRODUCTION server with two network listeners
PRODUCTION<tab>3<tab>3<newline>
master tcp ether serv_corpnet 4559
master tcp ether serv_engnet 5479
query tcp ether serv_corpnet 4559
query tcp ether serv_engnet 5479

Configure PC client interfaces files with the appropriate multiple "query" entries, as described in the Open Client documentation. For client interfaces files in a homogeneous environment, you can copy the entire interfaces file entry for the Adaptive Server into the client interfaces file.

A connection on this secondary port will take place only if the corporate network is disabled in some way, or the if corporate network interface on the host machine fails or is shut down. The failure would have to be network-related.


Chapter 3: Configuring the Operating System for Adaptive Server [Table of Contents] Chapter 5: Using dsedit