Contenues dans
Trouver plus de documentationRessources d'assistance comprises | Télécharger cet ouvrage au format PDF (507 Ko)
Installing and Configuring Sun Cluster HA for SambaThis chapter explains how to install and configure Sun Cluster HA for Samba. This chapter contains the following sections.
Installing and Configuring Sun Cluster HA for SambaTable 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 Task Map: Installing and Configuring Sun Cluster HA for Samba
Sun Cluster HA for Samba OverviewSamba 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. Samba is 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 2 Protection of Components
Planning the Sun Cluster HA for Samba Installation and ConfigurationThis section contains the information you need to plan your Sun Cluster HA for Samba installation and configuration. Configuration RestrictionsThis 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. Your data service configuration might not be supported if you do not observe these restrictions.
Example 1 Samba instances and Winbind with Global File Systems
In Example 1–1 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. Example 1–2 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. Example 2 Samba instances with Failover File Systems
In example 1–2 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. Configuration RequirementsThese 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. Your data service configuration might not be supported if you do not adhere to these requirements. If you want to set up Samba as member of a Windows 200x server with ADS support, you must configure kerberos on the cluster nodes and compile Samba with both Ldap and kerberos support. Read the Samba documentation for those tasks. Samba components and their dependencies —You can configure the Sun Cluster HA for Samba data service to protect a Samba instance and its respective components. These components, and their dependencies are described in Table 1–3. Table 3 Samba components and their dependencies (via -> symbol)
Note – 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 has only a single instance of Samba with winbind, the winbind resource must be registered within the same resource group as the Samba resource and the winbind resource will use the same configuration directory as the Samba resource. 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 have a separate configuration directory, 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. You must mount the winbind configuration directory as a Global File System. Each Samba component has a configuration and registration file in /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 been applied. Example 3 Samba configuration and registration file for Sun Cluster
If you want to set up Samba as member of a Windows 200x server with ADS support and the Samba binaries is not static linked with the Ldap and kerberos libraries, you must configure SMB_LIB_PATH parameter in /opt/SUNWscsmb/samba/utils/samba_config and WB_LIB_PATH in /opt/SUNWscsmb/winbind/utils/winbind_config to point to the directories where those libraries resides. smb.conf file — The Sun Cluster HA for Samba data service provides a sample smb.conf file. Ensure that the following parameters are set. Note – The smb.conf file is probably the most important file within Samba. Refer to the smb.conf(5) man page for complete configuration information on the parameters that follow. The Samba man pages with Solaris 9 are installed only if you have installed the SUNWsfman package.
Note – If you make additional smb.conf entries 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 SambaThis section contains the procedures you need to install and configure Samba. Throughout the 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 appear.
How to Install and Configure Samba
Verifying the Installation and Configuration of SambaThis section contains the procedure you need to verify the installation and configuration.
|
# <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> |
# <samba-bin-directory>/net \ -s <samba-config-directory>/lib/smb.conf \ \ -U <Administrator on the PDC> |
If successful, you will receive the following message.
# Joined domain <DOMAIN> |
If configured as an member of a Windows 200x with ADS , join the realm.
# <samba-bin-directory>/net \ -s <samba-config-directory>/lib/smb.conf \ \ -U <Administrator on the PDC> |
If successful, you will receive the following message.
# Joined <NETBIOS> to realm <REALM> |
Start the Samba daemons.
Depending on how Samba was installed, the smbd and nmbd programs may be 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 |
# <samba-bin-directory>/smbclient -N -L <NetBIOS-name> # <samba-bin-directory>/smbclient '\\<NetBIOS-name>\scmondir' \ -U <fmuser> -c 'pwd;exit' |
Single quotes are required on the last command.
Start the Winbind daemon (if required).
Depending on how Samba was installed, the winbind program may be 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 |
If you did not install the Sun Cluster HA for Samba packages during your Sun Cluster installation, perform this procedure to install the packages. Perform this procedure on each cluster node where you are installing the Sun 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 Software Installation Guide for Solaris OS.
Install the Sun Cluster HA for Samba packages by using one of the following installation tools:
Web Start program
scinstall utility
If you are using Solaris 10, install these packages only in the global zone. To ensure that these packages are not propagated to any local zones that are created after you install the packages, use the scinstall utility to install these packages. Do not use 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.
On the cluster node where you are installing the Sun Cluster HA for Samba packages, become superuser.
(Optional) If you intend to run the Web Start program with a GUI, ensure that your DISPLAY environment variable is set.
Insert 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/cdrom0 directory.
Change to the Sun Cluster HA for Samba component directory of the CD-ROM.
The Web Start program for the Sun Cluster HA for Samba data service resides in this directory.
# cd /cdrom/cdrom0/components/SunCluster_HA_Samba_3.1 |
Start the Web Start program.
# ./installer |
When you are prompted, select the type of installation.
Follow the instructions on the screen to install the Sun 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.
Exit the Web Start program.
Remove the Sun Cluster Agents CD-ROM from the CD-ROM drive.
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.
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.
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 using the scinstall Utility.
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:
# 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_SBIN - name of the Winbind sbin directory. Used in Samba 3. # WB_INST - name of the Winbind configuration directory # NTUSER - name of the NT fault monitor user #WB_LIB_PATH- name of library paths to LD_LIBRARY_PATH #WB_DISCACHE - Should winbind cache be disabled. Used in Samba 3. #WB_SINGLEMODE - Should winbind run in single mode. Used in Samba 3. # 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/SAMBA1 NTUSER=samba WB_LIB_PATH=/usr/lib:/usr/local/lib WB_DISCACHE=FALSE WB_SINGLEMODE=FALSE LH=smb-lh-res HAS_RS=wb-has-res |
After editing winbind_config, you must register the resource.
# ./winbind_register |
Enable the Winbind resource (if the 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:.
# 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) #SMB_LIB_PATH - name of library paths to LD_LIBRARY_PATH # FMUSER - name of the Samba fault monitor user # FMPASS - name of the Samba fault monitor user password # FMDOMAIN - name of the NT-domain faultmonitor user is configured on. # ( This should be used if faultmonitor user is not configured # on the same NT-domain Samba is member to ) # LH - name of the LogicalHostname SC resource # HAS_RS - name of the Samba HAStoragePlus SC resource |
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 SMB_LIB_PATH=/usr/lib:/usr/local/lib FMUSER=samba FMPASS=samba FMDOMAIN= 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 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 |
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 using the scinstall Utility.
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. You then 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:.
# 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_SBIN - name of the Winbind sbin directory. Used in Samba 3. # WB_INST - name of the Winbind configuration directory # NTUSER - name of the NT fault monitor user #WB_LIB_PATH- name of library paths to LD_LIBRARY_PATH #WB_DISCACHE - Should winbind cache be disabled. Used in Samba 3. #WB_SINGLEMODE - Should winbind run in single mode. Used in Samba 3. # 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 WB_LIB_PATH=/usr/lib:/usr/local/lib WB_DISCACHE=FALSE WB_SINGLEMODE=FALSE LH=wmb-lh-res HAS_RS=wb-has-res |
After editing winbind_config, you must 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.
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 |
As a result of bug fixes, the configuration of Sun Cluster HA for Samba has changed. If you are running Sun Cluster HA for Samba, you must remove and reregister the resources for the following components of Sun Cluster HA for Samba.
Samba component
Winbind component
Perform this task for each Samba resource that you must remove and reregister.
Save the resource definitions.
# scrgadm -pvv -j resource > file1 |
Disable the resource.
# scswitch -n -j resource |
Remove the resource.
# scrgadm -r -j resource |
Configure and register the resource.
Go to the directory that contains the configuration file and the registration file for the resource.
# cd /opt/SUNWscsmb/prefixutil |
Edit the configuration file for the resource.
vi prefix_config |
Run the registration file for the resource.
# ./prefix_register |
prefix denotes the component to which the file applies, as follows:
samba denotes the Samba component.
winbind denotes the Winbind component.
Save the resource definitions.
# scrgadm -pvv -j resource > file2 |
Compare the updated definitions to the definitions that you saved before you updated the resource.
Comparing these definitions enables you to determine if any existing extension properties have changed, for example, time-out values.
# diff file1 file2 |
Amend any resource properties that were reset.
# scrgadm -c -j resource -x|y resource |
Bring online the resource.
# scswitch -e -j resource |
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.
Probing steps for 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 exhausts the Retry_count within the Retry_interval, then a failover is initiated for the Resource Group onto another node.
Probeing steps for 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 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 until the user has been removed from the cache, even if winbind itself isn't working.
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 on debug 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, repeat this step on all nodes within Sun Cluster.
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 grep daemon /etc/syslog.conf, shows that daemon.debug has 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), and 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, reverse the steps above.