IBM Worklight 6.2 Analytics Cluster topology

314 Views Asked by At

Environment details: Worklight : 6.2

Application server :Liberty 8.5.5.0

OS: Windows Server 2008 r2

I am trying to achieve the cluster topology of Operational Analytics in Worklight 6.2. The following are the steps

  1. Created two liberty server instance analytics1 and analytics2.

  2. Copied the analytics.war file in the apps folder of both the servers.

  3. In the server.xml of the analytis1 server, I have configured as master node.

    jndiEntry jndiName="analytics/nodetype" value="master"
    jndiEntry jndiName="analytics/shards" value="2"
    jndiEntry jndiName="analytics/replicas_per_shard" value="2"

  4. In the server.xml 0f the analytics2 server, I have configured as data node.

    jndiEntry jndiName="analytics/nodetype" value="data"
    jndiEntry jndiName="analytics/masternodes" value="XX.XX.XX.XX:9600"

The data is not getting populated in this topology.

If it is tried as individual node i.e without setting nodetype as master or data, its showing the analytics result.

The following are my log traces

    [10/11/14 23:23:30:351 GST] 00000021 com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [analytics] [/analytics] [data]: Initialization successful.
[10/11/14 23:24:11:920 GST] 00000021 org.apache.wink.server.internal.RequestProcessor             E An unhandled exception occurred which will be propagated to the container.
[10/11/14 23:24:11:955 GST] 00000021 com.ibm.ws.webcontainer.util.ApplicationErrorUtils           E SRVE0777E: Exception thrown by application class 'org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult:276'
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed
    at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:276)
    at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.start(TransportSearchTypeAction.java:147)
    at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:59)
    at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:49)
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
    at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:108)
    at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:43)
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
    at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:92)
    at org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:212)
    at org.elasticsearch.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:1043)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
    at com.ibm.elasticsearch.util.ESUtility.genericFacet(ESUtility.java:155)
    at com.ibm.elasticsearch.util.ESUtility.genericFacet(ESUtility.java:139)
    at com.ibm.elasticsearch.util.ESUtility.genericFacet(ESUtility.java:210)
    at com.ibm.elasticsearch.rest.Common.getGadgets(Common.java:51)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
1

There are 1 best solutions below

1
On BEST ANSWER

The problem is that a master node cannot display data without a data node, and a data node will not run without first connecting to a master node. I'd image that this isn't working because your two nodes aren't communicating to begin with.

The comment by Karikalan is correct, why is the "masternodes" JNDI property on your data node set to localhost? This means that when the data node is started, it will try to look for a master node at "localhost:9600" which won't work since its just pointing it to itself. Try changing the "localhost:9600" to the IP address of the server that has the masternode.

Furthermore, if you're only planning on having two nodes, then I don't recommend using separate master and data nodes. A master node would help if there were several other nodes that needed to be managed (by several I mean 5+ nodes). With only 2 nodes, having one as a master and one as a data would be a waste of resources. You should set both nodes to act as "master and data" nodes (this can be achieved by simply not setting the "analytics/nodetype" JNDI property). Then set the "masternodes" JNDI property on each server to point to the other server.

EDIT:

Can you try the following:

  1. Stop both servers
  2. Delete the "analyticsData" data folder for each server (its in the same folder as your server.xml)
  3. To be safe, temporarily set the replicas per shard value to 1
  4. Start the master node first and visit the console for the master node
  5. Start the data node and the visit the console for the data node
  6. Try to send data to the analytics cluster