apache phoenfix 能夠幫助你使用sql來操做Hbase API, 及優化。html
參考官網介紹:https://phoenix.apache.org/Phoenix-in-15-minutes-or-less.htmlsql
二、Add the phoenix-[version]-server.jar to the classpath of all HBase region server and master and remove any previous version. An easy way to do this is to copy it into the HBase lib directory (use phoenix-core-[version].jar for Phoenix 3.x) (添加 phoenix-[version]-server.jar到全部的region,master server)
三、Restart HBase. (重啓hbase)
四、Add the phoenix-[version]-client.jar to the classpath of any Phoenix client. ( 添加phoenix-[version]-client.jar到客戶端)
shell
cd bin/ ./sqlline.py 192.168.1.19:2181
CREATE TABLE IF NOT EXISTS us_population ( state CHAR(2) NOT NULL, city VARCHAR NOT NULL, population BIGINT CONSTRAINT my_pk PRIMARY KEY (state, city));
upsert into us_population values('a','b','aa');apache
select * from us_population;
less