xaecbd / KCenter

KCenter(KafkaCenter) is a unified platform for kafka cluster management and maintenance, producer / consumer monitoring, and use of ecological components(ksql/kafka connect).it's kafkacenter(kafka center).
https://xaecbd.github.io/KCenter
Apache License 2.0
1.16k stars 196 forks source link

es 7.8版本,center启动报错 #69

Closed 946106004 closed 4 years ago

946106004 commented 4 years ago

in /root/KafkaCenter/KafkaCenter-Core/target) 2020-06-24 04:00:49,384 INFO [main] Application: No active profile set, falling back to default profiles: default 2020-06-24 04:00:51,467 INFO [main] TomcatWebServer: Tomcat initialized with port(s): 8088 (http) 2020-06-24 04:00:51,525 INFO [main] ContextLoader: Root WebApplicationContext: initialization completed in 2080 ms 2020-06-24 04:00:51,869 WARN [main] HikariConfig: KafkaCenterHikariCP - idleTimeout is close to or more than maxLifetime, disabling it. 2020-06-24 04:00:51,871 INFO [main] HikariDataSource: KafkaCenterHikariCP - Starting... 2020-06-24 04:00:52,227 INFO [main] HikariDataSource: KafkaCenterHikariCP - Start completed. 2020-06-24 04:00:52,843 WARN [main] AnnotationConfigServletWebServerApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticsearchService': Invocation of init method failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1 2020-06-24 04:00:52,844 INFO [main] HikariDataSource: KafkaCenterHikariCP - Shutdown initiated... 2020-06-24 04:00:52,859 INFO [main] HikariDataSource: KafkaCenterHikariCP - Shutdown completed. 2020-06-24 04:00:52,881 INFO [main] ConditionEvaluationReportLoggingListener:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-06-24 04:00:52,885 ERROR [main] SpringApplication: Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticsearchService': Invocation of init method failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1 at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at org.nesc.ec.bigdata.Application.main(Application.java:17) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at org.nesc.ec.bigdata.common.util.ElasticsearchUtil.(ElasticsearchUtil.java:37) at org.nesc.ec.bigdata.service.ElasticsearchService.init(ElasticsearchService.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ... 26 common frames omitted

TrumanDu commented 4 years ago

@946106004 可以发一下你的配置文件,关于es的配置

946106004 commented 4 years ago

server.port=8088 debug=false

设置session timeout为6小时

server.servlet.session.timeout=21600 spring.security.user.name=admin spring.security.user.password=admin spring.datasource.url=jdbc:mysql://xxxxx spring.datasource.username=xxx spring.datasource.password=xxx spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.hikari.minimum-idle=5 spring.datasource.hikari.maximum-pool-size=15 spring.datasource.hikari.pool-name=KafkaCenterHikariCP spring.datasource.hikari.max-lifetime =30000 spring.datasource.hikari.connection-test-query=SELECT 1 management.health.defaults.enabled=false

public.url=http://172.21.41.229:8088 connect.url=http://172.21.41.229:8081/#/ system.topic.ttl.h=16

monitor.enable=true monitor.collect.period.minutes=5 monitor.elasticsearch.hosts=internal-tk-dev-es-alb-1332085350.ap-northeast-1.elb.amazonaws.com monitor.elasticsearch.index=kafka_center_monitor

是否启用收集线程指定集群收集

monitor.collector.include.enable=false

收集线程指定location,必须属于remote.locations之中

monitor.collector.include.location=E4 collect.topic.enable=true collect.topic.period.minutes=10

remote的功能是为了提高lag查询和收集,解决跨location网络延迟问题

remote.query.enable=false remote.hosts=gqc@localhost2:8080 remote.locations=dev,qa,prod

发送consumer group的lag发送给alert service

alert.enable=false alert.dispause=2 alert.service= alert.threshold=1000 alter.env=other

是否开启邮件功能,true:启用,false:禁用

mail.enable=false spring.mail.host= spring.mail.username=KafkaCenter@xaecbd.com

oauth2

generic.enabled=false generic.name=oauth2 Login generic.auth_url= generic.token_url= generic.redirect_utl= generic.api_url= generic.client_id= generic.client_secret= generic.scopes=

946106004 commented 4 years ago

es的配置 cluster.name: kafka-center node.name: node-1 path.data: /var/lib/elasticsearch path.logs: /var/log/elasticsearch network.host: 0.0.0.0 http.port: 9200 discovery.seed_hosts: ["172.21.43.100","172.21.43.123"] cluster.initial_master_nodes: ["node-1"] action.auto_create_index: true

TrumanDu commented 4 years ago

@946106004 Es host改成ip+端口,详见默认配置

946106004 commented 4 years ago

6666666666