Atlas 支持hive的beeline jdbc方式
1.将atlas-application.properties配置文件加入到atlas-plugin-classloader-2.0.0.jar中
注意要在同级目录打包!
cp atlas-application.properties /opt/apache-atlas-sources-2.0.0/distro/target/apache-atlas-2.0.0-server/apache-atlas-2.0.0/hook/hive/
zip -u atlas-plugin-classloader-2.0.0.jar atlas-application.properties
2.环境变量HIVE_AUX_JARS_PATH
在/etc/hive/conf/hive-env.sh中添加HIVE_AUX_JARS_PATH变量
export HIVE_AUX_JARS_PATH=/opt/apache-atlas-sources-2.0.0/distro/target/apache-atlas-2.0.0-server/apache-atlas-2.0.0/hook/hive
注意:如果hive-env.sh中已经有HIVE_AUX_JARS_PATH变量,或者在Clouder Manager中Hive配置页面上HIVE_AUX_JARS_PATH配置项已经有值,
就将上述路径(/opt/apache-atlas-sources-2.0.0/distro/target/apache-atlas-2.0.0-server/apache-atlas-2.0.0/hook/hive)下的所有文件(jar包)都复制到已有的HIVE_AUX_JARS_PATH指定的路径下
HIVE_AUX_JARS_PATH即/opt/cloudera/parcels/CDH-6.1.1-1.cdh6.1.1.p0.875250/lib/hive/lib/
cd /opt/apache-atlas-sources-2.0.0/distro/target/apache-atlas-2.0.0-server/apache-atlas-2.0.0/hook/hive
cp -r * /opt/cloudera/parcels/CDH-6.1.1-1.cdh6.1.1.p0.875250/lib/hive/lib/
scp -r * bd227:/opt/cloudera/parcels/CDH-6.1.1-1.cdh6.1.1.p0.875250/lib/hive/lib/
每一个hive节点都要分发到
3.配置hive hook
1.Hive 辅助 JAR 目录 Hive(服务范围)
/opt/cloudera/parcels/CDH-6.1.1-1.cdh6.1.1.p0.875250/lib/hive/lib/
2.hive-site.xml 的 Hive 客户端高级配置代码段(安全阀) Gateway Default Group
hive.exec.post.hooks org.apache.atlas.hive.hook.HiveHook
3.hive-site.xml 的 HiveServer2 高级配置代码段(安全阀) HiveServer2 Default Group
hive.reloadable.aux.jars.path /opt/cloudera/parcels/CDH-6.1.1-1.cdh6.1.1.p0.875250/lib/hive/lib/
4.hive-site.xml 的 HiveServer2 高级配置代码段(安全阀) HiveServer2 Default Group
hive.exec.post.hooks org.apache.atlas.hive.hook.HiveHook
5.HiveServer2 日志记录高级配置代码段(安全阀) HiveServer2 Default Group
HIVE_AUX_JARS_PATH=/opt/cloudera/parcels/CDH-6.1.1-1.cdh6.1.1.p0.875250/lib/hive/lib/
注意
1.前两点只是hive生效,hive2不生效,也就是beeline使用的时候会报错
2.Could not initialize class org.apache.atlas.hive.hook.HiveHook
需要需要把atlas-application.properties打入atlas-plugin-classloader-2.2.0.jar中