Search code examples
ibm-watsonretrieve-and-rank

How can I check how much space I have consumed in one of my R&R clusters?


I was wondering how I can get the index size of one of my clusters.

I would like to know if I still have enough space on my cluster or if I will need to increase its size.

In a local instance of Solr, I am able to make the following request:

curl "http://localhost:8888/solr/admin/cores?action=STATUS&wt=json"

response:

{
  "responseHeader": {
    "status": 0,
    "QTime": 0
  },
  "initFailures": {},
  "status": {
    "gettingstarted_shard2_replica1": {
      "name": "gettingstarted_shard2_replica1",
      "instanceDir": "/Users/hacker/Documents/solr-5.3.1/example/cloud/node1/solr/gettingstarted_shard2_replica1/",
      "dataDir": "/Users/hacker/Documents/solr-5.3.1/example/cloud/node1/solr/gettingstarted_shard2_replica1/data/",
      "config": "solrconfig.xml",
      "schema": "managed-schema",
      "startTime": "2016-03-05T01:51:09.964Z",
      "uptime": 69420729,
      "index": {
        "numDocs": 0,
        "maxDoc": 0,
        "deletedDocs": 0,
        "indexHeapUsageBytes": 0,
        "version": 2,
        "segmentCount": 0,
        "current": true,
        "hasDeletions": false,
        "directory": "org.apache.lucene.store.NRTCachingDirectory:NRTCachingDirectory(MMapDirectory@/Users/user/Documents/solr-5.3.1/example/cloud/node1/solr/gettingstarted_shard2_replica1/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@662d167e; maxCacheMB=48.0 maxMergeSizeMB=4.0)",
        "userData": {},
        "sizeInBytes": 71,
        "size": "71 bytes"
      }
    }
  }
}

But both action=STATUS and action=CLUSTERSTATUS are blocked by R&R (403 Forbidden response).

I could not find any insights of how I can accomplish this at the R&R documentation

Thanks


Solution

  • The Retrieve and Rank service now has a stats API to determine disk and memory usage. You can access it by sending a GET request to:

    /v1/solr_clusters/{cluster-id}/stats