使用WSO2 AM 1.10.0后,我们现在正在为我们的WSO2集群评估AM 2.1.0。群集有两种类型的节点:
在经理节点,一切正常。我能够创建一个租户(0000s7.com)和一个API,然后运行它(我将GET动词定义为未经身份验证,因此不需要订阅):
$ curl http://localhost:8280/t/0000s7.com/ofer1/1.0.0
{ ...valid response... }
在工作节点:
当我使用WSClient时,我在日志中收到以下错误:
TID: [-1234] [] [2018-02-06 07:26:48,893] ERROR {org.apache.axis2.transport.http.AxisServlet} -
{org.apache.axis2.transport.http.AxisServlet} java.lang.NullPointerException
at org.apache.synapse.rest.RESTUtils.getFullRequestPath(RESTUtils.java:80)
at org.apache.synapse.rest.API.canProcess(API.java:223)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:97)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:69)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:304)
我也尝试过ThriftClient,我在日志中遇到了不同的错误:
TID: [1] [] [2018-02-06 08:01:29,527] @0000s7.com [1] [AM]
WARN {org.wso2.carbon.apimgt.gateway.handlers.security.thrift.ThriftKeyValidatorClien t} -
Login failed.. Authenticating again..{org.wso2.carbon.apimgt.gateway.handlers.security.thrift.ThriftKeyValidatorClient}
在这两种情况下,API调用都以
结尾<ams:fault xmlns:ams="http://wso2.org/apimanager/security">
<ams:code>900900</ams:code><ams:message>Unclassified Authentication Failure</ams:message>
<ams:description>Error while accessing backend services for API key validation</ams:description>
</ams:fault>
快速更改摘要。目前我离开了WSClient版本来运行:
经理节点 (内部IP 10.1.0.7)
./库/ CONF / API-manager.xml
<KeyValidatorClientType>WSClient</KeyValidatorClientType> <ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut> <ThriftClientPort>10397</ThriftClientPort> <EnableThriftServer>false</EnableThriftServer> <ThriftServerHost>10.1.0.7</ThriftServerHost> <ThriftServerPort>10397</ThriftServerPort>
./库/ CONF / carbon.xml
<HostName>10.1.0.7</HostName> <MgtHostName>10.1.0.7</MgtHostName>
采用MySQL DB的微小更改
<property name="subDomain" value="mgt"/> <property name="port.mapping.80" value="9763"/> <property name="port.mapping.443" value="9443"/>
Changed to work with RDS using MySQL. I'm using four databases: o regdb_21 (the “shared” registry” o apimgtdb_21 o userdb_21 o msgbrokerdb_21 In addition, stats DB and local registry are maintained in H2.
工作人员节点 (内部IP 10.1.0.150)
-DworkerNode=true \ -Dprofile=gateway-worker \
<KeyValidatorClientType>WSClient</KeyValidatorClientType> <ThriftClientPort>10397</ThriftClientPort> <ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut> <ThriftServerHost>10.1.0.7</ThriftServerHost> <ThriftServerPort>10397</ThriftServerPort> <EnableThriftServer>false</EnableThriftServer> <JMSConnectionDetails> <Enabled>false</Enabled> … Plus some changes of JMS IP to the IP address of the manager (10.1.0.7)
<HostName>10.1.0.150</HostName> <MgtHostName>10.1.0.150</MgtHostName>
Minor changes to adopt to the MySQL DB
<property name="port.mapping.80" value="9763"/> <property name="port.mapping.443" value="9443"/>
Same as in manager
Changes in IP from localhost to 10.1.0.7
完成日志
答案 0 :(得分:0)
由于Keymanager组件位于manager节点中,因此您必须将worker的<APIKeyValidator>
更改为指向manager节点。
如果-Dorg.wso2.ignoreHostnameVerification=true \
文件中有wso2server.sh
,则应忽略主机名验证。