1

我将 API 管理器配置为将数据发送到 WSO2 数据分析服务器。

我在 API 服务器上的配置是:

事件接收器配置:{tcp://wso2-dac-svc.libre-dev.com:7611} 数据分析器配置:https ://wso2-dac-svc.libre-dev.com:8443

在 DAC 服务器上,我安装了具有事件接收器定义的 API_Manager_Analytics.car。

在 API 服务器上,我使用 keytool 从 DAC 服务器导入了证书。我重新启动了两台服务器。

我在日志中看到以下错误:

TID: [-1] [] [2016-05-16 16:06:11,417] ERROR {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} -  Error while connection to event receiver {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher}
org.wso2.carbon.databridge.commons.exception.AuthenticationException: Access denied for user admin to login TCP,wso2-dac-svc.libre-dev.com:7611,TCP,wso2-dac-svc.libre-dev.com:7711
        at org.wso2.carbon.databridge.agent.thrift.internal.publisher.authenticator.AgentAuthenticator.connect(AgentAuthenticator.java:54)
        at org.wso2.carbon.databridge.agent.thrift.DataPublisher.start(DataPublisher.java:273)
        at org.wso2.carbon.databridge.agent.thrift.DataPublisher.<init>(DataPublisher.java:161)
        at org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher$ReceiverConnectionWorker.run(AsyncDataPublisher.java:843)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.wso2.carbon.databridge.agent.thrift.exception.AgentAuthenticatorException: Thrift exception
        at org.wso2.carbon.databridge.agent.thrift.internal.publisher.authenticator.ThriftAgentAuthenticator.connect(ThriftAgentAuthenticator.java:51)
        at org.wso2.carbon.databridge.agent.thrift.internal.publisher.authenticator.AgentAuthenticator.connect(AgentAuthenticator.java:51)
        ... 8 more
Caused by: org.apache.thrift.transport.TTransportException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
        at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:147)
        at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:163)
        at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:91)
        at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62)
        at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.send_connect(ThriftSecureEventTransmissionService.java:82)
        at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.connect(ThriftSecureEventTransmissionService.java:73)
        at org.wso2.carbon.databridge.agent.thrift.internal.publisher.authenticator.ThriftAgentAuthenticator.connect(ThriftAgentAuthenticator.java:47)
        ... 9 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
        at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
        at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
        at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
        at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747)
        at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)
        at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:145)
        ... 15 more
Caused by: sun.security.validator.ValidatorException: No trusted certificate found
        at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:394)
        at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:133)
        at sun.security.validator.Validator.validate(Validator.java:260)
        at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
        ... 23 more
TID: [-1] [] [2016-05-16 16:06:41,363] ERROR {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} -  Reconnection failed fortcp://wso2-dac-svc.libre-dev.com:7611 {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher}
TID: [-1] [] [2016-05-16 16:07:11,004]  WARN {org.apache.synapse.core.axis2.TimeoutHandler} -  Expiring message ID : urn:uuid:6ed9fae5-d1fb-4cdf-885b-e101e79faf40; dropping message after timeout of : 30 seconds {org.apache.synapse.core.axis2.TimeoutHandler}
TID: [-1] [] [2016-05-16 16:07:11,371] ERROR {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} -  Reconnection failed fortcp://wso2-dac-svc.libre-dev.com:7611 {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher}
TID: [-1] [] [2016-05-16 16:07:34,514]  WARN {org.apache.synapse.transport.passthru.TargetHandler} -  http-outgoing-9: Connection time out while in state: REQUEST_DONE {org.apache.synapse.transport.passthru.TargetHandler}

基本上我无法将 API 统计信息发送到 DAS 服务器。任何帮助表示赞赏。

4

1 回答 1

0

根据错误日志,问题似乎很机智

Data Analytic Server Thrift 在端口 7711 上运行,默认使用位于 /repository/resources/security 中的“wso2carbon.jks”。因此,当我们需要在 /repository/conf/carbon.xml 上进行配置时,如下所示

<Security> <br>
    <!--<br>
        KeyStore which will be used for encrypting/decrypting passwords<br>
        and other sensitive information.
    --><br>
    <KeyStore><br>
        <!-- Keystore file location--><br>
        <Location>${carbon.home}/repository/resources/security/wso2carbon.jks</Location><br>
        <!-- Keystore type (JKS/PKCS12 etc.)--><br>
        <Type>JKS</Type><br>
        <!-- Keystore password--><br>
        <Password>wso2carbon</Password>
        <!-- Private Key alias--><br>
        <KeyAlias>wso2carbon</KeyAlias>
        <!-- Private Key password-->
        <KeyPassword>wso2carbon</KeyPassword><br>
    </KeyStore><br>

要添加新的密钥库,请使用以下步骤
1. 将密钥库放在“/repository/resources/security/”文件夹
中 2. 相应地更新 /repository/conf/carbon.xml 的“Security/KeyStore/”部分
3 . 相应地更新 data-agent-config.xml 的密钥库引用
4. 将新密钥库的证书导入位于 /repository/resources/security/client-truststore.jks 的 ESB 信任库。

最后,一旦更改了私钥,其相关证书应导入位于 /repository/resources/security/client-truststore.jks 的 API-Manager 信任库。

希望此步骤将对给定错误日志中的问题进行排序。

于 2016-08-02T09:40:09.720 回答