In a multi-tier deployment of the SAS Intelligence Platform, starting and stopping the SAS servers has to follow a specific order.
Until recently, I thought that the only choices for starting and stopping the servers in a multi-tier SAS deployment was to do it manually (ugh!), write custom scripts (fun, but time-consuming), or look for a third-party tool to manage the process. None of these choices is ideal in terms of being easy to use and easy to implement.
Then I came across the SAS Global Forum Paper, An Oasis of Serenity in a Sea of Chaos: Automating the Management of Your UNIX/Linux Multi-tiered SAS® Services, which describes the SAS Local Services Management (SAS_lsm) utility.
What is the SAS_lsm utility?
A quick summary of the SAS_lsm utility is that it uses a configuration file customized to your deployment and ssh commands to orchestrate the operation of the SAS servers. It leverages the sas.servers script on each machine and offers a single command to start, stop, and check the status of the SAS servers across all the tiers in your deployment. For more details see Usage Note 58231: Utility that manages multi-tiered SAS® services for Unix/Linux deployments.
After reading about the SAS_lsm utility, it seemed like it would be easy to use and easy to install, and much better than the methods I'd used previously. Of course, the best way to get familiar with the SAS_lsm utility is to try it.
Trying the SAS_lsm utility
I decided to try the SAS_lsm utility on a SAS deployment with six Linux machines: three of the six Linux machines are used for a Metadata cluster, two of the Linux machines are used as Application servers, and the remaining Linux machine is used for the Middle tier. The start-up order, tier name and a short description for each machine is listed in the table below; the shut-down order will be the opposite of the start-up order.
Start-up Order
Tier Name
hostname
Description
1
Meta
meta.demo.sas.com
Metadata node (first configured node)
2
Meta2
meta2.demo.sas.com
Metadata node
3
Meta3
meta3.demo.sas.com
Metadata node
4
AppSrv
compute.demo.sas.com
SAS Application Server (general application server)
5
AppSrvVA
va.demo.sas.com
SAS Application Server (supporting Visual Analytics)
6
MidTier
webapp.demo.sas.com
Middle Tier
Prerequisites
There were only two prerequisites listed for installing and using the SAS_lsm utility:
BASH shell installed.
Multi-directional SSH enabled for the SAS installation account.
Both of these prerequisites were met in my SAS environment, therefore, I didn't need to spend any time setting them up . If your environment doesn't meet these prerequisites, a quick Internet search will give you instructions on installing the BASH shell or setting up SSH.
Installation of the SAS_lsm utility
I followed the steps outlined in Usage Note 58231: Utility that manages multi-tiered SAS® services for Unix/Linux deployments for downloading and installing the SAS_lsm utility to the Meta machine. The installation, including the download and running the installation script, took just a few minutes.
Configuration of the SAS_lsm utility
The configuration was also very straight forward. The Global Forum Paper contained detailed examples that were easy to adapt for my environment. Here is the configuration file for my deployment:
# SAS CONFIGURATION DIRECTORY (E.G. /sas/9.4/config/Lev1)
# if you have unique SAS CONFIGURATION directories in your TIERED deployment, you
# can remove the SASCONFIG variable definition and then provide the absolute
# path to your SAS CONFIGURATION directory on a TIER by TIER basis
SASCONFIG=/opt/sas/config/Lev1
# SAS INSTALLER USERID
# if you have unique SAS INSTALLER userids in your TIERED deployment, you
# can remove the SASINST variable definition and then provide the unique
# SAS INSTALLER userids on a TIER by TIER basis
SASINST=sas
# START IDENTIFY TIER DETAILS IN THEIR STARTUP ORDER (METADATA, COMPUTE, MIDTIER)
TIERNAME[1]='Meta'
TIERINST[1]="${SASINST}"
TIERHOST[1]="meta.demo.sas.com"
TIERSTAR[1]="${SASCONFIG}/sas.servers start"
TIERSTOP[1]="${SASCONFIG}/sas.servers stop"
TIERREST[1]="${SASCONFIG}/sas.servers restart"
TIERSTAT[1]="${SASCONFIG}/sas.servers status"
TIERSTAS[1]='is NOT up'
TIERSTOS[1]='is UP'
TIERNAME[2]='Meta2'
TIERINST[2]="${SASINST}"
TIERHOST[2]="meta2.demo.sas.com"
TIERSTAR[2]="${SASCONFIG}/sas.servers start"
TIERSTOP[2]="${SASCONFIG}/sas.servers stop"
TIERREST[2]="${SASCONFIG}/sas.servers restart"
TIERSTAT[2]="${SASCONFIG}/sas.servers status"
TIERSTAS[2]='is NOT up'
TIERSTOS[2]='is UP'
TIERNAME[3]='Meta3'
TIERINST[3]="${SASINST}"
TIERHOST[3]="meta3.demo.sas.com"
TIERSTAR[3]="${SASCONFIG}/sas.servers start"
TIERSTOP[3]="${SASCONFIG}/sas.servers stop"
TIERREST[3]="${SASCONFIG}/sas.servers restart"
TIERSTAT[3]="${SASCONFIG}/sas.servers status"
TIERSTAS[3]='is NOT up'
TIERSTOS[3]='is UP'
TIERNAME[4]='AppSrv'
TIERINST[4]="${SASINST}"
TIERHOST[4]="compute.demo.sas.com"
TIERSTAR[4]="${SASCONFIG}/sas.servers start"
TIERSTOP[4]="${SASCONFIG}/sas.servers stop"
TIERREST[4]="${SASCONFIG}/sas.servers restart"
TIERSTAT[4]="${SASCONFIG}/sas.servers status"
TIERSTAS[4]='is NOT up'
TIERSTOS[4]='is UP'
TIERNAME[5]='AppSrvVA'
TIERINST[5]="${SASINST}"
TIERHOST[5]="va.demo.sas.com"
TIERSTAR[5]="${SASCONFIG}/sas.servers start"
TIERSTOP[5]="${SASCONFIG}/sas.servers stop"
TIERREST[5]="${SASCONFIG}/sas.servers restart"
TIERSTAT[5]="${SASCONFIG}/sas.servers status"
TIERSTAS[5]='is NOT up'
TIERSTOS[5]='is UP'
TIERNAME[6]='Midtier'
TIERINST[6]="${SASINST}"
TIERHOST[6]="webapp.demo.sas.com"
TIERSTAR[6]="${SASCONFIG}/sas.servers start"
TIERSTOP[6]="${SASCONFIG}/sas.servers stop"
TIERREST[6]="${SASCONFIG}/sas.servers restart"
TIERSTAT[6]="${SASCONFIG}/sas.servers status"
TIERSTAS[6]='is NOT up'
TIERSTOS[6]='is UP'
# END IDENTIFY TIER DETAILS IN THEIR STARTUP ORDER (METADATA, COMPUTE, MIDTIER)
# NUMBER OF TIERS
MAXTIERS=6
# NUMBER OF RETRIES
MAXRETRY=60
# SLEEP INTERVAL IN SECONDS PER RETRY
SLEEP=5
# STATUS REPORT ROOT DIRECTORY (default is /tmp unless otherwise specified)
STATUSROOT=/tmp
# SAS ADMINISTRATOR EMAIL ADDRESSES
SASADMIN="Admin_email@sas.com"
You may use any name for the configuration file; I used the default name of multi-tier-MCM.template.
Setting up the configuration file, including time spent referring to examples in the Global Forum Paper , took me between 15 and 20 minutes. I had already read through the paper once and had a good idea what the configuration file needed. You should plan for a little longer setup for your first time configuring the utility.
Using the SAS_lsm command
Once I had the SAS_lsm utility configured, the commands to start, stop, and check the status of the SAS servers worked flawlessly.
Executing the SAS_lsm command without any argument will give these brief usage notes:
<<USAGE>> [bash | sh] SAS_lsm [-a <NUM> | -o <NUM> | -s] -c <CFG>
WHERE
-a NUM start deployment tier services from tier NUM to MAXTIERS
-o NUM stop deployment tier services from MAXTIERS to tier NUM
-s provide status of all deployment tier services
-c CFG specify configuration file
NOTE
-a, -o, and -s options are not to be run concurrently
For my environment, here are the exact commands I used to control the SAS servers across all machines in the deployment:
Start the SAS servers
bash SAS_lsm -a 1 -c multi-tier-MCM.template
Check the status of the SAS servers
bash SAS_lsm -s -c multi-tier-MCM.template
Stop the SAS servers
bash SAS_lsm -o 1 -c multi-tier-MCM.template
Refer to the Global Forum Paper for more on the SAS_lsm command and its options.
Key Takeaways
I was delighted at how straightforward the SAS_lsm utility was to install and how easily it worked. It will be part of my SAS Administrator's toolkit of tips, tricks, and techniques going forward.
Plan for some extra time when you first install the SAS_lsm utility. For this blog, I spent about 1.5 hours total. This time included reading the Global Forum Paper, reading the Usage Note and performing the installation along with basic testing of the SAS_lsm command. Next time I install the utility I expect it will take roughly 20 minutes.
Having a single command that can operate the SAS servers in a multi-tier deployment is enormously helpful. The more machines hosting SAS servers in your deployment, the more helpful having a single command to operate them all becomes.
The SAS_lsm utility offers an additional feature to collect log files from the various SAS servers it controls - this is great for troubleshooting. Refer to the the utility's documentation for more information.
The SAS_lsm utility has flexibility that I didn't explore in this blog. It can be used to control more than just the servers in the sas.servers script. With a bit of scripting work, you could use the SAS_lsm command to orchestrate other non-SAS servers that need to start along with the SAS servers.
... View more