Hive scan fails with "Unable to retrieve HS2 host information from ZooKeeper"
Hive scans fail with Unable to retrieve HS2 host information from ZooKeeper
when zookeeper_tls_enabled routes JDBC discovery to the secure ZooKeeper port;
set the property to false in Cloudera Manager so Cloudera Migration Assistant
uses the standard client port.
Symptom
Hive table scan fails with:
HiveScannerException: Connection to Hive using URL jdbc:hive2://<host>:2182/;...;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 failed.
- Exception message: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to retrieve HS2 host information from ZooKeeper
Cause
When zookeeper_tls_enabled is set to true in the
ZooKeeper service configuration, Cloudera Migration Assistant connects to the secure
ZooKeeper client port (default 2182) for HiveServer2 service discovery. The
Hive JDBC driver does not pass the ZooKeeper TLS client parameters needed to negotiate TLS on
that port, which results in a connection failure.
This failure commonly occurs on clusters where ZooKeeper has both
zookeeper_tls_enabled set to true and
zookeeper_client_portUnification set to true. With port
unification enabled, the standard client port (2181) accepts both TLS and
non-TLS connections, so using port 2182 is unnecessary.
