Hadoop 使用Hive JDBC驱动程序通过Squirrel连接到Knox
我在运行Ubuntu的计算机上创建了一台VMWare机器。我使用演示LDAP在那里设置了ApacheKnox,目前我正试图通过SQuirreL设置到Knox的连接字符串。我不能使用Hortonworks沙盒,因为我需要使它与Cloudera下的Hive兼容。在开始配置Knox之前,我希望能够首先使用HiveJDBC驱动程序连接到它。以下是我到目前为止掌握的字符串:Hadoop 使用Hive JDBC驱动程序通过Squirrel连接到Knox,hadoop,jdbc,hive,squirrel-sql,knox-gateway,Hadoop,Jdbc,Hive,Squirrel Sql,Knox Gateway,我在运行Ubuntu的计算机上创建了一台VMWare机器。我使用演示LDAP在那里设置了ApacheKnox,目前我正试图通过SQuirreL设置到Knox的连接字符串。我不能使用Hortonworks沙盒,因为我需要使它与Cloudera下的Hive兼容。在开始配置Knox之前,我希望能够首先使用HiveJDBC驱动程序连接到它。以下是我到目前为止掌握的字符串: jdbc:hive2://:8443/;ssl=1;sslTrustStore=/gateway.jks;trustStorePas
jdbc:hive2://:8443/;ssl=1;sslTrustStore=/gateway.jks;trustStorePassword=?hive.server2.transport.mode=http;httpPath=gateway/default/hive
我的具体问题是:
sslTrustStore
应该使用什么路径?它目前位于/home//Downloads/knox-1.0.0/data/security/keystores/gateway.jks
。我试着用同样的线来画完整的路径,但仍然没有成功httpPath
使用什么?我的虚拟机上没有特定的配置单元,因为Knox将使用配置单元连接到Hadoop节点java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: [Cloudera][HiveJDBCDriver](500164) Error initialized or created transport for authentication: \home\anudeep\Downloads\knox-1.0.0\data\security\keystores\gateway.jks (The system cannot find the path specified).
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
你能不使用Knox直接连接到Hive吗?查看堆栈跟踪,似乎找不到密钥库(gateway.jks),这可能是权限问题。尝试在主机上安装Knox。我从VM连接到外部服务(在主机操作系统上运行)时遇到很多问题,但这可能就是我自己。 有几种调试方法,在此之前,让我回答您的问题:
security/keystores/gateway.jks
路径,以便Beeline(或任何JDBC客户机)可以信任Knox提供的证书gateway/sandbox/hive
(您需要更新sandbox.xml
拓扑下的hive服务url)gateway/default/hive
主要由Ambari配置的Knox实例使用,我认为在您的案例中不是这样ssl=true
,并使用冒号(:)代替查询字符串(?)作为transport.mode,即;transportMode=http
beeline -u "jdbc:hive2://<knox-host>:8443/;ssl=true;sslTrustStore=/var/lib/knox/security/keystores/gateway.jks;trustStorePassword=<trustPassword>;transportMode=http;httpPath=gateway/sandbox/hive" -n admin -p admin-password
beeline-u“jdbc:hive2://:8443/;ssl=true;sslTrustStore=/var/lib/knox/security/keystores/gateway.jks;trustStorePassword=;transportMode=http;httpPath=gateway/sandbox/hive”-n admin-p admin password
现在开始一些调试
hive server.xml
具有属性hive.server2.servermode=http
,这会一直困扰我:)