BookmarkSubscribeRSS Feed

Understanding Network Binding Variables in SAS Viya 3.5

Started ‎02-24-2020 by
Modified ‎02-24-2020 by
Views 8,293

SAS Viya 3.5 introduces an entirely new approach to configuring network communication. There are several new configuration directives to become familiar with. One part to achieving that is understanding how the various terms all relate to one another. In particular, the configuration directives that identify which network bindings the Viya software should use have an interesting chain of dependencies and assumptions.

 

This post will dive into the details specific to the BIND parameters, explaining how they relate one to another, and offering suggestions on configuration for different deployment scenarios.

Where

The network configurations for SAS Viya 3.5 are presented in two places:

  • On the Ansible controller in: .../sas_viya_playbook/host_vars/<deploytarget>.yml This file is processed at install time when the site.yml play is run. Specifying these values is optional for single NIC hosts and required for multi-NIC hosts. Each deploy target defined in the Ansible inventory file of the sas_viya_playbook should have its own YAML file here, if needed.

     

    On the Ansible Controller host, you manually create the network configuration files for each deploy target in the host_vars subdirectory. Here's one of mine from a recent installation for a deploy target with hostname alias "sasviya01":

     

    $ cat /path/to/sas_viya_playbook/host_vars/sasviya01.yml
    ---
    network_conf:
      SAS_HOSTNAME: sasviya01.race.sas.com
      SAS_BIND_ADDR_IF: "eth0"
    
    

     

  • On each Viya host in: /opt/sas/viya/config/network.conf This file is created on each host of the Viya deployment with the values provided by associated the host_vars file. And this file is read each time Viya services start up on this host.

     

    Shown here is the file created for my "sasviya01" deploy target on its host machine:

     

    $ cat /opt/sas/viya/config/network.conf
    # BEGIN Ansible managed network configuration options
    export SAS_HOSTNAME="sasviya01.race.sas.com"
    export SAS_BIND_ADDR_IF="eth0"
    
    

Notice that the files in the host_vars subdirectory are provided in YAML format, but that the resulting network.conf files on each Viya host are in shell syntax.

What

One of the key objectives of revamping how network configuration works in Viya 3.5 is to provide a set of reference variables that all of the Viya software services can rely on identically.

 

Of those, the first two you should know about are:

  • SAS_HOSTNAME
    The hostname used to advertise how Viya services on this machine should be identified and contacted. It should resolve in DNS (or elsewhere) to the same IP address as SAS_BIND_ADDR. If not specified, default value is set equivalent to calling "hostname --fqdn".
  • SAS_BIND_ADDR
    The IP address used for identifying and contacting Viya services on this machine. If not specified, default value is 0.0.0.0 (meaning listen on all network interfaces).

Notice that both of these have self-determining default values. So specifying these configuration directives is optional for host machines with a single network interface. If your machine has more than one network interface (a.k.a. multiple NICs or multi-NIC), then the SAS Configuration Server requires you to identify which network interface it should bind to for communication (it will not allow 0.0.0.0 as an acceptable value).

 

Making the choice and specifying a particular network interface has consequences to consider. The values of those two configuration parameters are referred to by almost all Viya 3.5 services (or they should be) through internal SAS function calls. This means that your choice of SAS_BIND_ADDR will affect not just SAS Configuration Server, but the rest of the Viya software, too - everything will listen on that one specified network interface, unless…

 

…you also set these two configuration parameters as well:

  • SAS_EXTERNAL_HOSTNAME
    The hostname used to advertise how public Viya services on this machine should be identified and contacted. It should resolve in DNS (or elsewhere) to the same IP address as SAS_EXTERNAL_BIND_ADDR. If not specified, default value is set to SAS_HOSTNAME.
  • SAS_EXTERNAL_BIND_ADDR
    The IP address used for identifying and contacting public Viya services on this machine. If not specified, default value is set to SAS_BIND_ADDR.

Be careful with your interpretation of "external" here. It doesn't mean "alternative" or "outside". It's only used by a small, select set of Viya services which present public-facing interfaces. Think of this in comparison to the majority of Viya services communication which is private - not directly shared with any end-user client. For example, the CAS Controller provides a public interface which listens for end-user clients on port 5570 (by default) and is bound to the network specified by SAS_EXTERNAL_BIND_ADDR, but it communicates with the CAS workers extensively through a different internal set of interfaces which are configured by SAS_BIND_ADDR instead.

 

There's a secondary tier of configuration values which can be specified. These directives are used to deterministically derive and set the value for SAS_BIND_ADDR based on dynamic criteria of your network infrastructure:

  • SAS_BIND_ADDR_IF
    The name of the network interface that Viya services should bind to. If provided, SAS_BIND_ADDR will be set to the first primary IP address found for that network. If SAS_BIND_ADDR is also defined with a value, then this directive is ignored.
  • SAS_BIND_ADDR_CIDR
    The range of IP addresses to choose from in CIDR notation. If provided, SAS_BIND_ADDR will be set to the first primary IP address found in that range. If SAS_BIND_ADDR or SAS_BIND_ADDR_IF is also defined with a value, then this directive is ignored.

Notice in terms of precedence that specifying a value for SAS_BIND_ADDR overrides SAS_BIND_ADDR_IF and that SAS_BIND_ADDR_IF will override SAS_BIND_ADDR_CIDR due to specificity. My recommendation is only to set the directive you intend to use to avoid any confusion.

 

These same secondary parameters are also available for _EXTERNAL_ as well.

How

To show this all as a simple set of rules, take a look at the following pseudocode to see how Viya services will determine which hostname and IP to use in their communications and registration:

 

For Viya to determine the SAS_HOSTNAME value:

if SAS_HOSTNAME is set in network.conf, then use it
else use `hostname --fqdn`

For Viya to determine the SAS_EXTERNAL_HOSTNAME value:

if SAS_EXTERNAL_HOSTNAME is set in network.conf, then use it
else use SAS_HOSTNAME value

For Viya to determine the SAS_BIND_ADDR value:

if SAS_BIND_ADDR is set in network.conf, then use it
else if SAS_BIND_ADDR_IF is set in network.conf, then use it
else if SAS_BIND_ADDR_CIDR is set in network.conf, then use it
else use 0.0.0.0

For Viya to determine the SAS_EXTERNAL_BIND_ADDR value:

if SAS_EXTERNAL_BIND_ADDR is set in network.conf, then use it
else if SAS_EXTERNAL_ BIND_ADDR_IF is set in network.conf, then use it
else if SAS_EXTERNAL_BIND_ADDR_CIDR is set in network.conf, then use it
else use SAS_BIND_ADDR value

Why

There really is no one right way to configure the network that will work for all circumstances. You must evaluate the requirements of a given environment and adjust. With that out of the way, I usually start off with the following and then modify my approach as needed:

  1. Avoid setting an explicit value for SAS_BIND_ADDR
    Defining SAS_BIND_ADDR directly will lock Viya down to static IP address assignment. While that's consistent with the current system requirements, we're optimistic that the new network.conf capabilities will soon allow support of dynamic IP address assignment.
  2. Use SAS_BIND_ADDR_IF instead
    This directive will cause Viya to look up the specified network interface name and automatically assign SAS_BIND_ADDR to the first primary IP address it finds there. Your host can still have static IP address assignment. But if/when Viya supports dynamic IP address assignment, then you've no changes to make.
  3. Consider SAS_EXTERNAL_BIND_ADDR (and _IF and _CIDR)
    If SAS_BIND_ADDR resolves to a subnet that the Viya end users do not have access to, then ensure that the public interfaces (like CAS port 5570) are reachable by specifying a network interface on this host which is accessible to end users.

    Pro-tip: consider SAS_EXTERNAL_BIND_ADDR=0.0.0.0 to direct the Viya public services to listen on all of this host's network interfaces if that makes sense for your environment.

I could go on and on. As you can tell, I'm excited by the new possibilities afforded to this huge upgrade to network identification in Viya. I hope this post helps guide your understanding how the network.conf file is processed when Viya services are installed and started.

More

Refer to the the SAS documentation for more information about networking configuration in Viya 3.5: 

Version history
Last update:
‎02-24-2020 03:10 PM
Updated by:
Contributors

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags