如何使用MongoDB事件存储配置WSO2 EI 6.1.x Analytics

时间:2018-03-05 10:10:48

标签: mongodb wso2 datasource analytics

我尝试配置WSO2 EI Analytics 6.1.1u23以将MongoDb用作事件存储但没有成功。 我发现this PR可以为Google Analytics记录添加MongoDb支持; 我在analytics-datasources.xml中添加了这个配置:

<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>

在analytics-config.xml中这个配置:

<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>

启动时出现以下错误: org.wso2.carbon.datasource.reader.mongo.MongoDa 无法找到taSourceReader

更新:我添加了丢失的库org.wso2.carbon.datasource.reader.mongo-4.4.33.jar 现在我得到了以下错误:

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

我的配置中缺少/错误了什么?

提前感谢您的任何帮助

0 个答案:

没有答案