基于ambari-2.7.3.0 、 HDP-3.1.0.0 、 HDP-UTILS-1.1.0.22 、HDP-GPL-3.1.0.0集群下手动安装KYLIN集群(hbase为2.0.2)。
yum -y install axel
axel -n 10 https://archive.apache.org/dist/kylin/apache-kylin-2.6.4/apache-kylin-2.6.4-bin-hadoop3.tar.gz
tar -zxvf apache-kylin-2.6.4-bin-hadoop3.tar.gz -C .
ln -s apache-kylin-2.6.4-bin-hadoop3 kylin
vi /etc/profile
############################################################
#java
export JAVA_HOME=/opt/jdk8
export PATH=$JAVA_HOME/bin:$PATH
#kafka
export KAFKA_HOME=/opt/kafka
export PATH=$KAFKA_HOME/bin:$PATH
#hive
export HIVE_HOME=/usr/hdp/3.1.0.0-78/hive/
export HIVE_CONF=/usr/hdp/3.1.0.0-78/hive/conf
export PATH=$HIVE_HOME/bin:$PATH
#hcat
export HCAT_HOME=/usr/hdp/3.1.0.0-78/hive-hcatalog
export PATH=$HCAT_HOME/bin:$PATH
#spark
export SPARK_HOME=/opt/spark
export PATH=$PATH:$SPARK_HOME/bin
#kylin
export KYLIN_HOME=/opt/kylin
export PATH=$KYLIN_HOME/bin:$PATH
#############################################################
vi /opt/kylin/tomcat/conf/server.xml
############################################################
# 注释掉下面https
############################################################
vim /opt/kylin/bin/header.sh
#################################
source /etc/profile
#################################
vi /opt/kylin/conf/kylin.properties
####################################################################
kylin.metadata.url=kylin_metadata@hbase
kylin.server.mode=all
kylin.server.cluster-servers=server1:7070,server2:7070,server3:7070,server4:7070,server5:7070
kylin.rest.servers=server1:7070,server2:7070,server3:7070,server4:7070,server5:7070
kylin.job.jar=/opt/kylin/lib/kylin-job-2.6.1.jar
kylin.coprocessor.local.jar=/opt/kylin/lib/kylin-coprocessor-2.6.1.jar
kylin.web.timezone=GMT+8
####################################################################
备注:
vi /opt/kylin/bin/find-hive-dependency.sh
#################################################################
注释这一行:hive_env=`hive ${hive_conf_properties} -e set 2>&1 | grep 'env:CLASSPATH'`
添加:
hive -e set >/tmp/hive_env.txt 2>&1
hive_env=`grep 'env:CLASSPATH' /tmp/hive_env.txt`
hive_env=`echo ${hive_env#*env:CLASSPATH}`
hive_env="env:CLASSPATH"${hive_env}
#################################################################
分别在两个配置文件中注释以下两个属性
####################################
####################################
# 删除hdfs上的老版本kafka-clients
sudo -u hdfs hadoop fs -copyToLocal /hdp/apps/3.1.0.0-78/mapreduce/mapreduce.tar.gz .
tar zxf mapreduce.tar.gz
rm hadoop/share/hadoop/tools/lib/kafka-clients-0.8.2.1.jar
tar zcf mapreduce.tar.gz hadoop/
sudo -u hdfs hadoop fs -copyFromLocal mapreduce.tar.gz /hdp/apps/3.1.0.0-78/mapreduce/
# 删除本地老版本kafka-clients
cd /usr/hdp
find . -name '*kafka-clients*'
rm -rf kafka-clients-0.8.2.1.jar
执行脚本自动下载安装:
/opt/kylin/bin/download-spark.sh
hadoop服务启动
jobhistory服务启动
hive元数据库启动
zookeeper服务启动
hbase服务启动
因ambari安装的hadoop是hdfs用户,kylin无权限写入,所以要以hdfs用户启动
chown -R hdfs:hdfs /opt/kylin
sudo -u hdfs /opt/kylin/bin/kylin.sh start
1.Something wrong with Hive CLI or Beeline, please execute Hive CLI or Beeline CLI in terminal to find the root cause.
解决方案:
详见上面第六步:配置bin/find-hive-dependency.sh。
2.Caused by: java.lang.IllegalStateException: Cannot start job scheduler due to lack of job lock
解决方案:
超过2个及以上kylin服务配置了kylin.server.mode=all,只能有一个为all或者job。
3.mkdir: Permission denied: user=root, access=WRITE, inode="/":hdfs:hdfs:drwxr-xr-x
Failed to create /kylin. Please make sure the user has right to access /kylin
解决方案:
修改权限并以hdfs用户启动即可。
4.kylin build构建时,提示不能找到 kafka依赖
解决方案:
详见上面第四步: 加载环境变量
5. kylin 2.6.4 存在BUG 与 hdp 中的包冲突, 无法从kafka构建, 提示 partition.assignment.strategy 没有设置默认值。
Error: org.apache.kafka.clients.consumer.ConsumerConfig.configNames()Ljava/util/Set;
Caused by: org.apache.kylin.job.exception.ExecuteException: org.apache.kylin.engine.mr .exception.MapReduceException: no counters for job job_1570617080701_0005Job Diagnostics:Task failed task_1570617080701_0005_m_000000
详见上面第八步: 修改mapreducer.tar.gz包
6. kylin2.6.4 在流式构建时提示某个hive属性不能使用
Error: Could not open client transport for any of the Server URI's in ZooKeeper: Failed to open new session: java.lang.IllegalArgumentException: Cannot modify dfs.replication at runtime. It is not in list of params that are allowed to be modified at runtime (state=08S01,code=0)
Cannot run commands specified using -e. No current connection
详见上面第七步:修改hive相关配置文件