TyLy
TyLy

Reputation: 153

MobileFirst Analytics dashboard does not show any data

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

Answers (2)

maggix
maggix

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

TyLy
TyLy

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:

  1. To find the list of all shards, use this CURL command:

curl -XGET http://localhost:9500/_cat/shards

  1. To find the list of unassigned shards, use this CURL command:

curl -XGET http://localhost:9500/_cat/shards | grep UNASSIGNED

  1. Once you get the list of unassigned shards, you can initialize them
    with the following command:
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.

  1. Run the following command to check the status:

curl -XGET http://localhost:9500/_cluster/health?pretty

The server status should be green when all the shards are initialized and assigned.

Upvotes: 1

Related Questions