自行安装好cdh6.3.2集群
★★注意版本兼容问题,楼主开始用的最新的4.X的版本,页面加载hive数据死活出不来,所以改用3.0.2cdh60的版本
1.下载kylin https://archive.apache.org/dist/kylin/apache-kylin-3.0.2/ 到/software目录
cd /software
wget https://archive.apache.org/dist/kylin/apache-kylin-3.0.2/apache-kylin-3.0.2-bin-cdh60.tar.gz
2.解压
tar -zxvf apache-kylin-3.0.2-bin-cdh60.tar.gz
mv apache-kylin-3.0.2-bin-cdh60 /opt/kylin
3.配置环境变量
vim /etc/profile
JAVA_HOME=/usr/java/default
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
HADOOP_HOME=/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hadoop
HIVE_HOME=/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hive
SPARK_HOME=/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/spark
HBASE_HOME=/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase
KYLIN_HOME=/opt/kylin
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$HIVE_HOME/bin:$SPARK_HOME/bin:$KYLIN_HOME/bin:$HADOOP_HOME/bin:$HBASE_HOME/bin
export JAVA_HOME CLASSPATH HIVE_HOME SPARK_HOME KYLIN_HOME HADOOP_HOME HBASE_HOME PATH
使环境变量生效
source /etc/profile
4.在mysql中新建kylin相关信息
mysql -uroot -p123456
CREATE DATABASE kylin DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON kylin.* TO 'kylin'@'%' IDENTIFIED BY '123456';
5.修改kylin配置
kylin.metadata.url=kylin_metadata@jdbc,url=jdbc:mysql://192.168.1.160:3306/kylin,username=kylin,password=123456,maxActive=10,maxIdle=10
kylin.env.hdfs-working-dir=/kylin
kylin.env.zookeeper-base-path=/kylin
kylin.env.zookeeper-is-local=false
kylin.env.zookeeper-connect-string=192.168.1.161:2181
kylin.env.hadoop-conf-dir=/etc/hive/conf
6.下载jar包
cd /opt/kylin/tomcat/webapps/kylin/WEB-INF/lib
wget https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar
wget https://repo1.maven.org/maven2/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar
mkdir -p /opt/kylin/bin/hadoop3_jars/cdh6
cd /opt/kylin/bin/hadoop3_jars/cdh6
wget https://repo1.maven.org/maven2/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar
wget https://cwiki.apache.org/confluence/download/attachments/173081375/hive-exec-1.21.2.3.1.0.0-78.jar?api=v2
##若下载下来的jar包带引号,去掉引号
mv \"hive-exec-1.21.2.3.1.0.0-78.jar\" hive-exec-1.21.2.3.1.0.0-78.jar
7.下载mysql的驱动包,并放到/opt/kylin/ext/目录
mkdir -p /opt/kylin/ext/
cd /opt/kylin/ext/
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.40/mysql-connector-java-5.1.40.jar
8.启动并登录
检查环境配置
$KYLIN_HOME/bin/check-env.sh
启动
$KYLIN_HOME/bin/kylin.sh start
查看日志是否报错
cat /opt/kylin/logs/kylin.log
9.页面访问
http://192.168.1.162:7070/kylin 用户名/密码 ADMIN/KYLIN
1.导入官方测试数据
cd /opt/kylin/bin
./sample.sh
查看Hive default库中的表,多了五张表
2.在页面点击system–> reload metadata
3.点击model–>data source --> load table from free
在弹出的页面选中default下的5张表,点击sync按钮
刷新查看
4.new model
a.填上表名KYLIN_ACCOUNT,下一步
b.下拉选中第一步输入的表名,下一步
c.选择需要的列,下一步
e.默认可不选,save
f.刷新
5.new cube
a.输入model name和cube name,下一步
b.add demensions,按需要选择列,下一步
h.刷新页面
i.编译,点击action–>build
j.等待编译完成
6.可以在insight查询了,速度比在hive快很多