在
Phoenix
中我们可以使用Phoenix
的sqlline.py进行连接操作,但是界面只是控制台,查看数据很不直观,SQL语句也没有提示,我们如何在IDEA中的database
工具栏中直接连接Phoenix
呢,这就是此文要记录的。
使用教程
保证sqlline-thin.py host
能正常连接phoenix-queryserver
假设phoenix-queryserver
主机在host4.demo.com
主机中
[root@storm2 bin]# ./sqlline-thin.py host4.demo.com SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/bigdata/phoenix/phoenix-5.0.0-HBase-2.0-thin-client.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/3.0.0.0-1634/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.18/08/22 22:24:41 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Setting property: [incremental, false] Setting property: [isolation, TRANSACTION_READ_COMMITTED] issuing: !connect jdbc:phoenix:thin:url=http://host4.demo.com:8765;serialization=PROTOBUF;authentication=SPNEGO none none org.apache.phoenix.queryserver.client.DriverConnecting to jdbc:phoenix:thin:url=http://host4.demo.com:8765;serialization=PROTOBUF;authentication=SPNEGOConnected to: Apache Phoenix (version unknown version) Driver: Phoenix Remote JDBC Driver (version unknown version) Autocommit status: trueTransaction isolation: TRANSACTION_READ_COMMITTED Building list of tables and columns for tab-completion (set fastconnect to true to skip)...192/192 (100%) Done Done sqlline version 1.2.00: jdbc:phoenix:thin:url=http://host4.demo>
IDEA配置database
点击设置图标
点击设置图标
新增左上角加号添加Driver
配置如下
image.png
选择Class:org.apache.phoenix.queryserver.client.Driver
Additional files:添加包 phoenix-5.0.0-HBase-2.0-thin-client.jar
添加URL templates:jdbc:phoenix:thin:url=http://{host::host4.demo.com}:8765;serialization=PROTOBUF;authentication=SPNEGO;principal=hbase@DEMO.COM;keytab=/etc/security/keytabs/hbase.headless.keytab
PS:请根据自己的配置进行修改
点击OK即可进行连接查询
SUCCESS
image.png
作者:dounine
链接:https://www.jianshu.com/p/1a76bbe4a33f
点击查看更多内容
1人点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦