我正在尝试使用Phoenix将R连接到Hadoop,但出现以下错误:
.jcall(drv @ jdrv,“ Ljava / sql / Connection;”,“ connect”, as.character(url)[1] ,: java.sql.SQLException: java.lang.IllegalArgumentException:无法获取Kerberos领域
下面您可以找到我的R代码。任何人都知道如何更正此问题以便能够正确连接吗?
library(RJDBC)
library(rJava)
library(DBI)
Sys.setenv(JAVA_TOOL_OPTIONS="-Djava.security.krb5.conf=/path/to/krb5.conf")
.jinit(,"-Djavax.security.auth.useSubjectCredsOnly=false")
.jaddClassPath(Sys.glob("/path/to/site-xml"))
# this folder contains core-site.xml, hbase-site.xml and hdfs-site.xml
drv <- JDBC("org.apache.phoenix.jdbc.PhoenixDriver",
"/path/to/phoenix-4.4.0.2.3.2.0-2950-client.jar",
identifier.quote = "'"
)
conn <- dbConnect(
drv,
"jdbc:phoenix:IP1,IP2,IP3:2181:/hbase-secure:USER@HADOOP.COM:/path/to/keytab/file.keytab",
"",
""
)
result <- dbGetQuery(conn, "select * from \"TABLE_NAME\"")
print(result)