![]() | ![]() |
Home |
|
|
Configuring Adaptive Server Enterprise for UNIX Platforms |
|
| 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.
Type of Interfaces File | Task or Topic | See |
|---|---|---|
UNIX server or client | Adding entries for multiple Adaptive Server installations | |
Modifying or deleting entries | ||
Reference information | ||
Creating a master interfaces file for multiple installations | ||
Configuring 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 |
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.
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.
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.
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.
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".
Adaptive Server uses its interfaces file to listen for clients. To listen for queries, the server:
In order for a client, or a server acting as a client, to connect to a server, it does the following:
The Open Client documentation discusses client connections in much greater detail. See the Open/Client Supplement for your client platform or the appropriate Open/Client documentation.
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
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
The Sybase utilities in Table 4-2 are provided for editing the network information in the interfaces file.
Utility Name | Interface | Use to Edit |
|---|---|---|
dsedit | X-Windows GUI | Sybase interfaces file (UNIX only). |
dscp | Command line | Sybase interfaces file (UNIX only). This utility is provided for users who do not have X-Windows functionality. |
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:
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).
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:
Each server entry in the interfaces file must be unique. During a srvbuild session, you had the choice of entering a server name or accepting the default server name, "SYBASE", for those servers. If you accepted the default name, find any duplicate "SYBASE" entries in your merged file, and rename them.
WARNING! If you manually edit an interfaces file, be sure that, for each entry, each line following the first line begins with a <tab> character.
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.
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:
# 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>
# 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>
# 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>
# 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>
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.
Component | Value |
|---|---|
SERVERNAME | Name of Adaptive Server or Backup Server. Requirements for a server name:
|
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:
|
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.
|
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: |
port/object number |
|
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. |
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 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 is the name of the network protocol. Use the letters "spx" to designate the SPX protocol.
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 is a composite entry generated from the network number, node, and socket number, as described below:
Both the network number and node are assigned by the network administrator of your system. You can check the /usr/netware/npsconfig file to determine the network and node numbers for your machine.
If you choose a socket number that is already in use on the machine where your Adaptive Server is located, you receive a message like the following when you attempt to restart your Adaptive Server:
ninit: t_bind, Incorrect permissions
ninitconn_free: t_close, fd=5, Illegal transport fd
ninit: All master network listeners have failed. Shutting down.
ueshutdown: exiting
More than one Adaptive Server can have the same socket number if each server is on a different machine. The combination of network number, node, and socket uniquely identifies the Adaptive Server.
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
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
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.
Follow these steps to configure multiple network listeners:
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 listenersThe 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<tab>3<tab>3<newline>
master tcp ether serv_corpnet 6464
master decnet ether serv_engnet 150
query tcp ether zeppo 6464
# PRODUCTION server with two network listenersThe 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.
PRODUCTION<tab>3<tab>3<newline>
master tcp ether serv_corpnet 4559
master tcp ether serv_engnet 5479
query tcp ether serv_corpnet 4559
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:
The steps for using different DSQUERY names for each network listener are as follows:
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.
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.
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.
|
|