As more and more organizations have started to adopt DevOps tools and practices, automating systems and services is the norm to achieve accuracy, reliability and avoid any human errors. Many organizations have integrated their SAS® platform with these toolsets to achieve maximum automation. In this paper, we will discuss how we can automate start/stop of SAS® LASR Analytic server by making API calls using PROC HTTP.
SAS® LASR Analytic server allows multi-user access to in-memory data. It supports both single machine and distributed computing workloads. This data is consumed by high performance products like SAS® Visual Analytics.
If you administer a SAS® platform with SAS® LASR Analytic server, you might be aware that you need to login to SAS® Visual Analytics Administrator user interface to start the server process. On Linux platform SAS® provides an out-of-the-box startup script “sas.servers” to start and stop SAS® platform services.
Automate and integrate start/stop of SAS® LASR Analytic servers using “sas.servers” script using PROC HTTP.
Login to SAS® Compute server where SAS® LASR Analytic server context has been configured using Installer account (e.g. “sas”) and navigate to your SAS® configuration directory (e.g. “/<sasconfig-path>/Lev1”)
Download the SAS® program “lasr_ops.sas” and shell script “LASROps.sh” under the configuration directory. Links to GitHub repository are shared below.
Edit the SAS® program “lasr_ops.sas” and provide username and password.
Edit the shell script “LASROps.sh” and updated the SAS® configuration directory path at your site.
By default, log output is pointed to LASR Administrator’s account (e.g. “lasradm”) home directory. You can also redirect the log to any location where the user has access.
If you have the sudo permission correctly configured you can run below commands to start, stop and check status of the LASR servers.
To integrate this batch process into “sas.servers” script you will have to edit out-of-the-box “sas.servers.mid” script. In this script, at the end there is a case statement where you need to add the above command. Replace “/sasconfig/Lev1” path to match at your site.
Note: It’s a good practice to take backup of any out-of-the-box file that you change.
By default, status output is written to a text file “lasr_status.txt” under SAS® LASR Administrator account home directory on Linux based system. If you want to run this code on Windows based system you can modify the location to any path where the user has access to write.
Download the full SAS code and shell script from the below links.
This automation can be useful in SAS environments in scenarios where:
This code is an example on how PROC HTTP can be used to automate SAS® LASR Analytic server operations using APIs. There are other ways to automate start/stop LASR servers using PROC LASR procedure or by enabling autoload option on the LASR library.
Using this approach SAS® LASR Analytic server would start in exactly same way as a user would do via user interface. This helps to automatically trigger any add-on properties like “reload-on-restart”, if enabled.
The ABCs of PROC HTTP
What’s New in SAS Environment Manager Administration
Your comments and questions are valued and encouraged. Contact the author at:
Thakral One PTE LTD.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.