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 | |
Verify installation and configuration | |
Install Sun Cluster HA for Samba Packages | |
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 | |
Debug Sun Cluster HA for Samba |
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.) |
This section contains the information you need to plan your Sun Cluster HA for Samba installation and configuration.
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.
The Sun Cluster HA for Samba data service deployment – The Sun Cluster HA for Samba data service consists of two components, Samba and Winbind. These components have the following deployment restrictions.
Samba component — The Samba component, i.e. SMB/CIFS and NetBIOS Name Server, cannot operate as a scalable service and therefore the Sun Cluster HA for Samba data service for the Samba component can only be configured to run as a failover service.
Winbind component — The Winbind component can operate as either a failover or scalable service and therefore the Sun Cluster HA for Samba data service for the Winbind component can be configured to run as a failover or scalable service.
Winbind deployment – The following restrictions apply when deploying winbind.
Samba Version — If the winbind feature is used, then Samba v2.2.4 or later must be installed.
Solaris Version — Solaris 8 or Solaris 9 with patch 113476–05 or later.
Multiple instances — Only one instance of winbind can be deployed, regardless of that instance being a failover or scalable service.
Supported configurations – Currently, only the following configurations are supported with the Sun Cluster HA for Samba data service.
Samba in a Primary Domain Controller (PDC) configuration
Samba in a Backup Domain Controller (BDC) configuration
Samba as an NT Domain member without winbind
Samba as an NT Domain Member with winbind, however refer to the restriction above with Solaris 9
Samba in a security=user configuration
Installing Samba onto Cluster File Systems — Regardless of which Samba delivery method you have chosen, ie from http://www.samba.org or from Solaris 9, the following restrictions apply.
Samba component — Each Samba instance must have a unique configuration directory that reflects the Samba NetBIOS instance name. This configuration directory can be mounted as either a Failover File System or Global File System.
Winbind component — The winbind component can only be deployed as a single instance, however Winbind still requires a configuration directory . This configuration directory can be mounted as a Failover File System or Global File System if the Winbind component will operate as a failover service. However, this configuration directory must be mounted as a Global File System if the Winbind component will operate as a scalable service.
It is considered best practice when mounting Global File Systems to mount them with the /global prefix and to mount Failover File Systems with the /local prefix. However, be aware that this is simply viewed as best practice.
The following example shows Samba installed from http://www.samba.org onto a Global File System with two Samba instances (SAMBA1 and SAMBA2) and Winbind within that Global File System. The final output shows a subset of the /etc/vfstab entries for Samba deployed using Solaris Volume Manager.
# ls -l /usr/local total 4 drwxrwxrwx 2 root other 512 Oct 1 16:44 bin lrwxrwxrwx 1 root other 13 Oct 11 11:20 samba -> /global/samba # # ls -l /global/samba 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 # # more /etc/vfstab (Subset of the output) /dev/md/dg_d6/dsk/d63 /dev/md/dg_d6/rdsk/d63 /global/samba ufs 4 yes logging,global # |
In the above example the configuration directory for the Samba NetBIOS instance SAMBA1 is /global/samba/SAMBA1, whereas the configuration directory for the Samba NetBIOS instance SAMBA2 is /global/samba/SAMBA2. The Winbind configuration directory is /global/samba/winbind.
The following example shows Samba installed from Solaris 9 on Local File Systems and two Samba instances (SMB1 and SMB2) on Failover File Systems. The final output shows a subset of the /etc/vfstab entries for Samba deployed using Solaris Volume Manager.
# ls -l /local/samba total 4 drwxr-xr-x 2 root other 512 Dec 19 15:51 SMB1 drwxr-xr-x 2 root other 512 Dec 19 15:51 SMB2 # # more /etc/vfstab (Subset of the output) /dev/md/dg_d7/dsk/d70 /dev/md/dg_d7/rdsk/d70 /local/samba/SMB1 ufs 3 no logging /dev/md/dg_d8/dsk/d80 /dev/md/dg_d8/rdsk/d80 /local/samba/SMB2 ufs 3 no logging # |
In the above example the configuration directory for the Samba NetBIOS instance SMB1 is /local/samba/SMB1, whereas the configuration directory for the Samba NetBIOS instance SMB2 is /local/samba/SMB2.
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.
Samba components and their dependencies —The Sun Cluster HA for Samba data service can be configured to protect a Samba instance and its respective components. These components, and their dependencies between each other, are briefly described below.
Table 1–3 Samba components and their dependencies (via -> symbol)
Componet |
Description |
---|---|
Samba (Mandatory) |
-> Winbind resource, if winbind and a single Samba instance is deployed. See below for more information. -> Winbind resource group, if winbind and multiple Samba instances are deployed. See below for more information. -> SUNW.HAStoragePlus resource The SUNW.HAStoragePlus resource manages the Samba File System Mount points and ensures that Samba is not started until these are mounted. |
Winbind(Optional) |
-> SUNW.HAStoragePlus resource The SUNW.HAStoragePlus resource manages the Winbind File System Mount points and ensures that Winbind is not started until these are mounted. |
For more detailed information about these Samba components, refer to the smbd(8), nmbd(8), winbindd(8), and smb.conf(5) man pages.
If your configuration only has a single instance of Samba with winbind, the winbind resource must be registered within the same resource group as the Samba resource. Furthermore, the Samba resource must be start dependent on the winbind resource. Refer to the r_properties(5) man page for information on Resource_dependencies.
If your configuration has multiple instances of Samba with winbind, the winbind resource must be a scalable resource and all Samba resources must be start dependent on the winbind scalable resource group. Refer to the rg_properties(5) man page for information on RG_dependencies. Furthermore, the winbind configuration directory must be mounted as a Global File System.
Each Samba component has a configuration and registration file under /opt/SUNWscsmb/xxx/util, where xxx is a three character abbreviation for the respective Samba component. These files allow you to register the Samba components with Sun Cluster.
Within these files, the appropriate dependencies have already been applied.
# cd /opt/SUNWscsmb # # ls -l samba/util total 6 -rwxr-xr-x 1 root sys 1526 Dec 20 14:44 samba_config -rwxr-xr-x 1 root sys 736 Dec 20 14:44 samba_register # # ls -l winbind/util total 4 -rwxr-xr-x 1 root sys 1006 Dec 20 14:44 winbind_config -rwxr-xr-x 1 root sys 613 Dec 20 14:44 winbind_register # # more samba/util/* :::::::::::::: samba/util/samba_config :::::::::::::: # # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # This file will be sourced in by samba_register and the parameters # listed below will be used. # # 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 # # The following two examples illustrate sample parameters # for Samba packaged with Solaris 9 and Samba downloaded # from http://www.samba.org. # # Please be aware that /global/samba/SAMBA1, /local/samba/SMB1 and # uid/pwd of samba are used just as examples. You will need # change this if your values are different. # # SUNWsmb* packaged with Solaris 9 # # 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 # # Latest production release from http://www.samba.org # # 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 # RS= RG= SMB_BIN= SMB_SBIN= SMB_INST= SMB_LOG= FMUSER= FMPASS= LH= HAS_RS= :::::::::::::: samba/util/samba_register :::::::::::::: # # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # . `dirname $0`/samba_config scrgadm -a -j $RS -g $RG -t SUNW.gds \ -x Start_command="/opt/SUNWscsmb/samba/bin/start_samba \ -R $RS -G $RG -B $SMB_BIN -S $SMB_SBIN -C $SMB_INST \ -L $SMB_LOG -U ${FMUSER}%${FMPASS} -M scmondir" \ -x Stop_command="/opt/SUNWscsmb/samba/bin/stop_samba \ -R $RS -G $RG -B $SMB_BIN -S $SMB_SBIN -C $SMB_INST \ -L $SMB_LOG -U ${FMUSER}%${FMPASS} -M scmondir" \ -x Probe_command="/opt/SUNWscsmb/samba/bin/probe_samba \ -R $RS -G $RG -B $SMB_BIN -S $SMB_SBIN -C $SMB_INST \ -L $SMB_LOG -U ${FMUSER}%${FMPASS} -M scmondir" \ -y Port_list=137/udp,138/udp,139/tcp -y Network_resources_used=$LH \ -x Stop_signal=9 \ -y Resource_dependencies=$HAS_RS # |
The smb.conf file — The Sun Cluster HA for Samba data service provides a sample smb.conf file, however you should ensure that the following parameters are set.
The smb.conf file is probably the most important file within Samba. Therefore you are recommended to refer to the smb.conf(5) man page for complete configuration information on the parameters that follow. Be aware that the Samba man pages with Solaris 9 are only installed if you have installed the SUNWsfman package.
Samba smb.conf file
bind interfaces only has to be set to True.
interface has to be defined to the Logical Hostname.
netbios name has to be set to the NetBIOS name by which the Samba server is known.
security specifies the security mode the Samba instance will run under.
Winbind smb.conf file
workgroup has to be set to the same value as the Samba smb.conf entry.
password server has to be set to the same value as the Samba smb.conf entry.
template homedir has to be set to the same value as the Samba smb.conf entry.
template shell has to be set to the same value as the Samba smb.conf entry.
winbind uid has to be set to the same value as the Samba smb.conf entry.
winbind gid has to be set to the same value as the Samba smb.conf entry.
winbind enum users has to be set to the same value as the Samba smb.conf entry.
winbind use default domain has to be set to the same value as the Samba smb.conf entry.
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.
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.
Samba installed from http://www.samba.org on a Global File System, with Samba instances and Winbind on a Global File System (Example 1–1)
Samba-bin-directory — /global/samba/bin
Samba-sbin-directory — /global/samba/sbin or
/global/samba/bin if Samba was installed with default settings.
Samba-configuration-directory — /global/samba/SAMBA1
Winbind-configuration-directory — /global/samba/winbind
Samba installed from Solaris 9 on a Local File System, with Samba instances on a Failover File System (Example 1–2)
Samba-bin-directory — /usr/sfw/bin
Samba-sbin-directory — /usr/sfw/sbin
Samba-configuration-directory — /local/samba/SMB1
Use this procedure to install and configure Samba.
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.
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.
If Failover File Systems will be used by the Samba instance, you must mount these manually.
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” on page 3 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.
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
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.
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 |
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.
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 |
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.
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 |
pid directory must point to <samba-configuration-directory>/var/locks, as specified within smb.conf_sample .
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 |
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> |
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> |
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.
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 |
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.
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 |
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.
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 |
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.
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 |
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 |
On one node start winbind
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 & |
Populate the secrets.tdb database
# getent passwd # getent group |
Shutdown winbindd
# pkill -TERM winbindd |
This section contains the procedure you need to verify the installation and configuration.
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.
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.
Test the smb.conf file
Test the Samba smb.conf file
# <samba-bin-directory>/testparm \ <samba-configuration-directory>/lib/smb.conf |
Test the Winbind smb.conf file (if required)
# <samba-bin-directory>/testparm \ <winbind-configuration-directory>/lib/smb.conf |
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> |
Start the Samba daemons
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 |
Connect to Samba
# <samba-bin-directory>/smbclient -N -L <NetBIOS-name> # <samba-bin-directory>/smbclient '\\<NetBIOS-name>\scmondir' \ -U <fmuser> -c 'pwd;exit' |
Be aware that the single quotes are required on the last command.
Start the Winbind daemon (if required)
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 & |
Connect to Winbind (if required)
# getent passwd # getent group |
Stop the Samba daemons and winbindd (if required)
# pkill -TERM smbd # pkill -TERM nmbd # pkill -TERM winbindd |
This section contains the procedure you need to install the Sun Cluster HA for Samba packages.
Use this procedure to install the Sun Cluster HA for Samba packages. 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.
Load the Sun Cluster Agents CD-ROM into the CD-ROM drive.
Run the scinstall utility with no options.
This step starts the scinstall utility in interactive mode.
Choose the menu option, Add Support for New Data Service to This Cluster Node.
The scinstall utility prompts you for additional information.
Provide the path to the Sun Cluster Agents CD-ROM.
The utility refers to the CD as the “data services cd.”
Specify the data service to install.
The scinstall utility lists the data service that you selected and asks you to confirm your choice.
Exit the scinstall utility.
Unload the CD from the drive.
This section contains the procedures you need to configure Sun Cluster HA for Samba.
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.
Otherwise, use this procedure to configure the Sun Cluster HA for Samba data service as a failover service.
Become superuser on one of the nodes in the cluster that will host Samba.
Register the SUNW.gds resource type.
# scrgadm -a -t SUNW.gds |
Register the SUNW.HAStoragePlus resource type.
# scrgadm -a -t SUNW.HAStoragePlus |
Create a failover resource group .
# scrgadm -a -g Samba-failover-resource-group |
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 |
Create a resource for the Samba Logical Hostname.
# scrgadm -a -L -j Samba-lh-resource \ -g Samba-failover-resource-group \ -l Samba-logical-hostname |
Enable the failover resource group that now includes the Samba Disk Storage and Logical Hostname resources.
# scswitch -Z -g Samba-failover-resource-group |
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 |
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 |
Enable the Winbind resource (if previous step was done)
# scstat # scswitch -e -j Winbind-resource |
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 |
Enable each Samba resource.
Repeat this step for each Samba instance, if multiple instances were created.
# scstat # scswitch -e -j Samba-resource |
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.
Otherwise, use this procedure to configure the Sun Cluster HA for Samba data service as a failover service.
Become superuser on one of the nodes in the cluster that will host Samba.
Register the SUNW.gds resource type.
# scrgadm -a -t SUNW.gds |
Register the SUNW.HAStoragePlus resource type.
# scrgadm -a -t SUNW.HAStoragePlus |
Create a failover resource group for the shared network address.
# scrgadm -a -g Winbind-failover-resource-group |
Create a resource for the Winbind Logical Hostname.
# scrgadm -a -S -j Winbind-lh-resource \ -g Winbind-failover-resource-group \ -l Winbind-logical-hostname |
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 |
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 |
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 |
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 |
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 |
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 |
Enable the Winbind resource.
# scstat # scswitch -e -j Winbind-resource |
This section contains the procedure you need to verify that you installed and configured your data service correctly.
Use this procedure to verify that you installed and configured Sun Cluster HA for Samba correctly.
Become superuser on one of the nodes in the cluster that will host Samba.
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 |
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 |
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.
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.
Samba
Sleeps for Thorough_probe_interval
Tries to connect to the Samba instance fault monitor share (scmondir), using smbclient, as user <fmuser>. If this fails then the probe will restart the Samba resource.
The smbclient uses the NetBIOS name of the Samba server to verify that the NetBIOS name server works. If this fails then the probe will restart the Samba resource.
If all Samba processes have died, pmf will interrupt the probe to immediately restart the Samba resource.
If the Samba resource is repeatedly restarted and subsequently exhausts the Retry_count within the Retry_interval then a failover is initiated for the Resource Group onto another node.
Winbind
Sleeps for Thorough_probe_interval
Retrieves the defined <ntuser> by using getent passwd <ntuser>. If this fails then the probe will restart the Winbind resource.
If the Winbind resource is repeatedly restarted and subsequently exhausts the Retry_count within the Retry_interval then a failover is initiated for the Resource Group onto another node.
If nscd is on (default) and the defined <ntuser> is cached by the nscd daemon, then getent will return a success even if winbind itself isn't working.
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.
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 # |
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 # |
To turn off debug, simply reverse the steps above.