25.9.4 Logical host creation

Once the shared disk and network have been set up, create a logical host. The following configuration is assumed here:

Configuration of logical host to be created:
  • Logical host name: sc-lnode0 (IP address is 172.16.170.100)
  • Default master node: sc-node0
  • Default network interface: qfe1 (qfe1 and qfe2 have been set up in the NAFO group)
  • Disk group: dg0
  • File system name: /shdsk/node0
Organization of this subsection
(1) Registering the host name of the logical host
(2) Creating a logical host
(3) Creating the logical host's management file system
(4) Confirming logical host startup

(1) Registering the host name of the logical host

When a DNS server is not used, register the host name of the logical host in the hosts file. This must be set up in both nodes in the cluster.

172.16.170.100  sc-lnode0               # Sun Cluster  logical host 0

(2) Creating a logical host

After confirming that the cluster has been started, create a logical host. This is performed in one node within the cluster.

[sc-node0] # hastat                                     <-- Cluster status check
[sc-node0] # scconf sun_cluster  -L sc-lnode0   \       <-- Logical host name
>               -n  sc-node0, sc-node1          \       <-- Node
>               -g  dg0                         \       <-- Disk group
>               -i  qfe1, qfe1,  sc-lnode0      \       <-- Network
>               -m                                      <-- Automatic changeback disabled
/etc/opt/SUNWcluster/conf/sun_cluster.cdb
Checking node status...
[sc-node0] #

Explanation
-L: Specifies the logical host name.
-n: Specifies the nodes comprising the logical host (separated by commas).
The order in which these nodes are specified corresponds to their priority order. The host specified first becomes the master node. In Sun Cluster, when a high-priority node starts in a logical host without the -m specification, changeback occurs automatically.
-g: Specifies the disk group to be used by the logical host.
The shared disk specified here is imported and mounted automatically when the logical host starts.
/etc/opt/SUNWcluster/conf/hanfs/vfstab.logical-host-name must be set up.
-i: Specifies the network interfaces to be used by the logical host.
Specify network interfaces for the nodes specified in -n in the order specified, and specify the host name of the logical host at the end. If a NAFO group is set up, specify the primary interface.
-m: Specifies that automatic changeback is to be disabled.
If -m is not specified, changeback occurs automatically when a higher-priority node, as specified in -n, starts.

(3) Creating the logical host's management file system

Use scconf -F to create a management file system for storing the configuration information of the logical host. A management file system must be created for all nodes that use the logical host.

[sc-node0] # scconf sun_cluster -F sc-lnode0
/etc/opt/SUNWcluster/conf/sun_cluster.cdb
Checking node status...
[sc-node0] #

When scconf -F terminates normally, the logical host starts in the master node (the first node specified in -n), and the shared disk and logical IP addresses are allocated.

Use vxprint to confirm that a management file system has been created. The logical volume indicated by disk-group-name-stat is the management file system.

[sc-node0] # vxprint

Disk group: dg0

Y NAME          ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg dg0          dg0          -        -        -        -        -       -
dm dg001        c2t0d0s2     -        17678493​ -        -        -       -
v  dg0-stat     fsgen        ENABLED  4096     -        ACTIVE   -       -
pl dg0-stat-01  dg0-stat     ENABLED  7182     -        ACTIVE   -       -
sd dg001-01     dg0-stat-01  ENABLED  7182     0        -        -       -

(4) Confirming logical host startup

The steps taken so far should enable the logical host to start. Start the logical host at each node and confirm its operation.

[sc-node0] # haswitch  -m sc-lnode0                <-- Stops once.
[sc-node0] # haswitch  sc-node0  sc-lnode0         <-- Starts the logical host.
[sc-node0] # netstat -in                           <-- Verifies logical IP address.
Name   Mtu  Net/Dest      Address        Ipkts  Ierrs Opkts  Oerrs Collis Queue
Qfe1:1 1500 172.16.170.0  172.16.170.100 0      0     0      0     0      0

Check these items at all nodes.

[sc-node1] # haswitch  sc-node1  sc-lnode0         <-- Starts the logical host.
[sc-node1] # netstat -in                           <-- Verifies logical IP address.

If the shared disk and logical IP addresses have been assigned correctly, the logical host has been constructed normally.