phoenix入门

1. 运行hadoop

2. 运行hbase

3. 下载phonix

4. 拷贝 common/phoenix-3.0.0-incubating-client-minimal.jar 和common/phoenix-core-3.0.0-incubating.jar 到hbase/lib下

5. 重启hbase

6. 测试

xxx@root:~/nutch/phoenix-3.0.0-incubating/bin$ ./psql.py localhost ../examples/WEB_STAT.sql ../examples/WEB_STAT.csv  ../examples/WEB_STAT_QUERIES.sql 
no rows upserted
Time: 1.406 sec(s)

csv columns from database.
CSV Upsert complete. 39 rows upserted
Time: 0.123 sec(s)

DOMAIN     AVERAGE_CPU_USAGE AVERAGE_DB_USAGE 
---------- ----------------- ---------------- 
Salesforce.com           260.727          257.636 
Google.com           212.875           213.75 
Apple.com            114.111          119.556 
Time: 0.088 sec(s)

DAY                 TOTAL_CPU_USAGE MIN_CPU_USAGE MAX_CPU_USAGE 
------------------- --------------- ------------- ------------- 
2013-01-01 00:00:00              35            35            35 
2013-01-02 00:00:00             150            25           125 
2013-01-03 00:00:00              88            88            88 
2013-01-04 00:00:00              26             3            23 
2013-01-05 00:00:00             550            75           475 
2013-01-06 00:00:00              12            12            12 
2013-01-08 00:00:00             345           345           345 
2013-01-09 00:00:00             390            35           355 
2013-01-10 00:00:00             345           345           345 
2013-01-11 00:00:00             335           335           335 
2013-01-12 00:00:00               5             5             5 
2013-01-13 00:00:00             355           355           355 
2013-01-14 00:00:00               5             5             5 
2013-01-15 00:00:00             720            65           655 
2013-01-16 00:00:00             785           785           785 
2013-01-17 00:00:00            1590           355          1235 
Time: 0.044 sec(s)

HOST TOTAL_ACTIVE_VISITORS 
---- --------------------- 
EU                     150 
NA                       1 
Time: 0.047 sec(s)

::

./sqlline.py localhost
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:localhost none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:localhost
Connected to: Phoenix (version 3.0)
Driver: org.apache.phoenix.jdbc.PhoenixDriver (version 3.0)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true to skip)...
60/60 (100%) Done
Done
sqlline version 1.1.2

0: jdbc:phoenix:localhost> select * from WEB_STAT;
+------+------------+------------+---------------------+------------+------------+----------------+
| HOST |   DOMAIN   |  FEATURE   |        DATE         |    CORE    |     DB     | ACTIVE_VISITOR |
+------+------------+------------+---------------------+------------+------------+----------------+
| EU   | Apple.com  | Mac        | 2013-01-01          | 35         | 22         | 34             |
| EU   | Apple.com  | Store      | 2013-01-03          | 345        | 722        | 170            |
| EU   | Google.com | Analytics  | 2013-01-13          | 25         | 2          | 6              |
| EU   | Google.com | Search     | 2013-01-09          | 395        | 922        | 190            |

hbase:

hbase(main):004:0> list
TABLE                                                                                                                                                                            
SYSTEM.CATALOG                                                                                                                                                                   
SYSTEM.SEQUENCE                                                                                                                                                                  
WEB_STAT                                                                                                                                                                         
hbase_hive                                                                                                                                                                       
4 row(s) in 0.0440 seconds

初步测试成功。



你可能感兴趣的:(phoenix,phoenix)