How to configure WSO2 EI 6.1.x Analytics with Mong

2019-03-30 12:02发布

I tried to configure WSO2 EI Analytics 6.1.1u23 to use MongoDb as event store but without success. I have found this PR to add MongoDb support for Analytics records; I have added in analytics-datasources.xml this configuration:

<providers>
    <provider>org.wso2.carbon.datasource.reader.mongo.MongoDataSourceReader</provider>
</providers>

<datasource>
           <name>WSO2_ANALYTICS_DS_MONGO</name>
           <description>The datasource used for analytics record store</description>
           <definition type="MONGO">
               <configuration>
                   <host>xxx.xxx.xxx.xxx</host>
                   <port>27017</port>
               </configuration>
           </definition>
</datasource>

And in analytics-config.xml this configuration:

<analytics-record-store name="EVENT_STORE">
<implementation>org.wso2.carbon.analytics.datasource.mongo.MongoAnalyticsRecordStore</implementation>
       <properties>
           <property name="datasource">WSO2_ANALYTICS_DS_MONGO</property>
           <property name="database">WSO2_DAS_EVENT</property>
       </properties>
 </analytics-record-store>

At startup I get the follow error: org.wso2.carbon.datasource.reader.mongo.MongoDa taSourceReader cannot be found

UPDATE: I have added the missing library org.wso2.carbon.datasource.reader.mongo-4.4.33.jar and now I get the follow error:

TID: [-1234] [] [2018-03-05 13:47:10,701]  WARN {org.wso2.carbon.metrics.impl.MetricServiceImpl} -  Failed to build the reporter {org.wso2.carbon.metrics.impl.MetricServiceImpl}
org.wso2.carbon.metrics.impl.util.ReporterBuildException: Error when looking up the Data Source: 'jdbc/WSO2MetricsDB'.
    at org.wso2.carbon.metrics.impl.util.JDBCReporterBuilder.build(JDBCReporterBuilder.java:174)
    at org.wso2.carbon.metrics.impl.util.JDBCReporterBuilder.build(JDBCReporterBuilder.java:33)
    at org.wso2.carbon.metrics.impl.MetricServiceImpl.<init>(MetricServiceImpl.java:201)
    at org.wso2.carbon.metrics.impl.MetricServiceImpl.<init>(MetricServiceImpl.java:65)
...
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: javax.naming.NameNotFoundException: Name [WSO2MetricsDB] is not bound in this Context. Unable to find [WSO2MetricsDB].
    at org.apache.naming.NamingContext.lookup(NamingContext.java:825)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:836)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
    at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:709)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)
    at org.wso2.carbon.metrics.impl.util.JDBCReporterBuilder.build(JDBCReporterBuilder.java:172)
    ... 86 more

What's missing/wrong in my configuration?

Thank in advance for any help

Marco

0条回答
登录 后发表回答