SAS Viya and Hadoop: Resolving the TimeoutException Connection Error When Creating a Caslib
Simon 36 Aufrufe
Schwierigkeitsgrad
Débutant
Veröffentlicht am :
Expertenrat
Stéphanie
When facing a Hadoop TimeoutException, don't immediately suspect network latency; the real culprit is often over-configuration. Providing both a JDBC uri= string and configuration files (hadoopconfigdir) creates a conflict in Zookeeper service discovery. The best practice is to simplify: trust your XML files by removing the URI parameter, and only increase the login_timeout if the cluster is genuinely under heavy load.
When executing a CASLIB statement to connect to Hadoop (often via Hive), the process stops and returns the following error messages in the log:
ERROR: The connection to the data source driver failed.
ERROR: General error java.util.concurrent.TimeoutException
ERROR: Function failed.
ERROR: The action stopped due to errors.
This issue typically occurs when using an explicit connection string that includes the uri= option, as in the example below:
/* Code provoquant l'erreur */
caslib hdlib datasource=(
srctype="hadoop",
dataTransferMode="serial",
username="{votre_user}",
password="{votre_mdp}",
/* L'option URI ci-dessous est souvent la cause du conflit */
uri="jdbc:hive2://{host}:2181...;serviceDiscoveryMode=zooKeeper;...",
hadoopjarpath="/sas_mirror/hadoopfiles/lib",
hadoopconfigdir="/sas_mirror/hadoopfiles/conf",
schema="default"
);
1
/* Code provoquant l'erreur */
2
caslib hdlib datasource=(
3
srctype="hadoop",
4
dataTransferMode="serial",
5
username="{votre_user}",
6
password="{votre_mdp}",
7
/* L'option URI ci-dessous est souvent la cause du conflit */
If, after applying the fix above, you still encounter timeout errors (especially on heavily loaded clusters), it is possible that the default timeout is too short.
The default connection timeout for Hadoop is typically 30 seconds. You can increase this value by adding the login_timeout option:
caslib hdlib datasource=(
...
login_timeout=60 /* Augmentation du délai à 60 secondes */
...
);
1
caslib hdlib datasource=(
2
...
3
login_timeout=60/* Augmentation du délai à 60 secondes */
4
...
5
);
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.