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.
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-defaulton 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-defaulton 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-defaulton all other machines in the deployment, which launches the agent processes for SAS Configuration Server.
- First, start
- If there are multiple
instances of SAS Configuration Server, stop them in this sequence:
- First, stop
sas-viya-consul-defaulton 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-defaulton machines in the[consul]host group.
- First, stop
- 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
systemctlcommand when runningsas-viya-consul-default. Thesystemctlcommand maintains a record of service status that theservicecommand 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 (
servicecommand) with the systemd (systemctlcommand) causes several issues. Thesystemctlcommand knows nothing about a SAS Viya service started with theservicecommand. If you startsas-viya-consul-defaulton RHEL 7.x with theservicecommand, and later attempt to shut down SAS Configuration Server using thesystemctlcommand, 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).
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.
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
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.