Hi all,

Question:
I would like to know what is the reliable way to fetch dataDir (and 
instanceDir) of a core that has an init failure.

Trials made:
I used the admin api to get status:
http://localhost:8983/solr/admin/cores?action=STATUS&core=<core-name>&wt=json&indent=true<http://localhost:8983/solr/admin/cores?action=STATUS&core=spedamallu1-core-1&wt=json&indent=true>
But I observed that, it does not always give me the information.

Steps followed:
Step 1: On a healthy core, remove some index file and restart Solr
Step 2: Invoke status api. Response was:
{
  "responseHeader":{
    "status":0,
    "QTime":5},
  
"initFailures":{"<core-name>":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
 Error opening new searcher"},
  "status":{
    "<core-name>":{
      "name":"<core-name>",
      "instanceDir":"<InstanceDirPath>",
      "dataDir":"<DataDirPath>",
      "config":"solrconfig.xml",
      "schema":"schema.xml",
      "isLoaded":"false"}}}
Step 3: Replace the removed file and restart Solr. Everything works as it is.
Step 4: Unload the core (without deleting indexDir or dataDir). api: 
http://localhost:8983/solr/admin/cores?action=UNLOAD&core=<core-name>
Step 5: Create the core (with same indexDir and dataDir). api: 
http://localhost:8983/solr/admin/cores?action=CREATE&name=<core-name>&instanceDir=path/to/dir&config=config_file_name.xml&dataDir=data
Step 6: Repeat Step 1. I.e., remove some index file and restart Solr
Step 7: Repeat Step 2. I.e, Invoke status api. Response was:
{
  "responseHeader":{
    "status":0,
    "QTime":0},
  
"initFailures":{"<core-name>":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
 Error opening new searcher"},
  "status":{
    "<core-name>":{}}}

Like you see, the response of status api from Step 7 is different from Step 2. 
Is there a reliable way to get dataDir of a core in the presence of 
init-failure?

Thanks,
Shashank Pedamallu

Reply via email to