参考:https://blog.csdn.net/eyeofeagle/article/details/88991967
安装环境:cdh5.12.0
kylin:apache-kylin-2.6.2-bin-cdh57.tar.gz
下载:http://www-us.apache.org/dist/kylin/apache-kylin-2.6.2/
1、安装kylin
一、安装前准备
软件版本:
1.apache-kylin-2.6.2-bin-cdh57.tar.gz
2.CDH5.12.0
3.nginx-1.13.7.tar.gz
1、安装nginx依赖包
//一键安装上面四个依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2.下载nginx并解压安装包
//创建一个文件夹
cd /usr/local
mkdir nginx
cd nginx
//下载tar包
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.g
3.安装nginx
//进入nginx目录
cd /usr/local/nginx
//执行命令
./configure
//执行make命令
make
//执行make install命令
make install
4、安装kylin
安装机器:
172.17.20.31 hadoop01 all
172.17.20.32 hadoop02 query
5、集群模式安装
1.在hadoop上解压部署apache-kylin-2.6.2-bin-cdh57.tar.gz
tar zxvf apache-kylin-2.6.2-bin-cdh57.tar.gz
mv apache-kylin-2.6.2-bin-cdh57 /opt/kylin
2.在hadoop01和hadoop02修改配置
export KYLIN_HOME=/opt/kylin-2.6.2-cdh57
export SPARK_HOME=/opt/cloudera/parcels/CDH/lib/spark
export PATH=$PATH:$KYLIN_HOME/bin/:$SPARK_HOME/sbin
使配置生效
source /etc/profile
(2)配置kylin
vi $KYLIN_HOME/conf/kylin.properties
kylin.metadata.url= kylin_metadata@hbase
kylin.server.mode=all // 只能有一个节点是all,其他节点为query
kylin.server.cluster-servers=hadoop01:7070,hadoop02v:7070
(3)配置加载hbase common lib
vi /opt/cloudera/parcels/CDH/lib/hbase/bin/hbase
改
CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
成
CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar:/opt/cloudera/parcels/CDH/lib/hbase/lib/*
3.将/opt/kylin拷贝hadoop02
scp -r /opt/kylin hadoop02:/opt/
4.在hadoop02进行以下操作
(1)修改 /opt/cloudera/parcels/CDH/lib/hbase/bin/hbase
vi /opt/cloudera/parcels/CDH/lib/hbase/bin/hbase
改
CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
成
CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar:/opt/cloudera/parcels/CDH/lib/hbase/lib/*
(2)修改kylin的配置
vi $KYLIN_HOME/conf/kylin.properties
kylin.server.mode=query
(3)在$spark_home下新家jars目录(hadoop01和hadoop2上)
mkdir $SPARK_HOME/jars/
cp $SPARK_HOME/assembly/lib/*.jar $SPARK_HOME/jars/)
5.在hadoop02上的nginx配置
upstream kylin-cluster {
ip_hash;
server 172.17.20.31:7070 max_fails=2 fail_timeout=5s;
server 172.17.20.32:7070 max_fails=2 fail_timeout=5s;
}
server {
listen 7001;
server_name 172.20.20.32;
#default_type 'text/html';
charset utf-8;
access_log /data/logs/kylin/kylin_nginx.log main;
location / {
proxy_pass http://kylin-cluster;
proxy_redirect default;
proxy_connect_timeout 60s;
proxy_send_timeout 1800s;
proxy_read_timeout 1800s;
proxy_ignore_client_abort on;
}
}
(3)reload nginx
四、启动kylin
1.检查配置依赖是否正确
$KYLIN_HOME/bin/check-env.sh
root@dev_cdh_001v:/usr/local/nginx/conf
# $KYLIN_HOME/bin/check-env.sh
Retrieving hadoop conf dir...
KYLIN_HOME is set to /opt/kylin
2.在hadoop01和hadoop02启动kylin
$KYLIN_HOME/bin/kylin.sh start
3、导入官方数据
命令行 $KYLIN_HOME/bin/sample.sh
如果出现Restart Kylin Server or click Web UI => System Tab => Reload Metadata to take effect,就说明示例cube创建成功了
数据成功后,查看hbase里的数据
hbase(main):001:0> list
TABLE
ims_tms_habsesql
kylin_metadata
member
tspCompleteCondition
tspVehicleCondition
5 row(s) in 0.3570 seconds
=> ["ims_tms_habsesql", "kylin_metadata", "member", "tspCompleteCondition", "tspVehicleCondition"]
hbase(main):002:0>
4、访问:172.20.20.32:7001/kylin