首页  

kafka监控工具kafka-eagle编译安装使用     所属分类 kafka 浏览量 2789
下载最新源码编译安装

https://github.com/smartloli/kafka-eagle/archive/v1.3.0.zip

编译  
mvn clean install -Dmaven.test.skip eclipse:eclipse


[ERROR] /Users/dugang/soft/elk/kafka-eagle-1.3.0/kafka-eagle-common/src/main/java/org/smartloli/kafka/eagle/common/protocol/KafkaSqlInfo.java:[34,57] -source 1.5 中不支持 diamond 运算符
  (请使用 -source 7 或更高版本以启用 diamond 运算符)
[ERROR] /Users/dugang/soft/elk/kafka-eagle-1.3.0/kafka-eagle-common/src/main/java/org/smartloli/kafka/eagle/common/util/KafkaZKPoolUtils.java:[44,84] -source 1.5 中不支持 diamond 运算符
  (请使用 -source 7 或更高版本以启用 diamond 运算符)
[ERROR] /Users/dugang/soft/elk/kafka-eagle-1.3.0/kafka-eagle-common/src/main/java/org/smartloli/kafka/eagle/common/util/KafkaZKPoolUtils.java:[50,60] -source 1.5 中不支持文字中存在下划线
  (请使用 -source 7 或更高版本以允许文字中存在下划线)


pom.xml 里增加 


	<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>



编译成功后生成war包
kafka-eagle-web/target/ke.war

部署到 tomcat下 Apache Tomcat/8.5.32 ,注意需要部署到 /webapps/ke/ 
/webapps/ke/ke.war

因为 jsp 里把应用路径写死了

解压war包
jar xvf ke.war




配置文件
classes/system-config.properties

WEB-INF/classes/spring-mybatis.xml

<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location" value="classpath:system-config.properties" />
</bean>


# kafka.eagle.zk.cluster.alias=cluster1,cluster2
kafka.eagle.zk.cluster.alias=cluster1
cluster1.zk.list=10.57.31.22:2182
#cluster2.zk.list=xdn1:2181,xdn2:2181,xdn3:2181
cluster1.kafka.eagle.offset.storage=kafka

# Zkcli limit -- Zookeeper cluster allows the number of clients to connect to
kafka.zk.limit.size=25

# Kafka Eagle webui port -- WebConsole port access address
kafka.eagle.webui.port=9050


# Default use sqlite to store data
kafka.eagle.driver=org.sqlite.JDBC
# It is important to note that the   path must exist.
kafka.eagle.url=jdbc:sqlite:/Users/dugang/soft/tomcat/ke9050/ke.db
kafka.eagle.username=
kafka.eagle.password=


其他配置先忽略 , 不开启 钉钉和微信报警
kafka.eagle.im.dingding.enable=false
kafka.eagle.im.wechat.enable=false
cluster1.kafka.eagle.sasl.enable=false




在 mac 下,启动成功

部署到linux上之后 启动报错

2019-04-25 16:51:39 INFO  [PostProcessorRegistrationDelegate$BeanPostProcessorChecker.localhost-startStop-1] - Bean 'keAuthc' of type [class org.smartloli.kafka.eagle.web.sso.filter.SSOFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
java.io.FileNotFoundException: /home/dyyx/soft/ke9050/bin/conf/system-config.properties (没有那个文件或目录)

......
Caused by: java.lang.NullPointerException
	at org.smartloli.kafka.eagle.common.util.KafkaZKPoolUtils.(KafkaZKPoolUtils.java:56)
	... 49 more
	
	
跟踪 代码  KafkaZKPoolUtils > SystemConfigUtils
不同的操作系统,配置文件加载路径不一样

String osName = System.getProperties().getProperty("os.name");
				if (osName.contains("Mac") || osName.contains("Win")) {
					mConfig.load(SystemConfigUtils.class.getClassLoader().getResourceAsStream(name));
				} else {
					mConfig.load(new FileInputStream(System.getProperty("user.dir") + "/conf/" + name));
				}
				
修改 此处代码 ,直接从类路径加载
mConfig.load(SystemConfigUtils.class.getClassLoader().getResourceAsStream(name));

重新打包部署后,Linux上也可以正常启动

			



数据库初始化 org.smartloli.kafka.eagle.web.controller.StartupListener String jdbc = SystemConfigUtils.getProperty("kafka.eagle.driver"); if (JConstants.MYSQL_DRIVER.equals(jdbc)) { MySqlRecordSchema.schema(); } else if (JConstants.SQLITE_DRIVER.equals(jdbc)) { SqliteRecordSchema.schema(); } 支持 mysql 和 sqlite 建库脚本定义 org.smartloli.kafka.eagle.plugin.util.JConstants 用户名和密码 static String CREATE_TABLE_SQLITE_KE_USERS = "CREATE TABLE IF NOT EXISTS `ke_users` (`id` integer primary key autoincrement,`rtxno` int(11) NOT NULL,`username` varchar(64) NOT NULL,`password` varchar(128) NOT NULL,`email` varchar(64) NOT NULL,`realname` varchar(128) NOT NULL)"; static String CREATE_TABLE_SQLITE_KE_USERS_INSERT = "INSERT INTO `ke_users` VALUES ('1', '1000', 'admin', '123456', 'admin@email.com', 'Administrator')"; admin/123456

上一篇     下一篇
kibana安装配置及使用

elasticsearch7.0压测问题记录

elasticsearch工具

rust特点及安装

maven命令行运行main方法

tomcat8.5压测记录