DCE and DFS for Linux Installation and Configuration Guide
[Previous]
[Next]
[Contents]
[Index]
E.1 Controlling CDS Cache Operations
This appendix is copied and modified from the Entegrity PC-DCE Administrator's Guide.
E.1.1 CDS Cache Overview
The CDS cache is a collection of information about servers, clearinghouses, and other CDS resources that a CDS clerk establishes on the local system for its reference. When the CDS clerk receives a CDS server's response to a query, it stores the response in its cache. The next time the clerk needs this information, the clerk retrieves it from the cache rather than issuing a network request to a CDS server.
E.1.1.1 Cache Implementation
The CDS Cache is maintained in two areas: common (global) cache and per-user cache.
-
The common cache contains information available to everyone (for example cell name, directory entries, and clearinghouses). This file, called cds_cache.000000000X (X represents a number that increments), is located in opt/dcelocal/var/adm/directory/cds.
The common CDS cache information is protected by DCE ACLs.
-
The per-user cache contains user-specific information (softlinks, groups, etc.). This file, called cds_server_name_cache.00000000X (X represents a number that increments), is located in opt/dcelocal/var/adm/directory/cds/machine name.
Per-user information is protected against unauthorized access by DCE
ACLs and, if the machine is using the NTFS file system, by NTFS file
security.
In DCE, the CDS Clerk is implemented as a DLL whereas the CDS Advertiser is a separate process (cdsadv). The cache and advertiser interconnect using an Windows-specific interprocess communications protocol.
The cache is periodically dumped to disk in the set of files stored in install_directory/opt/dcelocal/var/adm/directory/cds/*.*.
E.1.1.2 Lifetime of Cached Information
Information remains stored in the cache until either of the following occurs:
For example, if a user accesses a CDS server first thing in the morning to locate the services, subsequent lookups during the remainder of the day take advantage of the cache. The next morning, this whole process takes place again because the cached data has become stale or the user has logged into DCE again.
None of the CDS cache information stays fresh indefinitely.
E.1.1.3 CDS Cache Size
The CDS Cache Size is tunable. To set the CDS Cache Size, use the CDS_CACHE_SIZE system environment variable. If this variable does not already exist, you must create it.
See /opt/dcelocal/etc/setup_state, for examples of environment variables. You can add the environment variable CDS_CACHE_SIZE=<size in bytes> there.
The increased cache will be available the next time you start your computer.
E.1.1.4 How a Client Selects a Clearinghouse
When a client needs to read data from CDS, it contacts a clearinghouse. Because a cell can contain many clearinghouses, the client needs a mechanism to help it choose a clearinghouse based on clearinghouse performance and availability. For example, for performance reasons the client ideally uses a clearinghouse connected to the local LAN, but may need to connect to another clearinghouse when the local clearinghouse is down.
The client selects a clearinghouse from a list of clearinghouses stored in the client's CDS cache. The client keeps the list sorted in an order that keeps clearinghouses that are both local (on the same LAN) and available at the top of the list. The client attempts to contact clearinghouses in the order that they appear in the list.
E.1.1.5 How a Client Builds the Clearinghouse List
The CDS cache contains a section with entries for each clearinghouse that it knows about. It learns about clearinghouses in the following ways:
E.1.1.6 How a Client Sorts the Clearinghouse List
Each clearinghouse entry in the cache is marked with two flags: OK and OnLAN. The OK flag indicates whether or not the clearinghouse was last known to be responding to requests (available), and the OnLAN flag indicates whether or not the clearinghouse is located on the local LAN.
The client sorts the list in the following order:
-
OK and OnLAN
-
OK and not OnLAN
-
Not OK
The client keeps the OK and OnLAN flags updated using the following methods:
Note that, at configuration time, the CDS clerk sets the OnLAN flag for the preferred CDS server, even if the preferred CDS server is outside of the LAN. cdsadv pings servers that are marked Not OK. If the preferred server (outside the LAN) goes down, cdsadv continues to ping it, allowing the server to be sorted to the top of the cache again when the server comes back up.
When a clearinghouse entry is added to the cache, the entry is initially flagged as OK. The CDS clerk flags the entry as Not OK if it tries to reach the clearinghouse but there is no response. The entry gets set to OK again in one of the following ways:
E.1.2 Using CDS Preferencing to Control Sorting of the Clearinghouse List
The CDS preferencing feature lets you assign integer ranks to clearinghouses. The ranks affect the sorting of the cached clearinghouse list.
E.1.2.1 How CDS Preferencing Works
You assign ranks to clearinghouses in a preference file, which DCE reads at startup. Ranks with lower values are preferred.
If the file does not contain an entry for a particular clearinghouse, DCE calculates a rank. The calculation is based on IP address:
If the file does contain an entry for a particular clearinghouse, this is considered an override. Clearinghouses with override ranks are sorted a little differently from clearinghouses with calculated ranks, as described below.
Section E.1.1.6, How a Client Sorts the Clearinghouse List stated that the client sorts the cached clearinghouse list in the following order:
-
OK and OnLAN
-
OK and Not OnLAN
-
Not OK
Ranks affect this sorting as follows:
-
OK and OnLAN, as well as OK and Not OnLAN clearinghouses with override ranks. This section of the list is not sorted any further.
-
OK and Not OnLAN. This section of the list is sorted by rank.
-
Not OK. This section of the list is not sorted any further.
E.1.2.2 Creating the Preference File
The preference file is a text file named cds_serv_pref located in install_directory/opt/dcelocal/etc. The file contains a series of one-line entries, where each entry consists of a clearinghouse name and the rank for that clearinghouse.
Specify the clearinghouse name (name_ch) using one of the following formats:
/.../cellname/name_ch
/name_ch
name_ch
/.:/name_ch
If the clearinghouse's cellname is not specified, the local cell is assumed.
The rank is a 16-bit unsigned integer (range 0x0000 [0] - 0xffff [65535]). A lower number indicates a stronger preference. A rank of 65535 specifies that the clearinghouse is never to be contacted.
Specify the rank in decimal, octal (with leading "0") or hex (with leading "0x").
Blank lines are ignored. You can include comments after the "#" character.
Example file:
# This is an example preference file
/.:/foo_ch 50 # most preferred clearinghouse
/.:/bar_ch 100
/.../mycellname/baz_ch 100
When you create or edit the preference file, you must:
-
Stop DCE.
-
Delete the CDS cache file (install_directory/opt/dcelocal/var/adm/directory/cds/*.*).
-
Restart DCE.
E.1.2.3 Viewing Ranks
You can view the rank of a cached clearinghouse on a full client using the following commands:
dcecp -c cdscache show -clearinghouse /.:/name_ch
cdscp show cached clearinghouse /.:/name_ch
E.1.2.4 CDS Preferencing Example
Suppose a client's preference file is as follows:
/.:/a_ch 100 # most preferred clearinghouse
/.:/b_ch 200 # preferred local backup
/.:/c_ch 500 # preferred off-LAN backup
Table 6-1 demonstrates cache sorting based on clearinghouse flags and ranks:
Table 5-1: Demonstration of Cache Sorting
Sort Order
|
Clearinghouse
|
Flags
|
Rank
|
---|
1
|
a_ch
|
OK, OnLAN
|
100 (override)
|
2
|
c_ch
|
OK, Not OnLAN
|
500 (override)
|
3
|
d_ch
|
OK, OnLAN
|
20000
|
|
|
|
|
4
|
e_ch
|
OK, Not OnLAN
|
30000
|
5
|
f_ch
|
OK, Not OnLAN
|
40000
|
6
|
g_ch
|
OK, Not OnLAN
|
40000
|
|
|
|
|
7
|
h_ch
|
Not OK, Not OnLAN
|
40000
|
8
|
i_ch
|
Not OK, Not OnLAN
|
40000
|
9
|
j_ch
|
Not OK, Not OnLAN
|
40000
|
10
|
b_ch
|
Not OK, OnLAN
|
200 (override)
|
11
|
l_ch
|
Not OK, Not OnLAN
|
40000
|
The first section of the sorted cache includes all OK and OnLAN clearinghouses, as well as OK and Not OnLAN clearinghouses with override ranks. In the example, this section contains three clearinghouses: a_ch, c_ch, and d_ch. Clearinghouse a_ch is the client's most preferred clearinghouse according to its override rank of 100. Clearinghouse c_ch is sorted next even though it is off-LAN because of its override rank of 500. The final entry in the first section is clearinghouse d_ch, which has an automatically assigned rank.
The second section of the sorted cache includes OK and Not OnLAN clearinghouses sorted by rank. In this example, all clearinghouses in this section have automatically assigned ranks. Notice that clearinghouse e_ch is sorted to the top of this section because it is on the client's subnet and therefore has a rank of 30000.
The third section of the sorted cache includes all Not OK clearinghouses and is unsorted. Notice that clearinghouse b_ch appears in this section despite its low rank. When b_ch comes back online and the client detects this, the client will move b_ch to the first section of the cache.
E.1.3 Refreshing Cached Application Server Data
If you are concerned your client is using stale CDS information, you can update the cache as follows:
You can use the CDS Preferencing feature to control which CDS clearinghouses that the client runtime queries.
[Previous]
[Next]
[Contents]
[Index]
To make comments or ask for help, contact
support@entegrity.com.
Copyright © 2001-2004 Entegrity Solutions Corporation & its subsidiaries