In Part 1, we introduced the concept of elasticity as it applies to CAS. Now, let's explore the setup and demonstrate how table rebalancing operates.
Enabling table rebalancing is only necessary when adding more workers or when a failed worker node is restarted.
For a detailed setup guide, Gilles provides step-by-step instructions in his post.
To activate table rebalancing, set the following environment variables to "true" in CAS:
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Indeed, you may choose to apply rebalancing only to global tables, as session tables may not always need it.
These variables unlock the rebalancing feature, but additional configuration is required to specify which tables should be rebalanced.
Now, SAS Administrators or Programmers must designate which tables are eligible for rebalancing when more workers are added. This is controlled by the tableRedistUpPolicy option, which has two settings:
You can set tableRedistUpPolicy at various levels, depending on whether you need a global or table-specific configuration. Here’s the order of precedence:
Order of precedence | Option | Scope | Example |
1 | tableRedistUpPolicy CAS action casout option | Table | proc cas ; simple.freq / table={caslib="DM", name="prdsale"}, inputs={"country"}, casOut={caslib="DM", name="country_freq", tableRedistUpPolicy="REBALANCE"} ; quit ; |
2 | tableRedistUpPolicy CASLIB option | CASLIB | caslib DM datasource=(srctype="path") path="/gelcontent/" tableRedistUpPolicy=REBALANCE ; |
3 | sessionTableRedistUpPolicy CAS session option | Session table in a CAS session | cas mysession sessopts=(sessionTableRedistUpPolicy=rebalance) ; |
4 | cas.TABLEREDISTUPPOLICY CAS option | CAS server | cas.TABLEREDISTUPPOLICY = ‘REBALANCE’ |
Let’s explore how CAS table rebalancing affects each of our four scenarios. Watch the videos below to see rebalancing in action.
When a SAS Administrator adds one or more new CAS workers to handle a surge in activity.
When a SAS Administrator removes one or more CAS workers to scale back to normal resource levels.
When a CAS worker fails (node failure), and Kubernetes automatically restarts a new one to maintain the right number of workers.
When a CAS worker fails, but Kubernetes is unable to restart a replacement within 60 seconds, triggering rebalancing on the remaining nodes.
That's it for this one. In the final part, we will cover additional considerations regarding CAS table rebalancing.
Thanks for reading!
Find more articles from SAS Global Enablement and Learning here.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.