This is where the CAS_DISK_CACHE (or Disk Cache) comes in.
The Role of the Disk Cache
The CAS_DISK_CACHE is a temporary storage space on the hard drive of the nodes (workers and controller). CAS uses it to:
"Paging": Offload data blocks from RAM to disk when memory is full (memory mapping).
Replication: Store copies of data blocks for high availability.
If this disk space becomes saturated, it leads to an immediate halt of processes, or even a crash of the CAS session. It is therefore vital to be able to query the status of this cache across the entire cluster.
Note :
Analysis of the Monitoring Code
The CASL (CAS Language) code below allows for auditing the state of this cache. Here is how it works, step by step:
1. Privilege Elevation (accessControl.assumeRole)
By default, a standard user only sees what pertains to their own session. To get an overview of the infrastructure (the physical state of the disks of all nodes), it is often necessary to have administrative rights. The `accessControl.assumeRole / adminRole="superuser";` statement attempts to switch the current user to the "Superuser" role. This allows viewing metrics from all nodes in the cluster, not just the controller.
2. The Action Call (builtins.getCacheInfo)
This is the core of the script. The `getCacheInfo` action from the `builtins` action set queries the underlying file system configured for the cache. It returns crucial information:
proc cas;
/* -------------------------------------------------------------------
OBJECTIF : Auditer l'espace disque du CAS_DISK_CACHE
PRÉREQUIS : Droits suffisants pour assumer le rôle de Superuser
------------------------------------------------------------------- */
/* 1. Tentative de passage en mode Superuser pour une visibilité globale */
/* Note : Si l'utilisateur n'a pas les droits, cette étape peut échouer ou être ignorée */
accessControl.assumeRole / adminRole="superuser";
put "--- ÉTAT DU CAS_CACHE_DISK (Cache Disque) ---";
/* 2. Récupération des métriques de cache pour chaque nœud du cluster */
builtins.getCacheInfo result=cache;
/* 3. Affichage structuré des résultats */
/* Les colonnes typiques sont : Node Name, Path, Free Space, Total Size */
print cache;
run;
/* 1. Tentative de passage en mode Superuser pour une visibilité globale */
8
/* Note : Si l'utilisateur n'a pas les droits, cette étape peut échouer ou être ignorée */
9
ACCESSCONTROL.assumeRole / adminRole="superuser";
10
11
put "--- ÉTAT DU CAS_CACHE_DISK (Cache Disque) ---";
12
13
/* 2. Récupération des métriques de cache pour chaque nœud du cluster */
14
BUILTINS.getCacheInfo RESULT=cache;
15
16
/* 3. Affichage structuré des résultats */
17
/* Les colonnes typiques sont : Node Name, Path, Free Space, Total Size */
18
PRINT cache;
19
RUN;
Wichtiger Haftungsausschluss
Die auf WeAreCAS.eu bereitgestellten Codes und Beispiele dienen Lehrzwecken. Es ist zwingend erforderlich, sie nicht blind in Ihre Produktionsumgebungen zu kopieren. Der beste Ansatz besteht darin, die Logik zu verstehen, bevor sie angewendet wird. Wir empfehlen dringend, diese Skripte in einer Testumgebung (Sandbox/Dev) zu testen. WeAreCAS übernimmt keine Verantwortung für mögliche Auswirkungen oder Datenverluste auf Ihren Systemen.
SAS und alle anderen Produkt- oder Dienstleistungsnamen von SAS Institute Inc. sind eingetragene Marken oder Marken von SAS Institute Inc. in den USA und anderen Ländern. ® zeigt die Registrierung in den USA an. WeAreCAS ist eine unabhängige Community-Site und nicht mit SAS Institute Inc. verbunden.
Diese Website verwendet technische und analytische Cookies, um Ihre Erfahrung zu verbessern.
Mehr erfahren.