This appendix presents a complete example of how to install and configure the Samba application and data service in the global and non-global zone. It presents a simple node cluster configuration. If you need to install the application in any other configuration, refer to the general-purpose procedures presented elsewhere in this manual.
This example uses a single-node cluster with the following node and zone names:
The physical node, which owns the file system.
A whole root non-global zone named whole.
A sparse root non-global zone named sparse.
This deployment example uses the following software products and versions:
Solaris 10 6/06 software for SPARC or x86 platforms
Sun Cluster 3.2 core software
Sun Cluster HA for Samba data service
Samba packaged with Solaris 10
This example assumes that you have already installed and established your cluster. It illustrates installation and configuration of the data service application only.
The instructions in this example were developed with the following assumptions:
Shell environment: All commands and the environment setup in this example are for the Korn shell environment. If you use a different shell, replace any Korn shell-specific information or instructions with the appropriate information for you preferred shell environment.
User login: Unless otherwise specified, perform all procedures as superuser or assume a role that provides solaris.cluster.admin, solaris.cluster.modify, and solaris.cluster.read RBAC authorization.
This deployment example is designed for a single-node cluster. It is provided simply as a concise guide to help you if you need to refer to an installation and configuration of Samba.
This deployment example is not meant to be a precise guide as there are several alternate ways to install and configure Samba.
If you need to install Samba in any other configuration, refer to the general purpose procedures elsewhere in this manual.
The instructions with this deployment example assumes that you are using the Samba software packaged with Solaris 10 and will configure Samba on a ZFS highly available local file system .
The cluster resource group will be configured to failover between the global zone and two non-global zones on a single node cluster.
The tasks you must perform to install and configure Samba in the global and non-global zones are as follows:
Install and configure the cluster as instructed in Sun Cluster Software Installation Guide for Solaris OS.
Install the following cluster software components on node Vigor5.
Sun Cluster core software
Sun Cluster data service for Samba
Add the logical host name to /etc/hosts and /etc/inet/ipnodes.
Vigor5# grep SMB1 /etc/hosts /etc/inet/ipnodes /etc/hosts:192.168.1.132 SMB1#20 /etc/inet/ipnodes:192.168.1.132 SMB1#20 |
Install and configure a Zettabyte File System.
Create a ZFS pool.
The following zpool definition represents a very basic configuration for deployment on a single-node cluster.
You should not consider this example for use within a productive deployment, instead it is a very basic configuration for testing or development purposes only.
Vigor5# zpool create -m /local HAZpool c1t1d0 |
Create a ZFS.
Vigor5# zfs create HAZpool/samba |
Create the Samba Fault Monitor Userid in the Global Zone.
Vigor5# groupadd -g 1000 samba Vigor5# useradd -u 1000 -g 1000 -s /bin/false homer |
In this task you will install two Solaris Containers on node Vigor5.
On local cluster storage create a directory for the non-global zones root path.
Vigor5# mkdir /zones |
Create a temporary file for the whole root zone, for example /tmp/whole, and include the following entries.
Vigor5# cat > /tmp/whole <<-EOF create -b set zonepath=/zones/whole EOF |
Create a temporary file for the sparse root zone, for example /tmp/sparse, and include the following entries.
Vigor5# cat > /tmp/sparse <<-EOF create set zonepath=/zones/sparse EOF |
Configure the non-global zones, using the files you created.
Vigor5# zonecfg -z whole -f /tmp/whole Vigor5# zonecfg -z sparse -f /tmp/sparse |
Install the zones.
Open two windows and issue the following command in each window.
Vigor5# zoneadm -z whole install Vigor5# zoneadm -z sparse install |
Boot the zones.
Vigor5# zoneadm -z whole boot Vigor5# zoneadm -z sparse boot |
Log in to the zones and complete the zone system identification.
Vigor5# zlogin -C whole Vigor5# zlogin -C sparse |
Close the terminal windows and disconnect from the zone consoles.
After you have completed the zone system identification, disconnect from the two windows your previously opened.
Vigo5# ~. |
Create local mount points for the HA-ZFS file system with in the zones.
Vigor5# zlogin whole mkdir /local Vigor5# zlogin sparse mkdir /local |
Create the Samba Fault Monitor Userid in the zones.
Vigor5# zlogin whole groupadd -g 1000 samba Vigor5# zlogin sparse groupadd -g 1000 samba Vigor5# zlogin whole useradd -u 1000 -g 1000 -s /bin/false homer Vigor5# zlogin sparse useradd -u 1000 -g 1000 -s /bin/false homer |
Register the necessary data types on the single node cluster.
Vigor5# clresourcetype register SUNW.gds SUNW.HAStoragePlus |
Create the Samba resource group.
Vigor5# clresourcegroup create -n Vigor5,Vigor5:whole,Vigor5:sparse samba-rg |
Create the logical host.
Vigor5# clreslogicalhostname create -g samba-rg -h SMB1 samba-lh |
Create the HAStoragePlus resource in the samba-rg resource group.
Vigor5# clresource create -g samba-rg -t SUNW.HAStoragePlus \ > -p Zpools=HAZpool sambaZFS-has |
Enable the resource group.
Vigor5# clresourcegroup online -M samba-rg |
Create the Samba Configuration Directory.
Vigor5# mkdir -p /local/samba/smb1 Vigor5# cd /local/samba/smb1 Vigor5# mkdir -p lib logs private shares var/locks |
Create the Samba smb.conf Configuration File.
Vigor5# cat > /local/samba/smb1/lib/smb.conf <<-EOF [global] workgroup = PDC bind interfaces only = yes interfaces = SMB1/255.255.255.0 netbios name = SMB1 security = user server string = Samba (%v) domain (%h) pid directory = /local/samba/smb1/var/locks log file = /local/samba/smb1/logs/log.%m smb passwd file = /local/samba/smb1/private/smbpasswd private dir = /local/samba/smb1/private lock dir = /local/samba/smb1/var/locks domain logons = yes domain master = yes preferred master = yes [scmondir] comment = Monitor directory for Sun Cluster path = /tmp browseable = No EOF |
Test the Samba smb.conf Configuration File.
Vigor5# /usr/sfw/bin/testparm -s /local/samba/smb1/lib/smb.conf |
Add the Samba Fault Monitor Userid.
You should specify samba as the password, otherwise you will need to change the SAMBA_FMPASS variable in Step 1 in Example: Enable the Samba Software to Run in the Cluster
Vigor5# /usr/sfw/bin/smbpasswd -c /local/samba/smb1/lib/smb.conf -a homer |
Start Samba using the smbd program.
Vigor5# /usr/sfw/sbin/smbd -s /local/samba/smb1/lib/smb.conf -D |
Connect to Samba using the smbclient program.
Vigor5# /usr/sfw/bin/smbclient -N -L SMB1 -s /local/samba/smb1/lib/smb.conf Vigor5# Vigor5# /usr/sfw/bin/smbclient '\\SMB1\scmondir' -U homer -c 'pwd;exit' \ > -s /local/samba/smb1/lib/smb.conf |
Stop Samba.
Vigor5# pkill -TERM smbd |
Create the Sun Cluster HA for Samba Configuration file.
Vigor5# cat > /var/tmp/samba_config <<-EOF #+++ Resource Specific Parameters +++ RS=samba RG=samba-rg RS_LH=samba-lh RS_HAS=sambaZFS-has SERVICES="smbd,nmbd" #+++ Common Parameters +++ BINDIR=/usr/sfw/bin SBINDIR=/usr/sfw/sbin CFGDIR=/local/samba/smb1 LDPATH=/usr/sfw/lib FMUSER=homer #+++ SMBD & NMBD Specific Parameters (See Note 1) +++ SAMBA_LOGDIR=/local/samba/smb1/logs SAMBA_FMPASS=samba SAMBA_FMDOMAIN= #+++ WINBIND Specific Parameters (See Note 2) +++ WINBIND_DISCACHE=FALSE WINBIND_SINGLEMODE=FALSE #+++ Zone Specific Parameters (See Note 3) +++ RS_ZONE= LHOST= PROJECT=default TIMEOUT=30 EOF |
Register the Sun Cluster HA for Samba data service.
Vigor5# /opt/SUNWscsmb/util/samba_register -f /var/tmp/samba_config |
Enable the resource.
Vigor5# clresource enable samba |