Sun Cluster 3.1 Data Service for Samba Guide

Installing and Configuring Sun Cluster HA for Samba

Installing and Configuring Sun Cluster HA for Samba

Table 1–1 lists the tasks for installing and configuring Sun Cluster HA for Samba. Perform these tasks in the order that they are listed.

Table 1–1 Task Map: Installing and Configuring Sun Cluster HA for Samba

Task 

For Instructions, Go To 

Plan the installation 

Sun Cluster HA for Samba Overview

Planning the Sun Cluster HA for Samba Installation and Configuration

Install and configure Samba 

How to Install and Configure Samba

Verify installation and configuration 

How to Verify the Installation and Configuration of Samba

Install Sun Cluster HA for Samba Packages 

How to Install the Sun Cluster HA for Samba Packages by using the scinstall Utility

Register and Configure Sun Cluster HA for Samba 

How to Register and Configure Sun Cluster HA for Samba as a Failover Service

Verify Sun Cluster HA for Samba Installation and Configuration 

How to Verify the Sun Cluster HA for Samba Installation and Configuration

Understand Sun Cluster HA for Samba fault monitor 

Understanding the Sun Cluster HA for Samba Fault Monitor

Debug Sun Cluster HA for Samba 

How to Register and Configure Sun Cluster HA for Samba as a Failover Service with Winbind as a Scalable Service

Sun Cluster HA for Samba Overview

Samba is an Open Source/Freeware suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available under the GNU General Public License and can be downloaded from http://www.samba.org. Additionally, Samba is now packaged with Solaris 9 as the SUNWsmbac, SUNWsmbar, SUNWsmbau and SUNWsfman packages.

The Sun Cluster HA for Samba data service provides a mechanism for orderly startup and shutdown, fault monitoring and automatic failover of the Samba service. The following Samba components are protected by the Sun Cluster HA for Samba data service.

Table 1–2 Protection of Components

Component 

Protected by 

SMB/CIFS 

Sun Cluster HA for Samba (Samba component) 

NetBIOS Name Server 

Sun Cluster HA for Samba (Samba component) 

Winbind 

Sun Cluster HA for Samba (Winbind component — Solaris 8 or Solaris 9 with patch 113476–05 or later.) 

Planning the Sun Cluster HA for Samba Installation and Configuration

This section contains the information you need to plan your Sun Cluster HA for Samba installation and configuration.

Configuration Restrictions


Caution – Caution –

Your data service configuration might not be supported if you do not observe these restrictions.


Consider the restrictions in this section to plan the installation and configuration of Sun Cluster HA for Samba. This section provides a list of software and hardware configuration restrictions that apply to Sun Cluster HA for Samba only.

For restrictions that apply to all data services, see the Sun Cluster Release Notes.

Configuration Requirements


Caution – Caution –

Your data service configuration might not be supported if you do not adhere to these requirements.


Use the requirements in this section to plan the installation and configuration of Sun Cluster HA for Samba. These requirements apply to Sun Cluster HA for Samba only. You must meet these requirements before you proceed with your Sun Cluster HA for Samba installation and configuration.


Note –

If additional smb.conf entries are made and those entries require a path variable, then you must ensure that any subsequent pathname is created within the relevant Samba or Winbind instance configuration directory.


Installing and Configuring Samba

This section contains the procedures you need to install and configure Samba.

Throughout the following next sections, references will be made to certain directories for Samba or Winbind. The following list shows common pathnames for these references as shown in previous examples. Refer to Configuration Restrictions where these examples are shown.

How to Install and Configure Samba

Use this procedure to install and configure Samba.

  1. Determine how Samba will be deployed in Sun Cluster – Here you need to determine how Samba will be deployed.

    • Determine how many Samba instances will be deployed.

    • Determine if Winbind will be deployed.

    • Determine which Cluster File System will be used by each Samba instance and Winbind Instance, if deployed.

  2. Mount the Samba Cluster File Systems – Once you have determined how Samba and Winbind will be deployed within Sun Cluster, you must ensure the Cluster File Systems are mounted.


    Note –

    If Failover File Systems will be used by the Samba instance, you must mount these manually.


  3. Install Samba onto all nodes within Sun Cluster – It is recommended that Samba be installed onto a Global File System, however for a discussion of the advantages and disadvantages of installing the software on local versus cluster files systems, see “Determining the Location of the Application Binaries” of the Sun Cluster Data Services Installation and Configuration Guide.

    • Download Samba from http://www.samba.org — Ensure that /usr/local/samba is a Cluster File System or has a symbolic link to a Cluster File System. However, if you intend to use local disks for the Samba software, you will need to repeat this step on all nodes within Sun Cluster.


      Example 1–4 Samba installation from http://www.samba.org

      The following example shows the Samba installation with winbind after it has been download, unzipped and extracted.


      # cd <samba_install_directory>/source
      #
      # ./configure --with-winbind --with-pam
      #
      # make
      #
      # make install
      

    • Alternatively, install Samba from the Solaris 9 CD — The following packages must be installed onto all nodes within Sun Cluster that will run the Samba service.

      • SUNWsmbac

      • SUNWsmbar

      • SUNWsmbau

      • SUNWsfman

  4. Create an entry for the fault monitor user

    • If winbind is not being used

      Create an entry in /etc/group on all nodes with Sun Cluster.


      # groupadd -g 1000 <fmgroup>
      

      Create an entry in /etc/passwd on all nodes within Sun Cluster. This user should have a locked password, no shell and no home directory.


      # useradd -u 1000 -g 1000 -s /bin/false <fmuser>
      
    • If winbind is being used

      Create the fault monitor user on the NT PDC with no home directory, no user profiles and no logon script. Also set the Password never expire parameter to true and User cannot change password parameter to true.

  5. Create some required directories for your Samba Instance(s) – If you are deploying multiple instances of Samba, you will need to repeat this step for each Samba instance, ie each samba-configuration-directory. Furthermore a directory for any shares should be created, although this directory name can be a name of your choice.


    # cd <samba-configuration-directory>
    #
    # mkdir -p lib logs private shares var/locks
    

    Note –

    Refer back to Configuration Restrictions for a description of the <samba-configuration-directory> and to Installing and Configuring Samba for a list of common pathnames used from the examples in Configuration Restrictions and in the further example below.



    Example 1–5 Directories for Samba instances named SAMBA1 and SAMBA2

    The following example shows two Samba instances named SAMBA1 and SAMBA2. Samba has been installed from http://www.samba.org and /usr/local/samba has been symbolically linked to /global/samba which is mounted as a Global File System. The samba-configuration-directory for SAMBA 1 is /global/samba/SAMBA1 and the samba-configuration-directory for SAMBA2 is /global/samba/SAMBA2.


    # ls -l /usr/local/samba
    lrwxrwxrwx   1 root     other         13 Oct 11 11:20 /usr/local/samba ->
     /global/samba
    #
    # cd /global/samba
    #
    # ls -l
    total 18
    drwxr-xr-x   2 root     other        512 Oct 11 15:00 bin
    drwxr-xr-x   3 root     other        512 Oct 14 13:49 lib
    drwxr-xr-x   6 root     other        512 Oct 11 15:00 man
    drwxr-xr-x   2 root     other        512 Oct 14 10:05 private
    drwxr-xr-x   7 root     other        512 Oct 14 13:39 SAMBA1
    drwxr-xr-x   7 root     other        512 Oct 14 13:40 SAMBA2
    drwxr-xr-x   6 root     other        512 Oct 11 15:01 swat
    drwxr-xr-x   3 root     other        512 Oct 14 10:45 var
    drwxr-xr-x   2 root     other        512 Jan 17 09:28 winbind
    #
    # cd SAMBA1
    # 
    # mkdir -p lib logs private shares var/locks
    #
    # cd ../SAMBA2
    # 
    # mkdir -p lib logs private shares var/locks
    

  6. Create the Samba smb.conf file according to your requirements — The Sun Cluster HA for Samba data service provides a sample smb.conf file for Samba.


    Note –

    If the Sun Cluster HA for Samba package (SUNWscsmb) was not installed during your initial Sun Cluster installation, you should proceed to Installing the Sun Cluster HA for Samba Packages to install it. Afterwards, return back here to continue the Installation and Configuration of Samba.


    The contents of /opt/SUNWscsmb/samba/etc/smb.conf_sample provides a sample Samba configuration file that you can use to create your Samba instance <samba-configuration-directory>/lib/smb.conf. However, note that you must still edit that file to reflect your configuration values.


    # cp /opt/SUNWscsmb/samba/etc/smb.conf_sample  \
     <samba-configuration-directory>/lib/smb.conf 
    

    If the Winbind component is being installed, then after smb.conf_sample has been copied, you will need to add the following entries into the global section of <samba-configuration-directory>/lib/smb.conf. Be aware that these values shown below are the default values taken from the smb.conf[5] man page.


    winbind uid = 10000-20000
    winbind gid = 10000-20000
    winbind enum users = yes
    winbind enum groups = yes 
    

    Note –

    pid directory must point to <samba-configuration-directory>/var/locks, as specified within smb.conf_sample.


  7. Test the Samba smb.conf file — Once the Samba smb.conf file has been created you should test the configuration before proceeding.


    # <samba-bin-directory>/testparm  \
    <samba-configuration-directory>/lib/smb.conf 
    
  8. If configured as an NT Domain Member, join the domain


    # <samba-bin-directory>/smbpasswd  \
     -c <samba-configuration-directory>/lib/smb.conf \
     -j <DOMAIN> -r <PDC >\
     -U <Administrator on the PDC>
    

    If successful, you will receive the following message.


    # smbpasswd: Joined domain <DOMAIN>
    
  9. If configured as an NT PDC or with security = user, add the fault monitor user


    # <samba-bin-directory>/smbpasswd  \
     -c <samba-configuration-directory>/lib/smb.conf \
     -a <fmuser>
    

    Note –

    With Samba v2.2.2, currently packaged with Solaris 9, the smbpasswd program will not recognize the -c parameter and subsequently will try to look for the smb.conf file in /etc/sfw. To workaround this, create a symbolic link from /etc/sfw/smb.conf to <samba-configuration-directory>/lib/smb.conf. If multiple Samba instances are being deployed, you will need to delete the symbolic link and repeat the process for each Samba instance.

    If patch 114684–01 or later is installed then smbpasswd will reconize the -c parameter.


  10. Create some required directories for your Winbind Instance – The remaining steps are only required if the Winbind component will be used. Otherwise you can skip the remaining steps and proceed to Verifying the Installation and Configuration of Samba.

    If you are deploying Winbind, you will need to create the following directories and symbolic link within the winbind-configuration-directory.


    # cd <winbind-configuration-directory>
    #
    # mkdir -p lib locks private var
    # mkdir -p /var/winbind/pid 
    # ln -s /var/winbind/pid var/locks
    

    Note –

    Refer back to Configuration Restrictions for a description of the <winbind-configuration-directory> and to Installing and Configuring Samba for a list of common pathnames used from the examples in Configuration Restrictions and in the further example below.



    Example 1–6 Directories for Winbind instance named winbind

    The following example shows the Winbind instance. Samba has been installed from http://www.samba.org and /usr/local/samba has been symbolically linked to /global/samba which is mounted as a Global File System. The winbind-configuration-directory for Winbind is /global/samba/winbind.


    # ls -l /usr/local/samba
    lrwxrwxrwx   1 root     other         13 Oct 11 11:20 /usr/local/samba ->
     /global/samba
    #
    # cd /global/samba
    #
    # ls -l
    total 18
    drwxr-xr-x   2 root     other        512 Oct 11 15:00 bin
    drwxr-xr-x   3 root     other        512 Oct 14 13:49 lib
    drwxr-xr-x   6 root     other        512 Oct 11 15:00 man
    drwxr-xr-x   2 root     other        512 Oct 14 10:05 private
    drwxr-xr-x   7 root     other        512 Oct 14 13:39 SAMBA1
    drwxr-xr-x   7 root     other        512 Oct 14 13:40 SAMBA2
    drwxr-xr-x   6 root     other        512 Oct 11 15:01 swat
    drwxr-xr-x   3 root     other        512 Oct 14 10:45 var
    drwxr-xr-x   2 root     other        512 Jan 17 09:28 winbind
    #
    # cd winbind
    # 
    # mkdir -p lib locks private var
    # mkdir -p /var/winbind/pid 
    # ln -s /var/winbind/pid var/locks
    

  11. Create the Winbind smb.conf file according to your requirements (if required) — The Sun Cluster HA for Samba data service provides a sample smb.conf file for Winbind.


    Note –

    If the Sun Cluster HA for Samba package (SUNWscsmb) was not installed during your initial Sun Cluster installation, you should proceed to Installing the Sun Cluster HA for Samba Packages to install it. Afterwards, return back here to continue the Installation and Configuration of Samba.


    The contents of /opt/SUNWscsmb/winbind/etc/smb.conf_sample provides a sample Winbind configuration file that you can use to create your Winbind instance <winbind-configuration-directory>/lib/smb.conf. However, note that you must still edit that file to reflect your configuration values. In addition the following entry needs to be added to the [global] section within the smb.conf file.


    # cp /opt/SUNWscsmb/winbind/etc/smb.conf_sample  \
     <winbind-configuration-directory>/lib/smb.conf 
    

    After smb.conf_sample has been copied, you will need to add the following entries into the [global] section of <winbind-configuration-directory>/lib/smb.conf.


    smb passwd file = <winbind-configuration-directory>/private
    lock directory = <winbind-configuration-directory>/locks
    pid directory = <winbind-configuration-directory>/var/locks
    

    Note –

    If the Winbind component will operate as a scalable service then the Winbind configuration directory must be mounted as a Global File System. See the winbindd(8) man page for a discussion on Name and ID Resolution being stored in a database under the lock directory.

    pid directory must point to configuration directory /var/locks. In addition, ensure that configuration directory /var/locks is a symbolic link to a local file system ie /var/winbind/pid.


  12. Add winbind as a name service — Add winbind as a name service to /etc/nsswitch.conf for passwd and group , on all nodes that will run the Sun Cluster HA for Samba data service.


    # grep winbind /etc/nsswitch.conf 
    passwd:     files winbind
    group:      files winbind
  13. Copy and create some symbolic links — Some files and symbolic links need to be setup for winbind on all nodes that will run the Sun Cluster HA for Samba data service.


    # cd <samba-install-directory>
    #
    # cp source/nsswitch/libnss_winbind.so /usr/lib 
    #
    # ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1 
    #
    # ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1 
    
  14. On one node start winbind


    Note –

    Depending on how Samba was installed, the winbind program maybe located within the <samba-bin-directory> or <samba-sbin-directory>



     # <samba-[s]bin-directory>/winbindd -s <winbind-configuration-directory>/lib/smb.conf
    
  15. Populate the winbind database


    # getent passwd
    # getent group
    
  16. Shutdown winbindd


    # pkill -TERM winbindd
    

Verifying the Installation and Configuration of Samba

This section contains the procedure you need to verify the installation and configuration.

How to Verify the Installation and Configuration of Samba

Use this procedure to verify the installation and configuration. This procedure does not verify that your application is highly available because you have not yet installed your data service.


Note –

Before verifying the Installation and Configuration of Samba, ensure that the Logical Hostname for the Samba is available. To do this you will need to complete steps 4, 6 and 7 in How to Register and Configure Sun Cluster HA for Samba as a Failover Service.


  1. Test the smb.conf file

    1. Test the Samba smb.conf file


      # <samba-bin-directory>/testparm  \
      <samba-configuration-directory>/lib/smb.conf 
      
    2. Test the Winbind smb.conf file (if required)


      # <samba-bin-directory>/testparm  \
      <winbind-configuration-directory>/lib/smb.conf
      
  2. If configured as an NT Domain Member, join the domain


    # <samba-bin-directory>/smbpasswd  \
     -c <samba-config-directory>/lib/smb.conf  \
     -j <DOMAIN> -r <PDC > \
     -U <Administrator on the PDC>
    

    If successful, you will receive the following message.


    # smbpasswd: Joined domain <DOMAIN>
    
  3. Start the Samba daemons


    Note –

    Depending on how Samba was installed, the smbd and nmbd programs maybe located within the <samba-bin-directory> or <samba-sbin-directory>



    # <samba-[s]bin-directory>/smbd -s <samba-config-directory>/lib/smb.conf -D
    # <samba-[s]bin-directory>/nmbd -s <samba-config-directory>/lib/smb.conf -D
    
  4. Connect to Samba


    # <samba-bin-directory>/smbclient -N -L <NetBIOS-name>
    # <samba-bin-directory>/smbclient '\\<NetBIOS-name>\scmondir'  \
     -U <fmuser> -c 'pwd;exit' 
    

    Note –

    Be aware that the single quotes are required on the last command.


  5. Start the Winbind daemon (if required)


    Note –

    Depending on how Samba was installed, the winbind program maybe located within the <samba-bin-directory> or <samba-sbin-directory>



    # <samba-[s]bin-directory>/winbindd -s <winbind-configuration-directory>/lib/smb.conf  &
    
  6. Connect to Winbind (if required)


    # getent passwd
    # getent group
    
  7. Stop the Samba daemons and winbindd (if required)


    # pkill -TERM smbd
    # pkill -TERM nmbd
    # pkill -TERM winbindd
    

Installing the Sun Cluster HA for Samba Packages

If you did not install the Cun Cluster HA for Samba packages during your initial Sun Cluster installation, perform this procedure to install the packages. Perform this procedure on each cluster node where you are installing the Cun Cluster HA for Samba packages. To complete this procedure, you need the Sun Cluster Agents CD-ROM.

If you are installing more than one data service simultaneously, perform the procedure in “Installing the Software” in Sun Cluster 3.1 10/03 Software Installation Guide.

Install the Cun Cluster HA for Samba packages by using one of the following installation tools:


Note –

The Web Start program is not available in releases earlier than Sun Cluster 3.1 Data Services 10/03.


How to Install the Cun Cluster HA for Samba Packages by Using the Web Start Program

You can run the Web Start program with a command-line interface (CLI) or with a graphical user interface (GUI). The content and sequence of instructions in the CLI and the GUI are similar. For more information about the Web Start program, see the installer(1M) man page.

  1. On the cluster node where you are installing the Cun Cluster HA for Samba packages, become superuser.

  2. (Optional) If you intend to run the Web Start program with a GUI, ensure that your DISPLAY environment variable is set.

  3. Load the Sun Cluster Agents CD-ROM into the CD-ROM drive.

    If the Volume Management daemon vold(1M) is running and configured to manage CD-ROM devices, it automatically mounts the CD-ROM on the /cdrom/scdataservices_3_1_vb directory.

  4. Change to the Cun Cluster HA for Samba component directory of the CD-ROM.

    The Web Start program for the Cun Cluster HA for Samba data service resides in this directory.


    # cd /cdrom/scdataservices_3_1_vb/components/SunCluster_HA_Samba_3.1
    
  5. Start the Web Start program.


    # ./installer
    
  6. When you are prompted, select the type of installation.

    • To install only the C locale, select Typical.

    • To install other locales, select Custom.

  7. Follow instructions on the screen to install the Cun Cluster HA for Samba packages on the node.

    After the installation is finished, the Web Start program provides an installation summary. This summary enables you to view logs that the Web Start program created during the installation. These logs are located in the /var/sadm/install/logs directory.

  8. Exit the Web Start program.

  9. Unload the Sun Cluster Agents CD-ROM from the CD-ROM drive.

    1. To ensure that the CD-ROM is not being used, change to a directory that does not reside on the CD-ROM.

    2. Eject the CD-ROM.


      # eject cdrom
      

How to Install the Sun Cluster HA for Samba Packages by using the scinstall Utility

Use this procedure to install the Sun Cluster HA for Samba packages by using the scinstall utility. You need the Sun Cluster Agents CD-ROM to perform this procedure. This procedure assumes that you did not install the data service packages during your initial Sun Cluster installation.

If you installed the Sun Cluster HA for Samba packages as part of your initial Sun Cluster installation, proceed to Registering and Configuring Sun Cluster HA for Samba.

Otherwise, use this procedure to install the Sun Cluster HA for Samba packages. Perform this procedure on all nodes that can run Sun Cluster HA for Samba data service.

  1. Load the Sun Cluster Agents CD-ROM into the CD-ROM drive.

  2. Run the scinstall utility with no options.

    This step starts the scinstall utility in interactive mode.

  3. Choose the menu option, Add Support for New Data Service to This Cluster Node.

    The scinstall utility prompts you for additional information.

  4. Provide the path to the Sun Cluster Agents CD-ROM.

    The utility refers to the CD as the “data services cd.”

  5. Specify the data service to install.

    The scinstall utility lists the data service that you selected and asks you to confirm your choice.

  6. Exit the scinstall utility.

  7. Unload the CD from the drive.

Registering and Configuring Sun Cluster HA for Samba

This section contains the procedures you need to configure Sun Cluster HA for Samba.

How to Register and Configure Sun Cluster HA for Samba as a Failover Service

Use this procedure to configure Sun Cluster HA for Samba as a failover data service. This procedure assumes that you installed the data service packages during your initial Sun Cluster installation.

If you did not install the Sun Cluster HA for Samba packages as part of your initial Sun Cluster installation, go to How to Install the Sun Cluster HA for Samba Packages by using the scinstall Utility.

Otherwise, use this procedure to configure the Sun Cluster HA for Samba data service as a failover service.

  1. Become superuser on one of the nodes in the cluster that will host Samba.

  2. Register the SUNW.gds resource type.


    # scrgadm -a -t SUNW.gds
    
  3. Register the SUNW.HAStoragePlus resource type.


    # scrgadm -a -t SUNW.HAStoragePlus
    
  4. Create a failover resource group .


    # scrgadm -a -g Samba-failover-resource-group
    
  5. Create a resource for the Samba Disk Storage.


    # scrgadm -a -j Samba-has-resource  \
    -g Samba-failover-resource-group   \
    -t SUNW.HAStoragePlus  \
    -x FilesystemMountPoints=Samba- instance-mount-points
    
  6. Create a resource for the Samba Logical Hostname.


    # scrgadm -a -L -j Samba-lh-resource  \
    -g Samba-failover-resource-group  \
    -l Samba-logical-hostname
    
  7. Enable the failover resource group that now includes the Samba Disk Storage and Logical Hostname resources.


    # scswitch -Z -g Samba-failover-resource-group
    
  8. Create and register Winbind as a failover data service (if required)


    # cd /opt/SUNWscsmb/winbind/util
    

    Edit the winbind_config file and follow the comments within that file, ie


    # These parameters can be customized in (key=value) form
    #
    #        RS - name of the resource for the application
    #        RG - name of the resource group containing RS
    #    WB_BIN - name of the Winbind bin directory
    #   WB_INST - name of the Winbind configuration directory
    #    NTUSER - name of the NT fault monitor user
    #        LH - name of the LogicalHostname SC resource
    #    HAS_RS - name of the Winbind HAStoragePlus SC resource

    Note –

    The following is an example for a Winbind instance with Samba installed from http://www.samba.org.



    RS=wb-res
    RG=smb-failover-rg
    WB_BIN=/global/samba/bin
    WB_INST=/global/samba/winbind
    NTUSER=samba
    LH=smb-lh-res
    HAS_RS=wb-has-res
    

    After editing winbind_config you must now register the resource.


    # ./winbind_register
    
  9. Enable the Winbind resource (if previous step was done)


    # scstat 
    # scswitch -e -j Winbind-resource
    
  10. Create and register Samba as a failover data service


    # cd /opt/SUNWscsmb/samba/util
    

    Edit the samba_config file and follow the comments within that file, i.e.


    # These parameters can be customized in (key=value) form
    #
    #        RS - name of the resource for the application
    #        RG - name of the resource group containing RS
    #   SMB_BIN - name of the Samba bin directory
    #  SMB_SBIN - name of the Samba sbin directory
    #              (If no sbin then specify the bin directory)
    #  SMB_INST - name of the Samba configuration directory
    #   SMB_LOG - name of the Samba log directory
    #               for log.smbd and log.nmbd
    #              (If not specified will default
    #               to $SMB_INST/logs)
    #    FMUSER - name of the Samba fault monitor user
    #    FMPASS - name of the Samba fault monitor user password
    #        LH - name of the LogicalHostname SC resource
    #    HAS_RS - name of the Samba HAStoragePlus SC resource, plus the
    #              name of the Winbind resource if Winbind is configured
    #              as a failover service

    The following is an example for Samba instance SAMBA1 with Samba installed from http://www.samba.org


    RS=smb-res
    RG=smb-failover-rg
    SMB_BIN=/global/samba/bin
    SMB_SBIN=/global/samba/sbin or /global/samba/bin
    SMB_INST=/global/samba/SAMBA1
    SMB_LOG=/global/samba/SAMBA1/logs
    FMUSER=samba
    FMPASS=samba
    LH=smb-lh-res
    HAS_RS=smb-has-res or 
    HAS_RS=smb-has-res,wb-res if failover winbind is being used

    The following is an example for Samba instance SMB1 with Samba installed from Solaris 9


    RS=smb-res
    RG=smb-failover-rg
    SMB_BIN=/usr/sfw/bin
    SMB_SBIN=/usr/sfw/sbin
    SMB_INST=/local/samba/SMB1
    SMB_LOG=/local/samba/SMB1/logs
    FMUSER=samba
    FMPASS=samba
    LH=smb-lh-res
    HAS_RS=smb-has-res
    

    After editing samba_config you must now register the resource.


    # ./samba_register
    
  11. Enable each Samba resource.

    Repeat this step for each Samba instance, if multiple instances were created.


    # scstat 
    # scswitch -e -j Samba-resource
    

How to Register and Configure Sun Cluster HA for Samba as a Failover Service with Winbind as a Scalable Service

Use this procedure to configure Sun Cluster HA for Samba as a failover data service with Winbind as a Scalable Service. This procedure assumes that you installed the data service packages during your initial Sun Cluster installation.

If you did not install the Sun Cluster HA for Samba packages as part of your initial Sun Cluster installation, go to How to Install the Sun Cluster HA for Samba Packages by using the scinstall Utility.

Otherwise, use this procedure to configure the Sun Cluster HA for Samba data service as a failover service.

  1. Become superuser on one of the nodes in the cluster that will host Samba.

  2. Register the SUNW.gds resource type.


    # scrgadm -a -t SUNW.gds
    
  3. Register the SUNW.HAStoragePlus resource type.


    # scrgadm -a -t SUNW.HAStoragePlus
    
  4. Create a failover resource group for the shared network address.


    # scrgadm -a -g Winbind-failover-resource-group
    
  5. Create a resource for the Winbind Logical Hostname.


    # scrgadm -a -S -j Winbind-lh-resource  \
    -g Winbind-failover-resource-group  \
    -l Winbind-logical-hostname
    
  6. Create a scalable resource group for the scalable winbind resource.


    # scrgadm -a -g Winbind-scalable-resource-group \
    -y Maximum_primaries=<number of nodes with Sun Cluster> \
    -y Desired_primaries=<number of nodes with Sun Cluster> \
    -y RG_dependencies=Winbind-failover-resource-group
    
  7. Create a resource for the Winbind Disk Storage.


    # scrgadm -a -j Winbind-has-resource  \
    -g Winbind-scalable-resource-group   \
    -t SUNW.HAStoragePlus  \
    -x FilesystemMountPoints=Winbind-instance-mount-point \
    -x AffinityOn=FALSE
    
  8. Enable the failover and scalable resource group that now includes the Winbind Disk Storage and Logical Hostname resources.


    # scswitch -Z -g Winbind-failover-resource-group
    # scswitch -Z -g Winbind-scalable-resource-group
    
  9. Create and register Samba as a failover data service

    Follow Steps 4, 5, 6, 7, 10 and 11 in How to Register and Configure Sun Cluster HA for Samba as a Failover Service to create a failover Samba service. Afterwards you will need to complete this last step to ensure that the Failover Samba Resource Group is start dependent on the Scalable Winbind Resource Group.


    # scrgadm -c -g Samba-failover-resource-group \
    -y RG_dependencies=Winbind-sclable-resource-group
    
  10. Create and register winbind as a scalable data service


    # cd /opt/SUNWscsmb/winbind/util
    

    Edit the winbind_config file and follow the comments within that file, i.e.


    # These parameters can be customized in (key=value) form
    #
    #        RS - name of the resource for the application
    #        RG - name of the resource group containing RS
    #    WB_BIN - name of the Winbind bin directory
    #   WB_INST - name of the Winbind configuration directory
    #    NTUSER - name of the NT fault monitor user
    #        LH - name of the LogicalHostname SC resource
    #    HAS_RS - name of the Winbind HAStoragePlus SC resource

    Note –

    The following is an example for a Winbind instance with Samba installed from http://www.samba.org.



    RS=wb-res
    RG=wb-scalable-rg
    WB_BIN=/global/samba/bin
    WB_INST=/global/samba/winbind
    NTUSER=samba
    LH=wmb-lh-res
    HAS_RS=wb-has-res
    

    After editing winbind_config you must now register the resource.


    # ./winbind_register
    
  11. Enable the Winbind resource.


    # scstat 
    # scswitch -e -j Winbind-resource
    

Verifying the Sun Cluster HA for Samba Installation and Configuration

This section contains the procedure you need to verify that you installed and configured your data service correctly.

How to Verify the Sun Cluster HA for Samba Installation and Configuration

Use this procedure to verify that you installed and configured Sun Cluster HA for Samba correctly.

  1. Become superuser on one of the nodes in the cluster that will host Samba.

  2. Ensure all the Samba resources are online with scstat.


    # scstat 
    

    For each Samba resource that is not online, use the scswitch command as follows.


    # scswitch -e -j Samba- resouce
    
  3. Run the scswitch command to switch the Samba resource group to another cluster node, such as node2.


    # scswitch -z -g Samba-failover-resource-group -h node2
    

Understanding the Sun Cluster HA for Samba Fault Monitor

Use the information in this section to understand the Sun Cluster HA for Samba fault monitor. This section describes the Sun Cluster HA for Samba fault monitor's probing algorithm or functionality, states the conditions, messages, and recovery actions associated with unsuccessful probing.

For conceptual information on fault monitors, see the Sun Cluster Concepts Guide.

Resource Properties

The Sun Cluster HA for Samba fault monitor uses the same resource properties as resource type SUNW.gds, refer to the SUNW.gds(5) man page for a complete list of resource properties used.

Probing Algorithm and Functionality

Debug Sun Cluster HA for Samba

How to turn debug on for Sun Cluster HA for Samba

Use the information in this section to understand how to turn on debug for Sun Cluster HA for Samba.

Sun Cluster HA for Samba can be used by multiple Samba instances. However, it is possible to turn debug on for all Samba instances or a particular Samba instance.

Each Samba component has a DEBUG file under /opt/SUNWscsmb/xxx/etc, where xxx is a three character abbreviation for the respective Samba component.

These files allow you to turn debug on for all Samba instances or for a specific Samba instance on a particular node with Sun Cluster. If you require debug to be turned on for Sun Cluster HA for Samba across the whole Sun Cluster, you will need to repeat this step on all nodes within Sun Cluster.

  1. Edit /etc/syslog.conf

    Edit /etc/syslog.conf and change daemon.notice to daemon.debug


    # grep daemon /etc/syslog.conf
    *.err;kern.debug;daemon.notice;mail.crit        /var/adm/messages
    *.alert;kern.err;daemon.err                     operator
    #

    Change the daemon.notice to daemon.debug and restart syslogd. Note that the output below, from the command grep daemon /etc/syslog.conf, shows that daemon.debug has now been set.


    # grep daemon /etc/syslog.conf
    *.err;kern.debug;daemon.debug;mail.crit        /var/adm/messages
    *.alert;kern.err;daemon.err                    operator
    #
    # pkill -1 syslogd
    #
  2. Edit /opt/SUNWscsmb/samba/etc/config

    Perform this step for the Samba component (smb), then repeat for the optional Winbind components that requires debug output, on each node of Sun Cluster as required.

    Edit /opt/SUNWscsmb/samba/etc/config and change DEBUG= to DEBUG=ALL or DEBUG=resource


    # cat /opt/SUNWscsmb/samba/etc/config
    #
    # Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
    # Use is subject to license terms.
    #
    # Usage:
    #       DEBUG=<RESOURCE_NAME> or ALL
    #
    DEBUG=ALL
    #

    Note –

    To turn off debug, simply reverse the steps above.