New Solaris 10 Experience

With over 6 million Solaris 10 downloads, the majority running on Dell, HP and IBM, I wonder if the Solaris 10 experience could get any better - well perhaps it could.

We are about to release Sun Cluster 3.2 and one very useful feature is running a single node cluster. While a single node cluster does not offer full high availability it does allow you to simulate running a cluster.

What this means is that on your Solaris 10 node you will be abe to download and install Sun Cluster 3.2 and failover applications between Solaris 10 Containers on the same node. In the example that follows we use Samba, which is integrated into Solaris 10, so that we can failover Samba between two Solaris 10 Containers on the same node.

So, if you are one of the 6 million Solaris 10 downloaders, you will soon have the opportunity for another Solaris 10 experience, even if you downloaded Solaris 10 onto your Dell, HP or IBM laptop.

From the output below, one can observe that node Vigor4 has two Solaris 10 Containers, z1 and z2. There are three Sun Cluster 3.2 resources that provide high availability for Samba between zones z1 and z2, all on a single node cluster. What you will not see is a volume manager, instead resource samba-has uses HA-ZFS. High availability for the Samba logical host and Samba service are provided by the samba-lh and samba-pdc resources.

bash-3.00# cluster status -t resource

Cluster Resources ===

Resource Name Node Name State Status Message
------------- --------- ----- --------------
samba-lh Vigor4:z1 Offline Offline - LogicalHostname offline.
Vigor4:z2 Online Online - LogicalHostname online.

samba-has Vigor4:z1 Offline Offline
Vigor4:z2 Online Online

samba-pdc Vigor4:z1 Offline Offline
Vigor4:z2 Online Online - Service is online.

To failover Samba between two Solaris 10 Containers on the same node just follow the steps below.

Hardware requirements
--------------------
64-bit processor
1024 Mbytes of memory
1024 Mbytes of swap
512 Mbytes of /globaldevices file system
SCSI or Fiber attached storage (Or VMWARE Workstation)

Software requirements
---------------------
Solaris 10 06/06
Sun Cluster 3.2 (GA January 2007)

Solaris 10 features
-------------------
Solaris 10 Containers
Zettabyte File System
Samba

Assumptions
-----------
Disk c1t5d0 is assumed to be the SCSI or Fiber attached storage.
Sparse root non-global zones will be used.
Arbitrary names and numbers have been used for zones, cluster resources and samba.

How to install Sun Cluster 3.2 onto a single node running Solaris 10 06/06
--------------------------------------------------------------------------
The Sun Cluster Installation document provides full instructions about setting up the root (/) file system and /globaldevices file system as well as how to install Sun Cluster 3.2. However, here is a very brief overview.

/globaldevices must be configured.
Load the Sun Java Availability Suite DVD-ROM into the DVD-ROM drive.
cd /cdrom/cdrom0/Solaris_sparc or cd /cdrom/cdrom0/Solaris_x86.
./installer (follow the screens that follow).

Note: You must install the core software as well as the agents.

Now configure the cluster as single-node by running /usr/cluster/bin/scinstall and follow the screens that follow.

Once Sun Cluster 3.2 is installed, configured and the node has been rebooted, you will be running a single node cluster. At this point we simply need to deploy Samba within a ZFS pool so that it can failover between two Solaris 10 Containers.

I have kept things simple so that you can get as quickly as possible to a functional single node cluster running high availability Samba. You should not consider the following steps as suitable for running in production, instead it simply represents an opportunity to try out Sun Cluster 3.2 on Dell, HP, IBM or Sun hardware as a single node cluster.

How to configure the target configuration
-----------------------------------------
All of the following steps can be performed from the global zone.

1. Create a ZFS pool.

bash-3.00# zpool create -m /ZFSsamba HAZpool c1t5d0

2. Create the Samba configuration directory, used by the Sun Cluster data service for Samba.

bash-3.00# mkdir -p /ZFSsamba/SMB1
bash-3.00# cd /ZFSsamba/SMB1
bash-3.00# mkdir -p lib logs private shares var/locks

3. Create the Samba configuration file.

bash-3.00# cat > /ZFSsamba/SMB1/lib/smb.conf <<-EOF
[global]
workgroup = SAMBA_PDC
bind interfaces only = yes
interfaces = SMB1/255.255.255.0
netbios name = SMB1
security = user
server string = Samba (%v) domain (%h)
pid directory = /ZFSsamba/SMB1/var/locks
log file = /ZFSsamba/SMB1/logs/log.%m
smb passwd file = /ZFSsamba/SMB1/private/smbpasswd
private dir = /ZFSsamba/SMB1/private
lock dir = /ZFSsamba/SMB1/var/locks
domain master = yes
preferred master = yes

[scmondir]
comment = Monitor directory for Sun Cluster
path = /tmp
browseable = No
EOF

4. Test the Samba configuration file.

bash-3.00# /usr/sfw/bin/testparm -s /ZFSsamba/SMB1/lib/smb.conf

5. Configure two sparse root non-global zones.

bash-3.00# mkdir /zones
bash-3.00# cat > /var/tmp/z1 <<-EOF
create
set zonepath=/zones/z1
set autoboot=true
EOF
bash-3.00# cat > /var/tmp/z2 <<-EOF
create
set zonepath=/zones/z2
set autoboot=true
EOF
bash-3.00# zonecfg -z z1 -f /var/tmp/z1
bash-3.00# zonecfg -z z2 -f /var/tmp/z2

6. Install zones z1 and z2 (Perform each install in separate windows).

bash-3.00# zoneadm -z z1 install
bash-3.00# zoneadm -z z2 install

7. Complete the zone identification (Perform each identification in separate windows).

Note: You will need to complete the system identification from the zone's console (zlogin -C z1) after it has finished booting.

bash-3.00# zoneadm -z z1 boot
bash-3.00# zlogin -C z1
bash-3.00# ~.

bash-3.00# zoneadm -z z2 boot
bash-3.00# zlogin -C z2
bash-3.00# ~.

8. Create an IP address for Samba in the global zone and non-global zones z1 and z2.

bash-3.00# echo "192.168.1.10 SMB1#20" >> /etc/hosts
bash-3.00# echo "192.168.1.10 SMB1#20" >> /etc/inet/ipnodes
bash-3.00# zlogin z1 'echo "192.168.1.10 SMB1#20" >> /etc/hosts'
bash-3.00# zlogin z1 'echo "192.168.1.10 SMB1#20" >> /etc/inet/ipnodes'
bash-3.00# zlogin z2 'echo "192.168.1.10 SMB1#20" >> /etc/hosts'
bash-3.00# zlogin z2 'echo "192.168.1.10 SMB1#20" >> /etc/inet/ipnodes'

9. Create a Samba fault monitor userid, used by the Sun Cluster data service for Samba, in the global zone and each non-global zone.

bash-3.00# groupadd -g 10000 samba
bash-3.00# useradd -u 10000 -g 10000 -s /bin/false fmuser
bash-3.00# zlogin z1 groupadd -g 10000 samba
bash-3.00# zlogin z2 groupadd -g 10000 samba
bash-3.00# zlogin z1 useradd -u 10000 -g 10000 -s /bin/false fmuser
bash-3.00# zlogin z2 useradd -u 10000 -g 10000 -s /bin/false fmuser

10. Add the Samba fault monitor userid.

Note: Specify samba as the password.

bash-3.00# /usr/sfw/bin/smbpasswd -c /ZFSsamba/SMB1/lib/smb.conf -a fmuser

11. Verify Samba can start and is accessible.

Note: When prompted, enter samba as the password.

bash-3.00# ifconfig e1000g0 addif SMB1 up
bash-3.00# /usr/sfw/sbin/smbd -s /ZFSsamba/SMB1/lib/smb.conf -D
bash-3.00# /usr/sfw/bin/smbclient -N -L SMB1 -s /ZFSsamba/SMB1/lib/smb.conf
bash-3.00# /usr/sfw/bin/smbclient '\\\\SMB1\\scmondir' -U fmuser -c 'pwd;exit' -s /ZFSsamba/SMB1/lib/smb.conf

12. Stop Samba.

bash-3.00# pkill -TERM smbd
bash-3.00# ifconfig e1000g0 removeif SMB1

13. Register the necessary Sun Cluster 3.2 resource types.

bash-3.00# clresourcetype register SUNW.HAStoragePlus
bash-3.00# clresourcetype register SUNW.gds

14. Create the Samba resource group.

bash-3.00# clresourcegroup create -n Vigor4:z1,Vigor4:z2 samba-rg

15. Create the Samba logical host resource.

bash-3.00# clreslogicalhostname create -g samba-rg -h SMB1 samba-lh

16. Create the Samba ZFS storage resource.

bash-3.00# clresource create -g samba-rg -t SUNW.HAStoragePlus -p Zpools=HAZpool samba-has

17. Enable the Samba resource group.

bash-3.00# clresourcegroup online -M samba-rg

18. Create a Sun Cluster Samba configuration file, used by the Sun Cluster data service for Samba.

Note: The following parameters have been copied from /opt/SUNWscsmb/util/samba_config

bash-3.00# cat > /var/tmp/samba_config <<-EOF
#+++ Resource Specific Parameters +++
RS=samba-pdc
RG=samba-rg
RS_LH=samba-lh
RS_HAS=samba-has
SERVICES="smbd,nmbd"

#+++ Common Parameters +++
BINDIR=/usr/sfw/bin
SBINDIR=/usr/sfw/sbin
CFGDIR=/ZFSsamba/SMB1
LDPATH=/usr/sfw/lib
FMUSER=fmuser

#+++ SMBD & NMBD Specific Parameters (See Note 1) +++
SAMBA_LOGDIR=/ZFSsamba/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

19. Register the Sun Cluster HA for Samba resource.

bash-3.00# /opt/SUNWscsmb/util/samba_register -f /var/tmp/samba_config

20. Enable the Samba resource.

bash-3.00# clresource enable samba-pdc

21. Switch the Samba resource group between the zones and verify Samba is accessible.

Note: When issuing the smbclient program you can ignore messages relating to /etc/sfw/smb.conf.

bash-3.00# clresourcegroup status

samba-rg should be Online on Vigor4:z1

bash-3.00# /usr/sfw/bin/smbclient -N -L SMB1
bash-3.00# /usr/sfw/bin/smbclient '\\\\SMB1\\scmondir' -U fmuser -c 'pwd;exit'

bash-3.00# clresourcegroup switch -n Vigor4:z2 samba-rg

bash-3.00# clresourcegroup status

samba-rg should now be Online on Vigor4:z2

bash-3.00# /usr/sfw/bin/smbclient -N -L SMB1
bash-3.00# /usr/sfw/bin/smbclient '\\\\SMB1\\scmondir' -U fmuser -c 'pwd;exit'

bash-3.00# clresourcegroup switch -n Vigor4:z1 samba-rg

Although I have used long form cluster commands, short form cluster commands are available and can be used, e.g.

clresourcetype clrt
clreslogicalhostname clrslh
clresourcegroup clrg
clresource clrs

Finally, although we have used Samba in this example, you could equally have used another Sun Cluster 3.2 agent or created your own. For some good information on how to do this and further goodness about zones on Sun Cluster, please refer to the following:

http://blogs.sun.com/SC/entry/creating_sun_cluster_agents_for

http://blogs.sun.com/SC/entry/sun_cluster_and_solaris_zones

Neil Garthwaite
Sun Cluster Engineering

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

mkb

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today