apache phoenix 安装试用
生活随笔
收集整理的這篇文章主要介紹了
apache phoenix 安装试用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
備注: 本次安裝是在hbase docker 鏡像的基礎上配置的,主要是為了方便學習,而hbase搭建有覺得 有點費事,用鏡像簡單。 1. hbase 鏡像 docker pull harisekhon/hbase 2. 啟動hbase? docker run -d -p 2181:2181 -p 8080:8080 -p 8085:8085 -p 9090:9090 -p 9095:9095 -p 16000:16000 -p 16010:16010 -p 16201:16201 -p 16301:16301 harisekhon/hbase 3. 測試hbase docker exec -it {hbasedocker-id} sh
hbase shell// 看到下面的就是啟動成功了2017-12-11 05:15:10,909 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.3.1, r930b9a55528fe45d8edce7af42fef2d35e77677a, Thu Apr 6 19:36:54 PDT 2017// 創建表
create 'users','user_id','user_name','user_age' 4. 集成apache phoenix 因為hbase 的鏡像是使用alpine linux 版本,默認已經安裝了wget 等一些工具,但是沒有python
安裝apache phoenix 需要準備 phoenix 以及python
1. apache phoenixwget http://apache.osuosl.org/phoenix/apache-phoenix-4.13.1-HBase-1.3/bin/apache-phoenix-4.13.1-HBase-1.3-bin.tar.gz
2. python
apk add --no-cache python
3. 按照官方介紹copy phoenix server 到hbase 的lib 目錄tar xvf apache-phoenix-4.13.1-HBase-1.3-bin.tar.gzcd cd apache-phoenix-4.13.1-HBase-1.3-bin/cp phoenix-4.13.1-HBase-1.3-server.jar /hbase/lib/
4. 重啟hbase server cd hbase./stop-hbase.sh./start-hbase.sh 5. apache phoenix 試用 a. 連接
cd /apache-phoenix-4.13.1-HBase-1.3-bin/bin
./sqlline.pyb. crud// 創建表create table userinfo(name varchar,age integer not null primary key);// 添加數據 upsert into 更新是一樣的upser into userinfo(name,age) values("dalong",1);// select select * from userinfo; --- where
+---------+------+
| NAME | AGE |
+---------+------+
| dalong | 1 |
+---------+------+// delete delete from userinfo where age=1// 修改表結構alter table userinfo add version varcharalter table userinfo drop COLUMN version
+---------+------+----------+
| NAME | AGE | VERSION |
+---------+------+----------+
| dalong | 1 | |
+---------+------+----------+ 6. 客戶端工具 1. phoenix 自帶的
2. SQuirrel
參考文檔:
http://phoenix.apache.org/installation.html#SQL_Client 7. 參考資料 http://phoenix.apache.org/Phoenix-in-15-minutes-or-less.html
https://hub.docker.com/r/harisekhon/hbase/
總結
以上是生活随笔為你收集整理的apache phoenix 安装试用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: urllib的实现---cookie处理
- 下一篇: 种草莓【字符串】【动态规划】