SAS Viya and Hadoop: Resolving the TimeoutException Connection Error When Creating a Caslib
Simon 36 vistas
Nivel de dificultad
Débutant
Publicado el :
Consejo del experto
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
);
Aviso importante
Los códigos y ejemplos proporcionados en WeAreCAS.eu son con fines educativos. Es imperativo no copiarlos y pegarlos ciegamente en sus entornos de producción. El mejor enfoque es comprender la lógica antes de aplicarla. Recomendamos encarecidamente probar estos scripts en un entorno de prueba (Sandbox/Dev). WeAreCAS no acepta ninguna responsabilidad por cualquier impacto o pérdida de datos en sus sistemas.
SAS y todos los demás nombres de productos o servicios de SAS Institute Inc. son marcas registradas o marcas comerciales de SAS Institute Inc. en los EE. UU. y otros países. ® indica registro en los EE. UU. WeAreCAS es un sitio comunitario independiente y no está afiliado a SAS Institute Inc.
Este sitio utiliza cookies técnicas y analíticas para mejorar su experiencia.
Saber más.