SAS Configuration Server

Overview

SAS Configuration Server is based on HashiCorp Consul. SAS Configuration Server acts as a service configuration registry that serves as a central repository for configuration data, service discovery, and health status.

Note: A programming-only deployment does not use SAS Configuration Server.

Operate (Linux)

SAS Viya provides a script in /etc/init.d that you use to stop, start, restart, and check the status of SAS Configuration Server. The script is named, sas-viya-consul-default.

Syntax

How you run sas-viya-consul-default depends on your operating system:

  • Red Hat Enterprise Linux 7.x (or an equivalent distribution) and SUSE Linux Enterprise Server 12.x:

    sudo systemctl status | stop | start | restart sas-viya-consul-default

  • Red Hat Enterprise Linux 6.x (or an equivalent distribution):

    sudo service sas-viya-consul-default status | stop | start | restart

Usage Notes and Tips

  • You must be logged on to the machine where SAS Configuration Server resides. Also, you must have root-level privileges to run this script.
  • For multi-machine deployments, run sas-viya-consul-default on every SAS Viya machine. Start SAS Configuration Server first. Stop SAS Configuration Server last.
  • If there are multiple instances of SAS Configuration Server, start them in this sequence:
    • First, start sas-viya-consul-default on all machines in the [consul] host group.

      The [consul] host group is located in the Ansible playbook inventory.ini file and it defines which machines host the SAS Configuration Server instances.

    • Next, start sas-viya-consul-default on all other machines in the deployment, which launches the agent processes for SAS Configuration Server.
  • If there are multiple instances of SAS Configuration Server, stop them in this sequence:
    • First, stop sas-viya-consul-default on all machines not in the [consul] host group.

      The [consul] host group is located in the Ansible playbook inventory.ini file.

    • Next, stop sas-viya-consul-default on machines in the [consul] host group.
  • There is a script with which you can manage and view the running state of all SAS Viya services. For more information, see Start and Stop All Servers and Services in SAS Viya Administration: General Servers and Services.
  • On Linux systems that support systemd, use the systemctl command when running sas-viya-consul-default. The systemctl command maintains a record of service status that the service command and a direct call does not use.

    CAUTION

    On Red Hat Enterprise Linux 7.x (or an equivalent distribution) and SUSE Linux Enterprise Server 12.x, do not mix System V init and systemd commands. Mixing the System V init (service command) with the systemd (systemctl command) causes several issues. The systemctl command knows nothing about a SAS Viya service started with the service command. If you start sas-viya-consul-default on RHEL 7.x with the service command, and later attempt to shut down SAS Configuration Server using the systemctl command, the configuration server stops responding and does not shut down.

Examples

  • To check status of SAS Configuration Server on Red Hat Enterprise Linux 7.x (or an equivalent distribution) and SUSE Linux Enterprise Server 12.x:
    sudo systemctl status sas-viya-consul-default
  • To stop SAS Configuration Server on Red Hat Enterprise Linux 6.x (or an equivalent distribution):
    sudo service sas-viya-consul-default stop
  • To start SAS Configuration Server on Red Hat Enterprise Linux 7.x (or an equivalent distribution) and SUSE Linux Enterprise Server 12.x:
    sudo systemctl start sas-viya-consul-default
  • To restart SAS Configuration Server on Red Hat Enterprise Linux 6.x (or an equivalent distribution):
    sudo service sas-viya-consul-default restart

Operate (Windows)

Using the Services snap-in in the Microsoft Management Console, you can start, stop, and restart SAS Configuration Server (Consul).

Note: There is one service, SAS Services Manager, that you can use to start and stop all SAS Viya servers and services. SAS Services Manager recognizes the dependencies between services and starts and stops services in the correct sequence. For more information, see Start and Stop All Servers and Services in SAS Viya Administration: General Servers and Services.
SAS Configuration Server in the Services snap-in
SAS Configuration Server in the Services snap-in

Because there is a particular sequence in which the servers and services must be started and stopped, the individual services are not configured to run automatically when the SAS Viya machine is booted.

IMPORTANT SAS Configuration Service (Consul), SAS Infrastructure Data Server (PostgreSQL), SAS HTTP Proxy Server (Apache HTTP Server), and SAS Message Broker (RabbitMQ) are dependencies for the other SAS Viya services. If you are operating one or more services individually, always start each of these four services first and stop them last.
Note: There is one service, SAS Services Manager, that you can use to start and stop all SAS Viya servers and services. SAS Services Manager recognizes the dependencies between services and starts and stops services in the correct sequence. For more information, see Start and Stop All Servers and Services in SAS Viya Administration: General Servers and Services.

Concepts

What Is SAS Configuration Server?

SAS Configuration Server is based on HashiCorp’s Consul. Consul is a distributed, highly available registry that contains service configuration data and availability and overall performance (health) information.

Configuration data resides in SAS Configuration Server as key-value pairs. This data is used by SAS Viya microservices at start-up to load default values and to discover any service dependencies.

During run time, whenever a service’s properties change, the service is notified, and it rereads its properties from SAS Configuration Server. (The exceptions are noted in What Services Must Be Restarted? in SAS Viya Administration: Configuration Properties.)

Each service registers its health checks when it starts. The Monitoring system periodically queries the status of the health checks.

How Does the SAS Configuration Service Work with SAS Configuration Server?

For information about how the SAS Configuration Service works with SAS Configuration Server, see How SAS Viya Configuration Works in SAS Viya Administration: Configuration Properties.

Troubleshooting

The SAS Configuration Server (Consul) logs grow in size due to frequent messages.

Explanation:

The Consul logs grow in size due to frequent messages like the following:

 [WARN] agent.http: This request used the token query parameter which is deprecated and will be removed in a future Consul version: logUrl=/v1/catalog/services?token=<hidden>

With the recent upgrade of Consul from 1.12.6 to 1.17.x, some valid API calls now produce a deprecation warning in the Consul logs. These warnings are causing logs to increase in size and consume disk space at a faster rate than in older versions of Consul.

Resolution:

Run the logrotate service as a cron job at specific intervals. This service attempts to rotate and compress all the log files in the directory, thus reclaiming the disk space. Create the logrotate file as shown:

cat /etc/cron.d/logrotate
*/10  *  *  *  *   root    /sbin/logrotate /etc/logrotate.d/sas-consul-server

cat /etc/logrotate.d/sas-consul-server
/opt/sas/viya/config/var/log/consul/default/*.log {
        missingok
        rotate 5
        size 5M
        compress
	 copytruncate
        delaycompress
        notifempty
        postrotate
        endscript
}

Restart the logrotate service:

systemctl restart logrotate
Note: For Red Hat Enterprise Linux 8.x, restarting the logrotate service is not required.

Here is a typical output:

total 7.6M
drwxr-xr-x. 2 sas sas  146 Jun 13 13:14 .
drwxr-x---. 3 sas sas   21 Jun  5 16:42 ..
-rw-------. 1 sas sas 101K Jun 13 13:14 sas-consul_2024-06-13_09-50-29.log
-rw-------. 1 sas sas  32M Jun 13 13:14 sas-consul_2024-06-13_09-50-29.log.1
-rw-------. 1 sas sas 186K Jun 13 10:20 sas-consul_2024-06-13_09-50-29.log-20240613.gz

Log Files

SAS Configuration Server log files are located in /opt/sas/viya/config/var/log/consul/default.

Last updated: April 14, 2025