1

您能否帮助我解决以下问题。我使用 Apiman 1.2.1 版

FROM jboss/wildfly:9.0.2.Final
ENV APIMAN_VERSION 1.2.1.Final

我通过 kubernetes 公开这个版本,作为我在同一个容器中使用 postgres 的持久卷。一旦我第一次创建它,之后在 apiman 中我添加了 Organization/API/.... 和所有必要的人员。

我按下按钮发布 api,并可能检查它是否完美运行,因此我使用kubectl port-forward pod-name 8080:8080并可能通过浏览器检查我的网关http:localhost:8080/apiman-gateway/ORgId/bla/bla/bla/bla?givemedescriptionbyid=1

在这之后我去控制台并杀死 apiman pod,作为 pod 重启的结果,同样的操作kubectl port-forward new-pod-name 8080:8080,我可以看到 apiman 的所有数据,如组织、apis 和所有其他人员都已经存在。

但是,如果您再次尝试调用网关,则会出现一个大问题,它会告诉您:

{"responseCode":500,"message":"API not found.","trace":"io.apiman.gateway.engine.beans.exceptions.InvalidApiException: API not found.\n\tat io.apiman.gateway .engine.impl.ApiRequestExecutorImpl$3.handle(ApiRequestExecutorImpl.java:278)\n\tat io.apiman.gateway.engine.impl.ApiRequestExecutorImpl$3.handle(ApiRequestExecutorImpl.java:271)\n\tat io.apiman.gateway .engine.impl.SecureRegistryWrapper$1.handle(SecureRegistryWrapper.java:122)\n\tat io.apiman.gateway.engine.impl.SecureRegistryWrapper$1.handle(SecureRegistryWrapper.java:111)\n\tat io.apiman.gateway .engine.es.CachingESRegistry.getApi(CachingESRegistry.java:116)\n\tat io.apiman.gateway.engine.impl.SecureRegistryWrapper.getApi(SecureRegistryWrapper.java:111)\n\tat io.apiman.gateway.engine .impl.ApiRequestExecutorImpl。执行(ApiRequestExecutorImpl.java:270)\n\tat io.apiman.gateway.platforms.servlet.GatewayServlet.doAction(GatewayServlet.java:232)\n\tat io.apiman.gateway.platforms.servlet.GatewayServlet.doGet( GatewayServlet.java:77)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:687)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)\n\tat io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)\n\tat io.undertow。 servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)\n\tat org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)\n\tat io.undertow.server。handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)\n\tat io.undertow.servlet.handlers.security。 ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler. java:46)\n\tat io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)\n\tat io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) \n\tat io.undertow.servlet。handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)\n\tat io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)\n\tat io.undertow.security.handlers.SecurityInitialHandler。 handleRequest(SecurityInitialHandler.java:76)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest( JACCContextIdHandler.java:61)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) \n\tat io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)\n\tat io.undertow。servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)\n\tat io.undertow.servlet.handlers.ServletInitialHandler $1.handleRequest(ServletInitialHandler.java:172)\n\tat io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)\n\tat io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774 )\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang .Thread.run(Thread.java:745)\n"}访问$000(ServletInitialHandler.java:80)\n\tat io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)\n\tat io.undertow.server.Connectors.executeRootHandler(Connectors.java: 199)\n\tat io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util .concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n"}访问$000(ServletInitialHandler.java:80)\n\tat io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)\n\tat io.undertow.server.Connectors.executeRootHandler(Connectors.java: 199)\n\tat io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util .concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n"}ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745) \n"}ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745) \n"}

我可以看到,通过 api manager 中的调用指标,我所有的调用都可以到达 apiman-gateway,但我得到了 500 个响应代码。

4

1 回答 1

1

如果有人会遇到这样的错误,那么,我已经通过以下步骤解决了它,首先我们只需要使用新版本的 APIMAN,已经实现的修复列表。如果没有弹性搜索来恢复自身,apiman-gateway 也无法生存。因此应该提供弹性搜索配置。

于 2017-04-12T07:52:21.560 回答