http://phoenix.apache.org/Phoenix-in-15-minutes-or-less.html

Blah, blah, blah - I just want to get started!
Ok, great! Just follow our install instructions:

  • //下载然后解压
  • download and expand our installation tar
  • 复制phoenix-4.9.0-HBase-1.2-server.jar 到region server所在节点的hbase/lib目录下,如果配置了backup-master name master节点也要复制一份.
  • copy the phoenix server jar that is compatible with your HBase installation into the lib directory of every region server
  • 重启 region servers,或者三台都重启
  • restart the region servers
  • //暂时没有做,sqlline.py  mini1:2181  (zk)  如果连上了就成功了
  • add the phoenix client jar to the classpath of your HBase client
  • download and setup SQuirrel as your SQL client so you can issue adhoc SQL against your HBase cluster

I don’t want to download and setup anything else!
Ok, fair enough - you can create your own SQL scripts and execute them using our command line tool instead. Let’s walk through an example now. Begin by navigating to the bin/directory of your Phoenix install location.

  • First, let’s create a us_population.sql file, containing a table definition:
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));
  • Now let’s create a us_population.csv file containing some data to put in that table:
NY,New York,8143197
CA,Los Angeles,3844829
IL,Chicago,2842518
TX,Houston,2016582
PA,Philadelphia,1463281
AZ,Phoenix,1461575
TX,San Antonio,1256509
CA,San Diego,1255540
TX,Dallas,1213825
CA,San Jose,912332
  • And finally, let’s create a us_population_queries.sql file containing a query we’d like to run on that data.
SELECT state as "State",count(city) as "City Count",sum(population) as "Population Sum"
FROM us_population
GROUP BY state
ORDER BY sum(population) DESC;
  • Execute the following command from a command terminal
./psql.py <your_zookeeper_quorum> us_population.sql us_population.csv us_population_queries.sql

Congratulations! You’ve just created your first Phoenix table, inserted data into it, and executed an aggregate query with just a few lines of code in 15 minutes or less!

Big deal - 10 rows! What else you got?
Ok, ok - tough crowd. Check out our bin/performance.py script to create as many rows as you want, for any schema you come up with, and run timed queries against it.

Why is it called Phoenix anyway? Did some other project crash and burn and this is the next generation?
I’m sorry, but we’re out of time and space, so we’ll have to answer that next time!

phoenix 入门的更多相关文章

  1. boost 的函数式编程库 Phoenix入门学习

    这篇文章是我学习boost phoenix的总结. 序言 Phoenix是一个C++的函数式编程(function programming)库.Phoenix的函数式编程是构建在函数对象上的.因此,了 ...

  2. Phoenix入门到实战(一)

      问题导读1.你认为Apache Phoenix与HBase的关系是什么?2.Phoenix安装需要哪些软件?3.如何部署Phoenix? Introduction Apache Phoenix i ...

  3. Apache Phoenix系列 | 从入门到精通(转载)

    原文地址:https://cloud.tencent.com/developer/article/1498057 来源: 云栖社区 作者: 瑾谦 By 大数据技术与架构 文章简介:Phoenix是一个 ...

  4. phoenix从入门到精通

      第一章.phoenix入门简介 1. Phoenix定义 Phoenix最早是saleforce的一个开源项目,后来成为Apache基金的顶级项目. Phoenix是构建在HBase上的一个SQL ...

  5. Phoenix核心功能原理及应用场景介绍以及Calcite 查询计划生成框架介绍

    Phoenix是一个开源的HBase SQL层.它不仅可以使用标准的JDBC API替代HBase Client API创建表,插入和查询HBase,也支持二级索引.事物以及多种SQL层优化. 此系列 ...

  6. 企业打开云HBase的正确方式,来自阿里云云数据库团队的解读

    一.HBase的历史由来 HBase是一个开源的非关系型分布式数据库(NoSQL),基于谷歌的BigTable建模,是一个高可靠性.高性能.高伸缩的分布式存储系统,使用HBase技术可在廉价PC Se ...

  7. BigData NoSQL —— ApsaraDB HBase数据存储与分析平台概览

    一.引言 时间到了2019年,数据库也发展到了一个新的拐点,有三个明显的趋势: 越来越多的数据库会做云原生(CloudNative),会不断利用新的硬件及云本身的优势打造CloudNative数据库, ...

  8. HBase+Phoenix整合入门--集群搭建

    环境:CentOS 6.6 64位    hbase 1.1.15  phoenix-4.7.0-HBase-1.1 一.前置环境: 已经安装配置好Hadoop 2.6和jdk 1.7 二.安装hba ...

  9. [Phoenix] 一、快速入门

    Phoenix是一个开源的HBASE SQL层.Phoeinx可以用标准的JDBC API替代HBASE client API来创建表,插入和查询HBASE中的数据. Phoenix作为应用层和HBA ...

随机推荐

  1. 字符串转成整型(int)

    1 题目 Implement atoito convert a string to an integer. Hint: Carefullyconsider all possible input cas ...

  2. myeclipse发布项目到tomcat时项目名称与web应用名称不一致问题

    工程名称原来为old,发布到tomcat webapps下后为old, 右键点击你的项目,然后选择重构---->重命名,项目名称改为new,但是发布名还是原来的名字.如果想让发布后的目录名为ne ...

  3. python 3 爬取百度图片

    python 3 爬取百度图片 学习了:https://blog.csdn.net/X_JS612/article/details/78149627

  4. [Functional Programming] Write simple Semigroups type

    An introduction to concatting items via the formal Semi-group interface. Semi-groups are simply a ty ...

  5. 使用javascript开发的视差滚动效果的云彩

    在线演示 jquery.parallax.js是一款能够帮助你快速开发视差效果的jQuery插件,在这里我们使用它来开发一款漂亮的云朵视差效果. 主要代码: Javascript ........ 阅 ...

  6. PHPNOW如何添加虚拟主机

    1 打开PHPNow控制面板,输入0,点回车 2 新增主机名称(你可以输入127.0.0.2到127.0.0.255),点击回车之后要求输入主机别名,不要写,直接回车,再要求输入网站目录,也不选,再回 ...

  7. HTTP请求头 If-Modified-Since

    来自:http://www.jm47.com/g/91174.htm 一直以来没有留意过HTTP请求头的IMS(If-Modified-Since)标签. 最近在分析Squid的access.log日 ...

  8. PHP-"php://(类型)"访问各个输入/输出流以及全局变量$HTTP_RAW_POST_DATA讲解

    $_POST $HTTP_RAW_POST_DATA php://input 先来讲以上三者的区别: $_POST:以关联数组方式组织提交的数据, 并对原数据进行编码处理(urldecode)和编码转 ...

  9. nodejs升级

    命令如下: sudo npm install n -g 然后就可以使用n命令: sudo n 0.12.2 这个命令是将nodejs升级到0.12.2版本. sudo n stable 这个命令是升级 ...

  10. FFmpeg 如何探测网络流格式/如何从内存中获取数据

    文章转自:http://blog.csdn.net/rootusers/article/details/42551935 一般ffmpeg都是直接从文件中读取或者从网络流中读取,比如rtp://xx. ...