Chapter 4. Adding Samba to the Cluster Database

This chapter discusses the following:


Note: This chapter assumes that you are already familiar with the concepts of resource types. If not, see IRIS FailSafe Version 2 Administrator's Guide.


Installing the Samba Resource Type

If you have the FailSafe Samba software installed before you create a FailSafe cluster, the Samba resource type will be automatically installed at cluster creation time. However, if you already have a cluster before installing the FailSafe Samba software, you must manually install the resource type.

To determine if the resource type has been installed, enter the following cmgr(1M) command:

show resource_types in cluster clustername

For example, the following output shows that the Samba resource type is not present:

cmgr> show resource_types in cluster eagan
NFS
template
Netscape_web
statd
statd_unlimited
Oracle_DB
MAC_address
IP_address
INFORMIX_DB
filesystem
volume

You can also display this information with the FailSafe GUI.

To install the Samba resource type, use the following command:

install resource_type Samba in cluster clustername

For example:

cmgr> install resource_type Samba in cluster eagan

Creating a Samba Resource

After you have installed the resource type, you must define the individual Samba resources based on the resource type. Each Samba resource requires a unique resource name (the NetBIOS name). Then you must supply the resource parameters. To create the resource, either use the cmgr(1M) command, the cmgr-create-resource-Samba scripts, or the FailSafe GUI.

Resource Requirements

Table 4-1 lists the configuration parameters that must be defined within the FailSafe Samba resource definition.

Table 4-1. Samba Configuration Parameters

Category

Parameter

Description

Resource name

resource-name

Specifies the name of the Samba resource; this must be the NetBIOS name used to access the server.

Resource attribute

monitor-level

 

 

Defines the monitoring action performed by the monitor action script:

  • Level 1 checks for the existence of the smbd and nmbd processes.

  • Level 2 checks for the correct responses from smbd and nmbd.

  • Level 3 checks for the existence of nmbd and for the correct responses from smbd.

Resource dependency

filesystem

Specifies the name of the highly available filesystem that this particular Samba resource will use. The value specified for filesystem is the location where FailSafe Samba will create directories to contain the Samba smb.conf configuration file, log files, and various database files. Any directories that Samba will be making available as highly available shares should also be contained on this filesystem. No checks are made to ensure that the paths exported in the smb.conf file actually exist on this filesystem.

Resource dependency

IP_address

Specifies the highly available IP (HA-IP) address to which the NetBIOS name belongs.


Interactive cmgr Example

The following shows an interactive example of using cmgr to define a Samba resource named server1:

[email protected]:~ # /usr/cluster/bin/cmgr
Welcome to IRIS FailSafe Cluster Manager Command-Line Interface

cmgr> define resource server1 of resource_type Samba in cluster interop-ha
Enter commands, when finished enter either "done" or "cancel"

Type specific attributes to create with set command:

Type Specific Attributes - 1: monitor-level

Resource type dependencies to add:

Resource Dependency Type - 1: IP_address
Resource Dependency Type - 2: filesystem

resource /server1 ? set monitor-level to 2
resource /server1 ? add dependency /fs1 of type filesystem
resource /server1 ? add dependency 163.154.48.34 of type IP_address
resource /server1 ? done
Successfully modified resource server1

cmgr> show resource server1 of resource_type Samba

monitor-level: 2

Resource dependencies
IP_address 163.154.48.34
filesystem /fs1

cmgr> exit

Script to Create a Resource

Create the FailSafe Samba resource. The following cmgr script creates a Samba resource:

define resource NetBIOS_name of resource_type Samba in cluster cluster_name
     set monitor-level to 1|2|3
     add dependency IP_address_resource_name of type IP_address
     add dependency filesystem_resource_name of type filesystem
done

Creating a Samba Resource Group

To create an effective resource group, you must include all of the resources that the Samba resource is dependent on, such as filesystems, volumes, and IP addresses. The following example shows the creation of a typical resource group:

[email protected]:~ # /usr/cluster/bin/cmgr
Welcome to IRIS FailSafe Cluster Manager Command-Line Interface

cmgr> define resource_group hans1 in cluster interop-ha
Enter commands, when finished enter either "done" or "cancel"

resource_group hans1 ? set failover_policy to hans1-primary
resource_group hans1 ? add resource 163.154.48.34 of resource_type IP_address
resource_group hans1 ? add resource /fs1 of resource_type filesystem
resource_group hans1 ? add resource vol1 of resource_type volume
resource_group hans1 ? add resource server1 of resource_type Samba
resource_group hans1 ? done
Successfully defined resource group hans1

cmgr> show resource_group hans1 in cluster interop-ha

Resource Group: hans1
        Cluster: interop-ha
        Failover Policy: hans1-primary

Resources: 
        server1 (type: Samba)
        163.154.48.34 (type: IP_address)
        /fs1 (type: filesystem)
        vol1 (type: volume)

cmgr> exit