我正在尝试使用Docker-compose将APIMAN连接到外部Elastic Search数据库。我遇到了一些问题(请参阅下面的日志输出)。以下是配置:
-apiman.properties
apiman.es.protocol=http
apiman.es.host=MY_MACHINE_HOST
apiman.es.port=9200
apiman.es.username=elasticsearch
apiman.es.password=
apiman.es.timeout=10000
apiman-manager.metrics.type=es
apiman-manager.metrics.es.client-factory=
apiman-manager.metrics.es.protocol=${apiman.es.protocol}
apiman-manager.metrics.es.host=${apiman.es.host}
apiman-manager.metrics.es.port=${apiman.es.port}
apiman-manager.metrics.es.username=${apiman.es.username}
apiman-manager.metrics.es.password=${apiman.es.password}
apiman-manager.metrics.es.timeout=${apiman.es.timeout}
ETC...
-和日志
ERROR [io.undertow.request] (default task-28) UT005023: Exception handling request to /apiman/organizations/test/apis/test/versions/1.0/metrics/planUsage: org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: java.lang.IllegalArgumentException: name is empty
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76)
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212)
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:168)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:411)
ETC...
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: name is empty
at io.apiman.manager.api.war.WarCdiFactory.provideMetricsESClientFactory(WarCdiFactory.java:255)
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:99)
at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:161)
ETC...
Caused by: java.lang.IllegalArgumentException: name is empty
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:344)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
这是docker-compose配置:
apiman:
build: ./docker/apiman/
links:
- elastic:elastic
ports:
- "8060:8080"
- "8443:8443"
elastic:
image: elasticsearch
ports:
- "9200:9200"
难道我做错了什么 ?
任何帮助将不胜感激。
最佳答案
尝试将apiman-manager.metrics.es.client-factory=
注释掉,否则,您尝试使用空字符串(或其他不存在的东西)覆盖默认值。
关于elasticsearch - 将APIMAN连接到外部ElasticSearch数据库以获取指标,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38332624/