Reputation: 153
Our MFP Analytics dashboard was working fine until last week. There is no data shown in the dashboard. Restart the server does not seem to help either. The cluster status on the server is RED. What can I do to resolve this?
Upvotes: 0
Views: 367
Reputation: 3278
On MobileFirst Platform 7.1, I solved the problem by changing the configuration in the server.xml
file of the Analytics server, reducing the number of shards:
<jndiEntry jndiName="analytics/shards" value="5" />
<jndiEntry jndiName="analytics/replicas_per_shard" value="1" />
For default values refer to: http://www.ibm.com/support/knowledgecenter/SSHSCD_7.1.0/com.ibm.worklight.monitor.doc/monitor/c_op_analytics_properties.html
Upvotes: 0
Reputation: 153
I've learned that when the cluster status is red, it is likely due to one or more unassigned shards. The following commands are quite handy and able to solve my issue:
curl -XGET http://localhost:9500/_cat/shards
curl -XGET http://localhost:9500/_cat/shards | grep UNASSIGNED
for shard in $(curl -XGET http://localhost:9500/_cat/shards | grep UNASSIGNED | awk '{print $2}'); do curl -XPOST 'localhost:9500/_cluster/reroute' -d '{ "commands" : [ { "allocate" : { "index" : “worklight”, "shard" : $shard, "node" : "worklightNode_1234", "allow_primary" : true } } ] }' sleep 5 done
You need to replace the 'node' with the node that the initialized
shards locate on, in my case, worklightNode_1234. This you can find
from the output in step 1.
curl -XGET http://localhost:9500/_cluster/health?pretty
The server status should be green when all the shards are initialized and assigned.
Upvotes: 1