Kafka Eagle 安装及使用
一、直接下载安装包安装
下载地址:http://download.kafka-eagle.org/
下载后按照官方文档(https:///2.env-and-install/2.installing)指导做就可以了。
需要注意的是 system-config.properties 里面的数据库配置必须配置,如配置不准确可以访问 Kafka Eagled的首页但是无法进入
二、源码编译安装
Git地址:https:///smartloli/kafka-eagle
源码下载后在编译时所遇到的问题:
1、kafka-eagle-common 模块出现的错误:-source 1.5 中不支持 diamond 运算符 [ERROR] (请使用 -source 7 或更高版本以启用 diamond 运算符)
原因是 KafkaZKPoolUtils 类中定义变量时用到了下划线,源码的 pom 文件中也没有加入 maven.plugins 的依赖,我们没有告诉 maven 我们的代码要使用什么样的jdk版本编译的话,它就会用maven-compiler-plugin默认的jdk版本来进行处理,导致 maven插件过低,不能编译.
源码如图:

查看各个模块的pom文件都没有 maven.plugins 的依赖,所以这里有两种解决方案:
1、在各个模块的 pom 文件中添加:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
2、在 maven 的 settings.xml文件中添加:
<profile>
<id>jdk18</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>问题解决,推荐使用第二种
2、kafka-eagle-core模块出现如下错误:
[ERROR] Failed to execute goal on project kafka-eagle-core: Could not resolve dependencies for project org.smartloli.kafka.eagle:kafka-eagle-core:jar:1.3.4: Could not find artifact org.pentaho:pentaho-aggdesigner-algorithm:jar:5.1.5-jhyde in nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public) -> [Help 1]
原因是该jar包没有下载下来

手动下载该 jar 包(https://repo.spring.io/plugins-release/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/),加入到本地仓库中,问题解决
疑惑点:
当我将 <calcite.version>1.6.0</calcite.version> 1.6.0 上级到 1.20.0后,JSqlSchema 类下的 contentsHaveChangedSince 方法重写失败,如图:

原因是该类继承了 AbstractSchema 类,而在 1.20.0 中该类中无 contentsHaveChangedSince方法,导致重写失败,
当我将该方法注释后,使用<calcite.version>1.20.0</calcite.version> 编译通过,部署成功后,其他功能都正常,只有 kafka sql 无法查询。具体原因不知道,今天并没有读懂源码(对 calcite 不熟,需搞懂 ),后期搞懂再更新。
三、使用
如何将多个环境部署到同一客户端
KafkaEagle 支持多个 cluster 部署。但需要注意的是需要在部署KafkaEagle 客户端的所在主机上添加其它环境的host。
如何配置 system-config.properties ,请参考官网,这里不在赘述。
启动成功后,主界面默认显示cluster1 的集群信息,点击 Cluster 目录下的Multi-Clusters, 如图所示:

















