Phoenix与HBase集成进行数据分析
2024-08-29 01:02:46
安装好Phoenix后配置环境变量
export PHOENIX_PATH=/opt/cloudera/parcels/APACHE_PHOENIX-4.14.0-cdh5.14.2.p0.3export PATH=$PATH:$PHOENIX_PATH/bin:
进入命令行,这是sqlline.py 配置到path环境变量的情况下
[root@node1 ~]# phoenix-sqlline.py node3::/hbase 如果要退出命令行:!q 或者 !quit
返回信息
[root@node1 ~]# phoenix-sqlline.py node3::/hbase Setting property: [incremental, false] Setting property: [isolation, TRANSACTION_READ_COMMITTED] issuing: !connect jdbc:phoenix:node3::/hbase none none org.apache.phoenix.jdbc.PhoenixDriver Connecting to jdbc:phoenix:node3::/hbase SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding -cdh5./lib/phoenix/phoenix--cdh5.14.2-client.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding -.cdh5./jars/slf4j-log4j12-.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] // :: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Connected to: Phoenix (version 4.14) Driver: PhoenixEmbeddedDriver (version 4.14) Autocommit status: true Transaction isolation: TRANSACTION_READ_COMMITTED Building list of tables and columns for tab-completion (set fastconnect to true to skip)... / (%) Done Done sqlline version
输入命令
[root@node3 ~]# netstat -ntlp
得到端口号2181对应的PID为29058,且为JVM进程
tcp /java
输入命令
[root@node3 ~]# jps -l
发现PID为29058的进程是zookeeper启动的
org.apache.zookeeper.server.quorum.QuorumPeerMain
显示所有表
: jdbc:phoenix:node3::/hbase> !tables
返回信息
: jdbc:phoenix:node3::/hbase> !tables +------------+--------------+-------------------------+---------------+----------+------------+-------+ | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_NAME | SELF_ | +------------+--------------+-------------------------+---------------+----------+------------+-------+ | | | INDEX1_ITEM_TEST1 | INDEX | | | | | | SYSTEM | CATALOG | SYSTEM TABLE | | | | | | SYSTEM | FUNCTION | SYSTEM TABLE | | | | | | SYSTEM | LOG | SYSTEM TABLE | | | | | | SYSTEM | SEQUENCE | SYSTEM TABLE | | | | | | SYSTEM | STATS | SYSTEM TABLE | | | | | | | ASSET_ALLOT | TABLE | | | | | | | ASSET_BUILDING | TABLE | | | | | | | ASSET_BUILDING_PENDING | TABLE | | | | | | | ASSET_CHECK | TABLE | | | | | | | ASSET_CHECK_PLAN | TABLE | | | | | | | ASSET_CHECK_REPORT | TABLE | | | | | | | ASSET_FINANCIAL_DETAIL | TABLE | | | | | | | ASSET_INVENTORY | TABLE | | | | | | | ASSET_INVENTORY_PLAN | TABLE | | | | | | | ASSET_INVENTORY_REPORT | TABLE | | | | | | | ASSET_ISLAND | TABLE | | | | | | | ASSET_ISLAND_PENDING | TABLE | | | | | | | ASSET_NORMAL | TABLE | | | | | | | ASSET_NORMAL_MOULD | TABLE | | | | | | | ASSET_NORMAL_PENDING | TABLE | | | | | | | ASSET_RECORD | TABLE | | | | | | | ASSET_RENT | TABLE | | | | | | | ASSET_ROOM | TABLE | | | | | | | ASSET_SCRAP | TABLE | | | | | | | ASSET_SEAL | TABLE | | | | | | | ASSET_TAKEAWAY | TABLE | | | | | | | ASSET_UNSEAL | TABLE | | | | | | | ITEM_TEST1 | TABLE | | | | | | | US_POPULATION | TABLE | | | | | | | US_POPULATION1 | TABLE | | | | +------------+--------------+-------------------------+---------------+----------+------------+-------+
从表 ASSET_RECORD 中查询前10条记录
: jdbc:phoenix:node3::/hbase> SELECT * FROM ASSET_RECORD LIMIT ;
返回信息
: jdbc:phoenix:node3::/hbase> SELECT * FROM ASSET_RECORD LIMIT ; +-----------------------------------+-------------------------+-------------------+---------------+---+ | ID | ASSET_ID | MANAGEMENT_TABLE | INTRODUCTION | | +-----------------------------------+-------------------------+-------------------+---------------+---+ | d083250dc0f74c3cb79b6ffe041fa4c3 | 仪6- | ASSET_CHECK | | | +-----------------------------------+-------------------------+-------------------+---------------+---+ row selected (0.066 seconds)
参考:
https://www.cnblogs.com/xiaoliu66007/p/9377922.html
https://www.cnblogs.com/linbingdong/p/5832112.html
最新文章
- ABP源码分析二十三:Authorization
- T-SQL编程练习(带注释)
- PowerDesigner 把Comment复制到name中和把name复制到Comment
- 什么时候该用NoSQL?
- 微课程--Android--基础控件的使用
- Scrum会议1(Beta版本)
- MES系统的有用存储过程
- cocos2d-x调度器原理
- ANDROID_MARS学习笔记_S01_011ProgressBar
- JS选中OPTION
- 如何查看你的 memcached 的状态
- 【BZOJ1483】【链表启发式合并】梦幻布丁
- acdream暴力专场中的优美暴力
- alert()显示中文出现乱码
- Hadoop hdfs上传文件 权限问题
- Linux下文件的mtime/atime/ctime研究
- Java高级特性 第9节 Socket机制
- Windows 7无声音的解决方案
- C#实现多个PDF合并及去除文字水印功能
- vue element-ui 设置时间组件
热门文章
- [运维] 请求 nginx 出现 502 Bad Gateway 的解决方案!
- 「JSOI2014」矩形并
- SpringBoot中普通类无法通过@Autowired自动注入Service、dao等bean解决方法
- 8 HTML DOM 元素的查找与改变&;改变CSS样式&;HTML事件
- c++读取注册表的实例
- 列举出给定数量的字符的所有组成情况-java实现
- 帆软FineReport报表由于使用HTML显示后无法控制行高
- Languages-used-on-the-Internet
- 获取Webshell方法总结
- Derivative Pricing_1_Black