【问题标题】:Connect spark with BI tools like power bi and tableau将 spark 与 power bi 和 tableau 等 BI 工具连接起来
【发布时间】:2016-11-26 07:32:21
【问题描述】:

我需要将 spark 与 powerbi 连接。我不知道相同的所需驱动程序。而且我在本地模式下运行 spark 而没有安装 apache hive。所以我没有用于配置节俭服务器的 hive-site.xml 文件。启动 thrift 服务器后,我启动 $SPARK_HOME\bin\beeline.cmd 并使用命令!connect jdbc:hive2://localhost:10000 连接 thrift 服务器,并使用用户 ID 作为管理员(与我的本地计算机相同)和空白密码,输出为:

beeline> !connect jdbc:hive2://localhost:10000
Connecting to jdbc:hive2://localhost:10000
Enter username for jdbc:hive2://localhost:10000: Administrator
Enter password for jdbc:hive2://localhost:10000:
log4j:WARN No appenders could be found for logger (org.apache.hive.jdbc.Utils).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Connected to: Spark SQL (version 2.0.1)
Driver: Hive JDBC (version 1.2.1.spark2)
Transaction isolation: TRANSACTION_REPEATABLE_READ

似乎建立了连接,但是当使用命令查询数据库时:show databases;,它显示错误(直线):

Error: org.apache.thrift.transport.TTransportException: java.net.SocketException: Software caused connection abort: socket write error (state=08S01,code=0)` and error(in thrift server cmd):`Exception in thread "HiveServer2-Handler-Pool: Thread-XXX"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "HiveServer2-Handler-Pool: Thread-XXX"

我不明白这个错误。请帮助我,并且我想将它与安装在本地计算机上的 powerbi desktop 连接。有人可以提供一些链接以供阅读以建立连接吗?

【问题讨论】:

    标签: apache-spark apache-spark-sql tableau-api powerbi beeline


    【解决方案1】:

    @Birla,它看起来像问题here 中提到的 TCP 错误。

    不建议在本地机器上使用 Thrift,因为 Thrift 服务器需要使用专门的 Metastore 服务器进行很好的处理来处理身份验证和并行性。

    推荐:安装 Horton Works/Cloudera 准备工作的 VM,然后从 Power BI 访问这些。

    【讨论】:

    • 感谢您的回复。我现在只是在测试连接。完成后,我将使用专用元存储服务器在集群模式下工作。我无法确定错误的确切补救措施。您能否对解决方案更具体一些。
    • @JustCoder ...我也对是否使用 hive-site.xml 感到困惑。如果我不使用它,那么我的凭据是什么,我的 spark-warehouse 目录将是什么,将在我的 BI 工具中访问?
    • 默认情况下,spark 使用此文件夹 /usr/hive/warehouse/ 进行所有与 hive 相关的查询,并使用 /usr/hive/warehouse/records 存储稍后将查询的文件。建议将 hive-ste.xml 设置为本地存储作为文件系统,单进程模式执行。
    • @JustCoder。 Power BI 使用http://example.com:10000/cliservice 作为服务器的示例。 10000是默认的Hive thrift服务器端口,可以用于http吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-13
    • 1970-01-01
    相关资源
    最近更新 更多