累吗?累就对了,舒服是留给死人的...

.....说人好比盆中鲜花,生活就是一团乱麻,房屋修的再好那只是个临时住所,这个小盒才是你永久的家呀!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

全网最详细Apache Kylin1.5安装(单节点)和测试案例

Posted on 2016-08-17 10:37  Aaron-Mhs  阅读(2073)  评论(0编辑  收藏  举报

转:http://blog.itpub.net/30089851/viewspace-2121221/

微视频链接Apache Kylin初识  
  
  
1.版本(当前实验版本组合,版本一定要兼容,否则各种问题)
Hadoop2.7.2+HBase1.1.5+Hive2.0.0
kylin-1.5.2.1    (apache-kylin-1.5.1-HBase1.1.3-bin.tar.gz)

2.Hadoop环境编译以支持Snappy解压缩库
重新编译hadoop-2.7.2-src的native以支持Snappy解压压缩库

3.环境准备
Hadoop-2.7.2+zookeeper-3.4.6完全分布式环境搭建(HDFS、YARN HA)
Hadoop2.7实战v1.0之HBase1.1.5 HA分布式搭建  
配置Hadoop2.7.2和Hbase1.1.5支持Snappy解压压缩库

Hadoop2.7实战v1.0之Hive-2.0.0+MySQL本地模式安装
  
4. 配置Hadoop2.7.2和Hbase1.1.5支持Snappy解压压缩库

5. 主机规划
IP                Host                    安装软件                 进程
172.16.101.55 sht-sgmhadoopnn-01   apache-kylin-1.5.1-HBase1.1.3-bin.tar.gz RunJar
  
6. 添加hive_dependency和KYLIN_HOME环境变量

点击(此处)折叠或打开

  1. [root@sht-sgmhadoopnn-01 ~]# vi /etc/profile
  2. export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
  3. export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
  4. export HADOOP_HOME=/hadoop/hadoop
  5. export HBASE_HOME=/hadoop/hbase
  6. export ZOOKEEPER_HOME=/hadoop/zookeeper 
  7. export HIVE_HOME=/hadoop/hive
  8. export hive_dependency=/hadoop/hive/conf:/hadoop/hive/lib/*:/hadoop/hive/hcatalog/share/hcatalog/hive-hcatalog-core-2.0.0.jar 
  9. export KYLIN_HOME=/hadoop/kylin 
  10. export PATH=.:$HADOOP_HOME/bin:$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin:$HIVE_HOME/bin:$KYLIN_HOME/bin:$PATH 
  11. "/etc/profile" 99L, 2592C written
  12.  [root@sht-sgmhadoopnn-01 ~]# source /etc/profile

 

7.同步/etc/profile到集群其他节点,生效


8.下载安装配置kylin

点击(此处)折叠或打开

  1. # 在sht-sgmhadoopnn-01上执行以下命令 
  2. [root@sht-sgmhadoopnn-01 ~]# cd /hadoop
  3. [root@sht-sgmhadoopnn-01 hadoop]# wget https://dist.apache.org/repos/dist/release/kylin/apache-kylin-1.5.2.1/apache-kylin-1.5.2.1-HBase1.x-bin.tar.gz
  4. [root@sht-sgmhadoopnn-01 hadoop]# tar -zxvf apache-kylin-1.5.1-HBase1.1.3-bin.tar.gz 
  5. [root@sht-sgmhadoopnn-01 hadoop]# ln -s /hadoop/apache-kylin-1.5.2.1-bin /hadoop/kylin
  6.  [root@sht-sgmhadoopnn-01 hadoop]# vi /hadoop/kylin/bin/kylin.sh
  7. export KYLIN_HOME=/hadoop/kylin # 改成绝对路径
  8. export HBASE_CLASSPATH_PREFIX=${tomcat_root}/bin/bootstrap.jar:${tomcat_root}/bin/tomcat-juli.jar:${tomcat_root}/lib/*:$hive_dependency:$HBASE_CLASSPATH_PREFIX #在路径中添加$hive_dependency


9.修改kylin.properties

点击(此处)折叠或打开

  1. [root@sht-sgmhadoopnn-01 conf]# vi $KYLIN_HOME/conf/kylin.properties
  2. ######修改
  3. # List of web servers in use, this enables one web server instance to sync up with other servers.
  4. kylin.rest.servers=sht-sgmhadoopnn-01:7070
  5. ######新增
  6. kylin.job.jar=$KYLIN_HOME/lib/kylin-job-1.5.2.1.jar
  7. kylin.coprocessor.local.jar=$KYLIN_HOME /lib/kylin-coprocessor-1.5.2.1.jar

10.启动kylin
[root@sht-sgmhadoopnn-01 kylin]#  $KYLIN_HOME/bin/kylin.sh  start
.........
.........
KYLIN_DEBUG_SETTINGS is not set, will not enable remote debuging
KYLIN_LD_LIBRARY_SETTINGS is not set, Usually it's okay unless you want to specify your own native path
A new Kylin instance is started by root, stop it using "kylin.sh stop"
Please visit <a href="http://http://:7070/kylin

You can check the log at<span "=""> /hadoop/kylin/logs/kylin.log<a href="http://http://:7070/kylin

You can check the log at<span "="">

 

###http://172.16.101.55:7070/kylin   账号: ADMIN    密码:KYLIN

11.检查kylin是否启动成功

点击(此处)折叠或打开

  1. [root@sht-sgmhadoopnn-01 kylin]# netstat -nlp |grep 7070
  2.  tcp 0 0 0.0.0.0:7070 0.0.0.0:* LISTEN 30939/java 
  3.   [root@sht-sgmhadoopnn-01 kylin]#

12.导入官网测试案例

点击(此处)折叠或打开

  1. [root@sht-sgmhadoopnn-01 kylin]# $KYLIN_HOME/bin/kylin.sh stop
  2.  [root@sht-sgmhadoopnn-01 kylin]# $KYLIN_HOME/bin/sample.sh
  3.  [root@sht-sgmhadoopnn-01 kylin]# $KYLIN_HOME/bin/kylin.sh start


1>.选中'kylin_sales_cube'示例立方体,点击'Actions'->'Build',选择一个截止日期,本试验中选择的是'2016-01-10'
(具体小时,分,秒随便选,因为最终hive sql的语句类似     WHERE (KYLIN_SALES.PART_DT >= '2012-01-01' AND KYLIN_SALES.PART_DT < '2016-01-10');)

 

2>.在'Monitor'标签中通过刷新页面检查进度条,直到100%

 

3>.在'Insight'标签中执行下面的SQL查询:
select part_dt, sum(price) as total_selled, count(distinct seller_id) as sellers from kylin_sales group by part_dt order by part_dt;
###耗时2.87s
4>.在hive中执行同一个SQL查询,验证kylin的查询结果(会开启MapReduce Job计算)
###耗时65.205s
查询执行和结果如图所示

Build成功后,hive中建立了3+n个表,如图所示(3个官网案例hive表,n个build的hive表)

Build成功后,hbase中建立了1+n个表,如图所示(1个元数据表,n个build的hbase表)