The nscd does not cache hosts for Sun Cluster

After installation of patch 120011-14 (Solaris 10 sparc) or the patch 120012-14 (Solaris 10 x86) the nscd does not cache hosts for Sun Cluster configuration. The Solaris 10 8/07 Update4 is also affected because the mentioned patches are bundled.


By default 'cluster' database is the first entry to hosts and netmasks in file /etc/nsswitch.conf. The _nscd_get_smf_state() does not recognise 'cluster' as a backend thus the cluster nss entry is not invoked by the nscd process and hence it is not cached by nscd. This issue is due to the new interface between the nss switch engine and backend layers which was introduced by the Sparks project.

Update 2.Mar 2009 - Start -
The issue is fixed in the following patches for sparc:
126106-27 Sun Cluster 3.2: CORE patch for Solaris 10 (included in Sun Cluster 3.2 1/09 update2)
138263-03 SunOS 5.10: nscd patch (Solaris 10 10/08 Update6 only include 138263-02)
or for x86:
126107-28 Sun Cluster 3.2: CORE patch for Solaris 10_x86 (included in Sun Cluster 3.2 1/09 update2)
138264-03 SunOS 5.10_x86: nscd patch (Solaris 10 10/08 Update6 only include 138264-02)
This means if you have the mentioned patches installed then 'cluster' database should be the first entry to hosts and netmasks in file /etc/nsswitch.conf.
Update 2.Mar 2009 - End -


Known issues which occur:
- slow name lookups
- Applications linked with '-library=stlport4' abort on gethostbyname

There is no general approach to identify the issue. But if you suspect a hostname resolution issue, turn on nscd debug mode
  % more /etc/nscd.conf
  [...]
       logfile         /var/adm/nscd.log    <---- uncomment
  #    enable-cache    hosts           no
       debug-level     9                    <---- set debug level here
  [...]

  Then stop and restart nscd.
  # svcadm restart svc:/system/name-service-cache:default


Workarounds:

A) Example of a default configuration for a 2-node Sun Cluster 3.x

Add private cluster interconnect addresses to hosts, netmasks and remove 'cluster' from nsswitch.conf on ALL nodes.
Add to /etc/hosts:
172.16.0.129   clusternode1-priv-physical1
172.16.1.1     clusternode1-priv-physical2
172.16.4.1     clusternode1-priv
172.16.0.130   clusternode2-priv-physical1
172.16.1.2     clusternode2-priv-physical2
172.16.4.2     clusternode2-priv
Add to /etc/netmasks:
172.16.0.128       255.255.255.128
172.16.1.0         255.255.255.128
172.16.4.0         255.255.254.0
Remove 'cluster' entry for hosts and netmasks in /etc/nsswitch.conf e.g:
hosts: files <any other hosts database>
netmasks: files <any other netmasks database>

For non-default installations or greater than 2-node configurations look to the next workaround. Or identify the values with the commands 'ifconfig' and 'scconf -pvv|grep -i private' on all nodes.


B) For all individual Sun Cluster configurations.


 1) Backup configuration files.
   # cp /etc/nsswitch.conf /etc/nsswitch.conf.cluster
   # cp /etc/inet/hosts /etc/inet/hosts.cluster
   # cp /etc/netmasks /etc/netmasks.cluster

 2) Add Private Cluster interconnect addresses to each cluster node's local /etc/hosts file.
  NOTE: Make sure the 'cluster' is still in nsswitch.conf for the hosts entry whilst performing the following.
   # getent hosts clusternode1-priv-physical1 >>/etc/hosts
   # getent hosts clusternode1-priv-physical2 >>/etc/hosts
   # getent hosts clusternode1-priv >>/etc/hosts
   # getent hosts clusternode2-priv-physical1 >>/etc/hosts
   # getent hosts clusternode2-priv-physical2 >>/etc/hosts
   # getent hosts clusternode2-priv >>/etc/hosts
   The above is an example for a default two node cluster with two private interconnects. If you have more nodes, more interconnects or non-default hostnames then identify them by using 'ifconfig' and 'scconf -pvv|grep -i private' on all nodes.

 3) Add private cluster interconnect netmasks to netmasks.
   Note that the netmasks file should contain the network number in the first column and the corresponding netmask in the second column.
   The following script will collect these from 'cluster' before you remove it in the next step:
   # ifconfig -a | nawk '/flags/&&!/PRIVATE/{p=0}/flags/&&/PRIVATE/{p=1} \\
   p==1&&$3 ~ /netmask/{d=0;h=tolower($4);j=length(h); \\
   for (i=1;i <= j; i++) {
     d=d\*16+index("123456789abcdef",substr(h,i,1));
     if (!(i%2)){n[(i/2)]=d;d=0}
   } al=split($2,a,".");bl=split($6,b,"."); \\
   for (i=1; i<5; i++) if(n[i] != 255) a[i]=b[i] - (255 - n[i]);
     printf("%d.%d.%d.%d\\t%d.%d.%d.%d\\n",
     a[1],a[2],a[3],a[4],n[1],n[2],n[3],n[4]);
   }' > /tmp/netmasks
   # cat /tmp/netmasks
   172.16.0.128      255.255.255.128
   172.16.1.0        255.255.255.128
   172.16.4.0        255.255.254.0
  Check the output for errors. Depending on the configuration maybe it's necessary to remove some entries.
   Append new entries to netmasks:
   # cat /tmp/netmasks >> /etc/netmasks

 4) Edit nsswitch.conf to remove 'cluster' entries.
  In the following example we see the hosts and netmask entries before, change the relevant lines with nawk, verify the changes and updated nsswitch.conf:
   # egrep -n '\^hosts|\^netmasks' /etc/nsswitch.conf
   hosts: cluster files dns nisplus
   netmasks: cluster files nisplus
   # nawk '/\^(hosts|netmasks)/&&/cluster/ \\
   {gsub(/cluster/, "")}{print}' /etc/nsswitch.conf > /tmp/nsswitch.conf
   # diff /etc/nsswitch.conf /tmp/nsswitch.conf
   28c28< hosts: cluster files dns nisplus
   ---> hosts: files dns nisplus
   42c42< netmasks: cluster files nisplus
   ---> netmasks: files nisplus
   # cat /tmp/nsswitch.conf > /etc/nsswitch.conf


There are 3 internal bugs with address this issue.
Bug 6632298: nscd doesn't cache hosts for cluster after sparks project (120011-14)
Bug 6634592: nss_cluster mods to match new nsswitch API in s10u4
Bug 6644077: nscd rejects - foreign nsswitch backend
A fix for Solaris 10 is expected by the end of this year.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

I'm still mostly blogging around Solaris Cluster and support. Independently if for Sun Microsystems or Oracle. :-)

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today