2017-04-12 70 views
0

我試圖將3個文檔編入索引。我已經能夠成功索引前兩個,但是在索引第三個索引時,我收到了與終端中的堆空間相關的錯誤。 我試圖在jvm.options文件中將堆大小增加到3g,因爲我只有4GB的RAM,但它仍然沒有幫助。這裏是我的文檔的樣子和之前被索引的文件類似於它僅與座標值的變化:Elasticsearch OutOfMemoryError索引文檔時的Java堆空間

curl -XPUT 'localhost:9200/test/test1/2?pretty&pretty' -H 'Content-Type: application/json' -d' 

    { 
    "createdAt": "2017-03-30T12:36:28.061Z", 
    "updatedAt": "2017-03-30T12:36:28.061Z", 
    "id": "g5G4c", 
    "user": "0000-0002-1194-2058", 
    "metadata": { 
     "raw": { 
      "author": [ 
       { 
        "affiliation": [], 
        "name": "Markus Konkol", 
        "orcid": "0000-0002-4898-0314" 
       } 
      ], 
      "community": "o2r", 
      "date": "30 November 2016", 
      "depends": [ 
       { 
        "category": "CRAN Top100", 
        "identifier": "shiny", 
        "packageSystem": "https://cloud.r-project.org/", 
        "version": null 
       }, 
       { 
        "category": "none", 
        "identifier": "likert", 
        "packageSystem": "https://cloud.r-project.org/", 
        "version": null 
       } 
      ], 
      "description": null, 
      "ercIdentifier": "g5G4c", 
      "file": { 
       "filename": "main.Rmd", 
       "filepath": "g5G4c/data/main.Rmd", 
       "mimetype": "text/markdown" 
      }, 
      "generatedBy": "o2r-meta metaextract.py", 
      "inputfiles": [ 
       "/tmp/o2r/compendium/g5G4c/data/quest.csv" 
      ], 
      "interaction": { 
       "interactive": true 
      }, 
      "keywords": [], 
      "license": null, 
      "output": { 
       "html_document": { 
        "number_sections": true 
       } 
      }, 
      "paperLanguage": [ 
       "en" 
      ], 
      "paperSource": "main.Rmd", 
      "publicationDate": null, 
      "r_comment": [ 
       { 
        "feature": "comment", 
        "line": 29, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 32, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 37, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 81, 
        "text": "Participants" 
       }, 
       { 
        "feature": "comment", 
        "line": 84, 
        "text": "What are you doing in the context of scientific publications" 
       }, 
       { 
        "feature": "comment", 
        "line": 86, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 89, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 92, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 118, 
        "text": "print" 
       }, 
       { 
        "feature": "comment", 
        "line": 119, 
        "text": "print" 
       }, 
       { 
        "feature": "comment", 
        "line": 120, 
        "text": "print" 
       }, 
       { 
        "feature": "comment", 
        "line": 123, 
        "text": "What are your research fields" 
       }, 
       { 
        "feature": "comment", 
        "line": 192, 
        "text": "Please tell us your age" 
       }, 
       { 
        "feature": "comment", 
        "line": 198, 
        "text": "Please tell us your gender" 
       }, 
       { 
        "feature": "comment", 
        "line": 203, 
        "text": "Reproducible research" 
       }, 
       { 
        "feature": "comment", 
        "line": 237, 
        "text": "Interaction" 
       }, 
       { 
        "feature": "comment", 
        "line": 239, 
        "text": "Relating to your last five publications" 
       }, 
       { 
        "feature": "comment", 
        "line": 262, 
        "text": "While reading a scientific publication that is related to my own research work" 
       }, 
       { 
        "feature": "comment", 
        "line": 273, 
        "text": "It would be useful for my research work" 
       }, 
       { 
        "feature": "comment", 
        "line": 283, 
        "text": "For my research work I would like to search for other scientific publications on the web by using" 
       } 
      ], 
      "r_input": [ 
       { 
        "feature": "data input", 
        "line": 8, 
        "text": "quest.csv" 
       } 
      ], 
      "r_output": [ 
       { 
        "feature": "result", 
        "line": 67, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 69, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 76, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 77, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 112, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 118, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 119, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 120, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 179, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 182, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 183, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 184, 
        "text": "print" 
       } 
      ], 
      "recordDateCreated": "2017-03-30", 
      "runtime": "shiny", 
      "softwarePaperCitation": null, 
      "spatial": { 
       "files": [], 
       "union": [] 
      }, 
      "temporal": { 
       "begin": "2016-11-30T00:00:00", 
       "end": "2016-12-08T13:55:02" 
      }, 
      "title": "Reproducible research in Geosciences", 
      "version": null 
     }, 
     "o2r": { 
      "author": [ 
       { 
        "affiliation": [], 
        "name": "Markus Konkol", 
        "orcid": "0000-0002-4898-0314" 
       } 
      ], 
      "community": "o2r", 
      "date": "30 November 2016", 
      "depends": [ 
       { 
        "category": "CRAN Top100", 
        "identifier": "shiny", 
        "packageSystem": "https://cloud.r-project.org/", 
        "version": null 
       }, 
       { 
        "category": "none", 
        "identifier": "likert", 
        "packageSystem": "https://cloud.r-project.org/", 
        "version": null 
       } 
      ], 
      "description": null, 
      "ercIdentifier": "g5G4c", 
      "file": { 
       "filename": "main.Rmd", 
       "filepath": "g5G4c/data/main.Rmd", 
       "mimetype": "text/markdown" 
      }, 
      "generatedBy": "o2r-meta metaextract.py", 
      "inputfiles": [ 
       "/tmp/o2r/compendium/g5G4c/data/quest.csv" 
      ], 
      "interaction": { 
       "interactive": true 
      }, 
      "keywords": [], 
      "license": null, 
      "output": { 
       "html_document": { 
        "number_sections": true 
       } 
      }, 
      "paperLanguage": [ 
       "en" 
      ], 
      "paperSource": "main.Rmd", 
      "publicationDate": null, 
      "r_comment": [ 
       { 
        "feature": "comment", 
        "line": 29, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 32, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 37, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 81, 
        "text": "Participants" 
       }, 
       { 
        "feature": "comment", 
        "line": 84, 
        "text": "What are you doing in the context of scientific publications" 
       }, 
       { 
        "feature": "comment", 
        "line": 86, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 89, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 92, 
        "text": "sum of " 
       }, 
       { 
        "feature": "comment", 
        "line": 118, 
        "text": "print" 
       }, 
       { 
        "feature": "comment", 
        "line": 119, 
        "text": "print" 
       }, 
       { 
        "feature": "comment", 
        "line": 120, 
        "text": "print" 
       }, 
       { 
        "feature": "comment", 
        "line": 123, 
        "text": "What are your research fields" 
       }, 
       { 
        "feature": "comment", 
        "line": 192, 
        "text": "Please tell us your age" 
       }, 
       { 
        "feature": "comment", 
        "line": 198, 
        "text": "Please tell us your gender" 
       }, 
       { 
        "feature": "comment", 
        "line": 203, 
        "text": "Reproducible research" 
       }, 
       { 
        "feature": "comment", 
        "line": 237, 
        "text": "Interaction" 
       }, 
       { 
        "feature": "comment", 
        "line": 239, 
        "text": "Relating to your last five publications" 
       }, 
       { 
        "feature": "comment", 
        "line": 262, 
        "text": "While reading a scientific publication that is related to my own research work" 
       }, 
       { 
        "feature": "comment", 
        "line": 273, 
        "text": "It would be useful for my research work" 
       }, 
       { 
        "feature": "comment", 
        "line": 283, 
        "text": "For my research work I would like to search for other scientific publications on the web by using" 
       } 
      ], 
      "r_input": [ 
       { 
        "feature": "data input", 
        "line": 8, 
        "text": "quest.csv" 
       } 
      ], 
      "r_output": [ 
       { 
        "feature": "result", 
        "line": 67, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 69, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 76, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 77, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 112, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 118, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 119, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 120, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 179, 
        "text": "plot" 
       }, 
       { 
        "feature": "result", 
        "line": 182, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 183, 
        "text": "print" 
       }, 
       { 
        "feature": "result", 
        "line": 184, 
        "text": "print" 
       } 
      ], 
      "recordDateCreated": "2017-03-30", 
      "runtime": "shiny", 
      "softwarePaperCitation": null, 
      "spatial": { 
        "geometry": { 
        "type": "polygon", 
          "coordinates": [ 
      [ [-93.0, 66.0], [-96.0, 50.0], [-129.0, 50.0], [-131.0, 66.0], [-93.0, 66.0] ] 
            ] 
          } 
         },         
      "temporal": { 
       "begin": "2017-08-01T22:00:00.000Z", 
       "end": "2017-03-30T12:35:41.142Z" 
      }, 
      "title": "Reproducible research in Geosciences", 
      "version": null 
     }, 
     "zenodo": { 
      "title": "Reproducible research in Geosciences" 
     }, 
     "cris": { 
      "title": "Reproducible research in Geosciences" 
     }, 
     "orcid": { 
      "title": "Reproducible research in Geosciences" 
     }, 
     "datacite": { 
      "title": "Reproducible research in Geosciences" 
     } 
    }, 
    "jobs": [], 
    "created": "2017-03-30T12:35:35.774Z", 
    "__v": 0 

}' 

索引映射

curl -XPUT 'localhost:9200/test/?pretty' -H 'Content-Type: application/json' -d' 
{ 
"mappings": { 
"test1":{ 
"properties":{ 
"metadata":{ 
"properties":{ 
"o2r":{ 
"properties":{ 
"spatial": { 
"properties": { 
"geometry": { 
"type": "geo_shape", 
"tree": "quadtree", 
"precision": "1m" 
} 
} 
} 
} 
} 
}}}}}}' 
+0

運行elasticsearch時使用'htop'來查看堆內存實際分配到多少堆 – RoiHatam

+0

@RoiHatam這裏是htop終端在索引突然停止並拋出堆錯誤之前的樣子:[HTOP OUTPUT] (http://imgur.com/a/GPxSS)。可能它與我在文件中創建的座標對象有關,而不是RAM,但我不確定! – Rehan

+0

我的建議是將內存堆設置爲物理內存的'2gb'%50。我不確定它是否會幫助你防止內存不足。 – RoiHatam

回答

0

我能解決這個問題通過將我的索引映射的精度從1m更改爲2m。由於我的RAM位於較低的一側,因此它對空間索引的精度要求稍低。

相關問題