kylin 连接 hortonworks 中的 hive 遇到的问题

    用 hortonworks(V3.1.0.0) 部署了 ambari (V2.7.3),用 ambari 部署了 hadoop 及 hive。

1.  启动 kylin(V2.6)时,遇到如下问题:

Retrieving hadoop conf dir...
KYLIN_HOME is set to /opt/programs/kylin
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Retrieving hive dependency...
Something wrong with Hive CLI or Beeline, please execute Hive CLI or Beeline CLI in terminal to find the root cause.

   经过查找,最后一行的错误信息是在 find-hive-dependency.sh 这个脚本中的,查看此脚本,是由于 hive_env 没有值引起的,

   进一步分析脚本,发现是因为脚本中的下面这段脚本没有得到值

hive_env=`hive ${hive_conf_properties} -e set 2>&1 | grep 'env:CLASSPATH'`

  直接在 shell 中运行上面的命令,确实没有输出。想了半天,把管道命令符前面的命令的输出,输出到一个文件。然后查找文件,发现是有 env:CLASSPATH 这一内容的。 但是为

    唯一能想到的原因是:管道符命令,前面命令的输出是有大小限制的,超过多少字符后,只能把最后多少个字符传给后面的命令。

    修改 find-hive-dependency.sh,把 hive_env=`hive ${hive_conf_properties} -e set 2>&1 | grep 'env:CLASSPATH'` 这一行删掉,加入下面几行后,kylin 能成功启动了。

    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}

2. kylin 创建 module 和 cube,可是在 build cube 时发生问题。在 stackoverflow 上提了此问题,也没有正确答案。后来还是偶然间,解决了问题。具体描述见

https://stackoverflow.com/questions/54702611/unable-to-read-hiveserver2-configs-from-zookeeper/54801284#54801284

原文地址:https://www.cnblogs.com/langfanyun/p/10407881.html