I try to connect WSO2 ML with WSO2 DAS using datasource cassandra. In ML_HOME/repository/conf/datasources/analytics-datasources.xml and DAS_HOME/repository/conf/datasources/analytics-datasources.xml I have the same configuration to use cassandra.
<datasource>
<name>WSO2_ANALYTICS_DS_CASSANDRA</name>
<description>The Cassandra datasource used for analytics</description>
<definition type="CASSANDRA">
<configuration>
<contactPoints>192.168.1.111</contactPoints>
<port>9042</port>
<!--<username>admin</username>
<password>admin</password>
<clusterName>cluster1</clusterName> -->
<compression>NONE</compression>
<poolingOptions>
<coreConnectionsPerHost hostDistance="LOCAL">8</coreConnectionsPerHost>
<maxSimultaneousRequestsPerHostThreshold hostDistance="LOCAL">1024</maxSimultaneousRequestsPerHostThreshold>
</poolingOptions>
<queryOptions>
<fetchSize>5000</fetchSize>
<consistencyLevel>ONE</consistencyLevel>
<serialConsistencyLevel>SERIAL</serialConsistencyLevel>
</queryOptions>
<socketOptions>
<keepAlive>false</keepAlive>
<sendBufferSize>150000</sendBufferSize>
<connectTimeoutMillis>12000</connectTimeoutMillis>
<readTimeoutMillis>12000</readTimeoutMillis>
</socketOptions>
</configuration>
</definition>
</datasource>
When I try to create a Dataset in ML using DAS I get error when try to list the tables of DAS, specifically in ConfigurationApiV11.java, method getDASTables when call analyticsDataApi.listTables()
This is my error in logs:
TID: [-1234] [] [2016-09-03 22:35:59,762] WARN {org.apache.cxf.phase.PhaseInterceptorChain} - Application {http://api.rest.ml.carbon.wso2.org/}Lo$
org.apache.cxf.interceptor.Fault: Error while connecting to the remote service. null
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:113)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
It seems that WSO2ML is trying to connect to the analytic service remotely. By default it perform automatic selection of the mode. If you are using a single ML node and /AnalyticsDataConfiguration/Mode is set to AUTO at repository/conf/analytics/analytics-data-config.xml. Then change it to LOCAL. If the ML server start before the Cassandra cluster becomes available it may cause the ML server to use the REMOTE mode.