Configuring_name_resolution_on_AIX

There is a newer version of this page. You can find it here.

Configuring name resolution on AIX

Name resolution is required by xCAT. You can use a simple /etc/hosts mechanism or you can optionally set up a DNS name server. In either case you must start by setting up the /etc/hosts file.

If you do not set up DNS you may need to distribute new versions of the /etc/hosts file to all the cluster nodes whenever you add new nodes to the cluster.

Add cluster nodes to the /etc/hosts file

There are several ways to get entries for all the cluster nodes in the /etc/hosts file.

These include:

  • Manually adding the entries.
  • Running a custom script that uses some cluster naming convention to automate the adding of the node entries. (User-provided.)
  • Using the xCAT makehosts command after the XCAT node definitions have been created.

If you are dealing with a large number of nodes this task can be quite tedious. The xCAT makehosts option may be useful in some cases. This process uses a regular expression to automatically determine the IP addresses and hostnames for a set of nodes. To use this method you must decide on appropriate naming conventions and IP address ranges for your nodes. This process may seem a bit complicated but once you get things set up it can save time and add structure to your cluster.

If you choose to use this process you will have to come back to this section after you have created the xCAT node definitions later in this process. You should read through this now and decide on naming conventions etc. for when you create your xCAT node definitions.

The basic process is:

  • Decide on a node naming convention such that the node IP & long hostname can be determined from the node name.
  • Include all the nodes in a node "group" definition.
  • Set the group "ip" and "hostnames" attribute to a regular expression that can be used to derive the node IP and hostname.
  • Run the makehosts command to add all the node information to the /etc/hosts file. See the man page for makehosts .

As an example, suppose we decide on a node naming convention that includes the hardware frame number, the CEC number and the partition number. (Say "clstrf01c01p01" etc.) Also, lets say that the IP addresses would look something like "100.1.1.1" where the second number is the frame number, the third is the CEC number and the forth is the partition number.

With this example we can define a regular expression that, given a node name, could be used to derive a corresponding IP address and long hostname.

To have this regular expression applied to each node you can make use of the xCAT node group support. Let's say that all your cluster nodes belong to the group "compute". I can add the following values to the "compute" group definition.

_**chdef -t group -o compute ip='|clstrf(\d+)c(\d+)p(\d+)|10.($1+0).($2+0).($3+0)|' hostnames='|(.*)|($1).cluster.com|'**_

This basically says that for any node in the "compute" group the "ip" can be derived by the regular expression '|clstrf(\d+)c(\d+)p(\d+)|10.($1+0).($2+0).($3+0)|' , and the hostname can be derived from the expression |(.*)|($1).mycluster.com|'.

So let's say that you have defined all your nodes using the xCAT support such as rscan or mkvm using the naming convention mentioned above. Now you could display the node definition as follows:

_lsdef -l clstrf01c02p03_

Since this node belongs to the "compute" group, when I display the definition it will use the regular expressions to derive the "ip" and "hostnames" values.

The output might look something like the following:

_Object name: clstrf01c02p03_
_cons=hmc_
_groups=lpar,all,compute_
_hcp=clstrhmc01_
_hostnames=clstrf01c02p03.mycluster.com_
_id=1_
_ip=10.1.2.3_
_mac=001a64f9c009_
_mgt=hmc_
_nodetype=ppc,osi_
_hwtype=lpar_
_os=AIX_
_parent=clstrf1fsp01-9125-F2A-SN024C332_
_postscripts=myscript_
_profile=MYimg_

Now that all the nodes have an "ip" and "hostnames" value you can run the xCAT makehosts command to update /etc/hosts.

_**makehosts compute -l**_

Set up a DNS nameserver

To set up the management node as the DNS name server you must set the "domain", "nameservers" and "forwarders" attributes in the xCAT "site" definition.

For example, if the cluster domain is "mycluster.com", the IP address of the management node is "100.0.0.41" and the site DNS servers are "9.14.8.1,9.14.8.2" then you would run the following command.

_**chdef -t site domain= mycluster.com nameservers= 100.0.0.41 forwarders= 9.14.8.1,9.14.8.2**_

Edit "/etc/resolv.conf" to contain the cluster domain and nameserver. For example:

_search mycluster.com_
_nameserver 100..0.0.41_

Create xCAT network definitions for each of the cluster networks. (Your network and mask value need to be defined for makedns to be able to set up the correct ip range for the management node to serve.)

You will need a name for the network and values for the following attributes.

**net** The network address.
**mask** The network mask.
**gateway** The network gateway.

You can use the xCAT makenetworks command to gather cluster network information and create xCAT network definitions. See the makenetworks man page for details. (This feature is available in xCAT 2.3 and beyond.)

You can also use the xCAT mkdef command to define the network.

For example:

_**mkdef -t network -o net1 net=9.114.113.224 mask=255.255.255.224 gateway=9.114.113.254**_

Run makedns to create the /etc/named.conf file and populate the /var/named directory with resolution files.

_**makedns**_

Start DNS:

_**startsrc -s named**_

Creating node resolv.conf files

Each cluster node should have the appropriate resolv.conf file.

The file creations could be handled manually or you could use the xCAT support to automate the creation of the files when the nodes are installed.

This section provides an overview of the various ways you can set up resolv.conf files in the cluster using xCAT. Additional details will be covered in the xCAT installation documentation.

Providing "domain" and "nameservers" values

The resolv.conf file requires a "domain" value and a "nameservers" value. When using xCAT you must provide this information in one of three ways:

1) Create a NIM resolv_conf resource and include it in your xCAT osimage definition. To do this you must create a NIM reolv_conf resource on the xCAT management node and include it in the xCAT osimage definition you will use to install the cluster nodes.

2) Add values for the "domain" and "nameservers" attributes to the xCAT "site" definition. When setting up a cluster the xCAT "site" definition is used to save some basic cluster-wide information. You can add the "domain" and "nameservers" values to the "site" definition using the xCAT chdef command. For example:

_chdef -t site domain=mycluster.com nameservers=30.1.0.102_

3) Add values for the "domain" and "nameservers" attributes to the xCAT "network" definitions. An xCAT "network" definition must be created for each network that is used for cluster management. You can add the "domain" and "nameservers" values to the network definitions using the chdef command. For example:

 _chdef -t network -o cluster_net domain=mycluster.com nameservers=30.1.0.102_

When xCAT is determining the resolv.conf file for a node it will use the following priority order:

  1. The user provided resolv_conf resource is used if provided.
  2. If there is no resolv_conf resource then the information from the network definition, that corresponds to the node, will be used. (I.e. If the node is located on the "cluster_net" network then the "domain" and "nameservers" values from that network definition will be used.
  3. If there is no resolv_conf resource AND the network definition does not contain the "domain" and "nameservers" values then the "site" definition will be used.
  4. If the "domain" and "nameservers" values are not provided in any of the above then no resolv.conf file will be created on the nodes.

When setting the value for the "nameservers" attribute you may either use a comma-separated list of server IP addresses OR the keyword "<xcatmaster>". The "<xcatmaster>" keyword will be interpreted as the value of the "xcatmaster" attribute of the node definition. The "xcatmaster" value for a node is the name of it's server as known by the node. This would be either the name of the service node or the name of the management node.

Description of basic options

Use the following descrptions to determine how you would like to have your resolv.conf set up in the cluster.

Options:

1) Osimage oriented resolv.conf files.

 If you include a NIM resolv_conf resource in an osimage definition then all nodes that are installed with that osimage will get the same resolv.conf file.

2) Service node oriented resolv.conf files.

 In this case you would set the "domain" and "nameservers" attributes in the site definition but not the network definitions. The "namesevers" attribute would be set to "&lt;xcatmaster&gt;".

 The result would be that each node would get a resolv.conf file that contained the "domain" value from the site definition. The "nameservers" value would be the name of the nodes server as known by the node. (I.e. The server interface that is on the same network.)

3) Cluster oriented resolv.conf files.

 In this case you would set the "domain" and "nameservers" attributes in the site definition but not the network definitions. The "namesevers" attribute would be set to one or more comma-separated server names (IP addresses).

 The result would be that each node would get a resolv.conf file that contained the "domain" and "nameservers" values from the site definition.

4) Service node/network oriented resolv.conf files.

 In this case you would set the "domain" and "nameservers" attributes in the xCAT network definitions. The "namesevers" attribute would be set to "&lt;xcatmaster&gt;".

 The result would be that each node would get a resolv.conf file that contained the "domain" from the network definition.

Note: The correct network definition is determined by calculating which network the IP address of the node is part of.

 The "nameservers" value would be the name of the nodes server as known by the node. (The server interface that is on the same network.)

 This is the setup used in Power 775 clusters.

5) Network oriented resolv.conf files.

 In this case you would set the "domain" and "nameservers" attributes in the xCAT network definitions. The "namesevers" attribute would be set to one or more comma-separated server names (IP addresses).

 The result would be that each node would get a resolv.conf file that contained the "domain" and "namservers" value from the network definition.from the network definition.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.