Clear SAS® 9.4 middle-tier logs and temporary files


This article applies to the SAS 9.4 middle tier on Microsoft Windows and Linux.

Overview 

Use this procedure to remove accumulated log files, Web Application Server work files, temporary files, distributed-cache files, and ActiveMQ data from a SAS 9.4 middle-tier deployment. The procedure provides separate instructions for Microsoft Windows and Linux. 

Schedule an outage before you begin. Archive any files required by your organization for troubleshooting, auditing, or retention. 

Important Stop the applicable SAS services before removing files. Delete, move, or archive only the contents of the listed directories. Do not delete the directories themselves. 

Before you begin 

  • Confirm the SAS configuration directory and configuration level on each applicable server.
  • Identify every applicable Web Application Server instance. In SASServerX_Y, X and Y represent the server instance, such as SASServer1_1.
  • In a clustered or multi-host deployment, identify every host that contains one or more of the listed paths.
  • Determine whether the deployment uses the Gemfire or Geode distributed-cache directory. Use only the directory that already exists. 
  • Archive any logs or state files that must be retained. Do not perform cleanup before collecting files requested for an active support investigation.
  • Confirm that you can stop, start, and verify the applicable SAS services. 

Temporary files

The contents of the Web Application Server work and temp directories do not ordinarily need to be backed up unless required by site procedures. 

Optional Automation and Diagnostic Scripts 

SAS Technical Support provides scripts that can automate portions of a SAS 9.4 middle-tier clean restart and collect current middle-tier logs and configuration files. View the SAS 9.4 middle-tier clean-restart and diagnostic scripts

  • Review the script contents and usage information before running a script.
  • Confirm the SAS configuration directory and level.
  • Run the script only on the intended SAS hosts and configuration level.
  • Archive diagnostic information required for an active support investigation before cleanup.
  • If the script is not appropriate for the deployment, use the manual procedure in this article.

Clustered ActiveMQ environments

The clean-restart script can remove ActiveMQ KahaDB data. If ActiveMQ data is on shared storage or the deployment uses failover, review the topology and retention requirements before using the script. Use the manual procedure when shared ActiveMQ data must be preserved. 

Microsoft Windows Procedure 

1. Stop the SAS services:

Stop the SAS services on each applicable server. In a distributed deployment, stop services on every host that contains one or more of the cleanup paths. Confirm that the services have stopped before continuing. 

2. Clear the applicable directories: 

Delete, move, or archive only the contents that match the following paths. Repeat the SASServerX_Y paths for every applicable server instance. 

Distributed-Cache Files 

Use the directory that exists in the deployment. Do not create or rename either directory. 

Earlier SAS 9.4 revisions that use GemFire:

Later SAS 9.4M8 revisions and SAS 9.4M9 revisions that use Geode:

3. Start the SAS services: 

Start the SAS services in the SAS recommended order. In a distributed deployment, start the required compute-tier services first, followed by the primary middle-tier server, and then any remaining middle-tier servers. Confirm that startup completes before starting dependent services. 

4. Validate the environment:

  • All required SAS services are running.
  • The SAS Web Server responds successfully.
  • SAS Logon Manager is accessible.
  • At least one affected SAS web application opens successfully.
  • New log files are created in the expected locations.
  • The Cache Locator or Geode locator and ActiveMQ start without errors.  

Linux Procedure 

You can perform the cleanup manually by following these steps or use the applicable optional script referenced earlier in this article. 

1. Stop the SAS services: 

On each applicable compute-tier or middle-tier host, change to the SAS configuration-level directory and run: 

./sas.servers stop 

Confirm that the applicable services have stopped before continuing. In a distributed deployment, perform this step on every host that contains one or more of the cleanup paths. 

2. Clear the applicable directories: 

Delete, move, or archive only the contents that match the following paths. Repeat the SASServerX_Y paths for every applicable server instance. 

Distributed-Cache Files 

Earlier SAS 9.4 revisions that use GemFire: 

Later SAS 9.4M8 revisions and SAS 9.4M9 revisions that use Geode: 

Shell wildcard behavior:  The * wildcard does not normally select hidden entries whose names begin with a period. Do not remove hidden entries unless they have been explicitly reviewed and approved for removal. 

3. Start the SAS services: 

Start the services in the SAS-recommended order using:

./sas.servers start

4. Validate the environment: 

  • The sas.servers status shows the expected services as running. 
  • The SAS Web Server responds successfully.
  • SAS Logon Manager is accessible.
  • At least one affected SAS web application opens successfully.
  • New log files are generated in the expected locations.
  • The Cache Locator or Geode locator and ActiveMQ start without errors. 

Result 

When the services start, SAS re-creates required temporary files and generates new log and service-state files. This procedure does not rebuild SAS Content Server search indexes.