{"id":706,"date":"2020-02-10T14:22:26","date_gmt":"2020-02-10T19:22:26","guid":{"rendered":"https:\/\/crossan007.dev\/blog\/?p=706"},"modified":"2020-02-10T14:24:34","modified_gmt":"2020-02-10T19:24:34","slug":"recovering-from-full-elasticsearch-nodes","status":"publish","type":"post","link":"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/","title":{"rendered":"Recovering from full Elasticsearch nodes"},"content":{"rendered":"\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=crossan007\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n\n<p>Recently I ran out of space on a 5 node Elasticsearch cluster.  Events were not being indexed, and Logstash had amassed a 10GB disk-backed queue.  It was not pretty<\/p>\n\n\n\n<p>I discovered that the fifth node was configured incorrectly and was  storing the ES data on one of the smaller disk partitions.  I stopped the Elasticsearch service on this node while I formulated a plan.<\/p>\n\n\n\n<p>Unfortunately, I didn&#8217;t have the time (or confidence) to move the entire <code>\/var<\/code> directory to the large partition (which happened to be serving the <code>\/home<\/code> folder: mounted as <code>\/dev\/mapper\/centos-home<\/code>), so I instead created a new folder at <code>\/home\/elasticsearch<\/code> (so it would be on the large partition), and &#8220;symlinked&#8221;<code>\/var\/elasticsearch<\/code> to the new home folder on the larger partition <code>ln -s \/home\/elasticsearch\/elasticsearch \/var\/lib\/elasticsearch<\/code><\/p>\n\n\n\n<p>After creating the Symlink, I started the Elasticsearch service, and watched the logs.  After some time, I noticed that there were still no primary shards assigned to this new nodes (despite it being the only node with disk space utilization below the threshold), so I dug in a bit more<\/p>\n\n\n\n<p>This is where I learned about <code> \/_cluster\/allocation\/explain <\/code> <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/cluster-allocation-explain.html\">which provides details about <strong>why<\/strong> certain shards may have an allocation problem<\/a>.  Ah ha!  After 5 failed attempts to unassigned shards to my new node, Elasticsearch just needed a little kick to re run the allocation process:  I opened up the Kibana console, and ran <code>POST \/_cluster\/reroute?retry_failed=true<\/code><a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/cluster-reroute.html\"> to force the algorithm to re-evaluate the location of shards<\/a><\/p>\n\n\n\n<p>Within about 90 seconds, the Elasticsearch cluster began rerouting all of the unassigned shards, and my logstash disk-queue began to shrink as the events poured into the freshly allocated shards on my new node.  <\/p>\n\n\n\n<p>Problem solved.   <\/p>\n\n\n\n<p>Stay tuned for next week when I pay off the technical debt incurred by placing my Elasticsearch shards on a symlink \ud83d\ude2c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I ran out of space on a 5 node Elasticsearch cluster. Events were not being indexed, and Logstash had amassed a 10GB disk-backed queue. It was not pretty I discovered that the fifth node was configured incorrectly and was storing the ES data on one of the smaller disk partitions. I stopped the Elasticsearch &hellip; <a href=\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Recovering from full Elasticsearch nodes<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[91],"tags":[240,244,210,25,243],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recovering from full Elasticsearch nodes - Charles&#039; Blog\" \/>\n<meta property=\"og:description\" content=\"Recently I ran out of space on a 5 node Elasticsearch cluster. Events were not being indexed, and Logstash had amassed a 10GB disk-backed queue. It was not pretty I discovered that the fifth node was configured incorrectly and was storing the ES data on one of the smaller disk partitions. I stopped the Elasticsearch &hellip; Continue reading Recovering from full Elasticsearch nodes &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/\" \/>\n<meta property=\"og:site_name\" content=\"Charles&#039; Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-10T19:22:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-02-10T19:24:34+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"crossan007\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\",\"url\":\"https:\/\/crossan007.dev\/blog\/\",\"name\":\"Charles&#039; Blog\",\"description\":\"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crossan007.dev\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/#webpage\",\"url\":\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/\",\"name\":\"Recovering from full Elasticsearch nodes - Charles&#039; Blog\",\"isPartOf\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\"},\"datePublished\":\"2020-02-10T19:22:26+00:00\",\"dateModified\":\"2020-02-10T19:24:34+00:00\",\"author\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\"},\"breadcrumb\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crossan007.dev\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Recovering from full Elasticsearch nodes\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\",\"name\":\"crossan007\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"caption\":\"crossan007\"},\"url\":\"https:\/\/crossan007.dev\/blog\/author\/crossan007\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/","og_locale":"en_US","og_type":"article","og_title":"Recovering from full Elasticsearch nodes - Charles&#039; Blog","og_description":"Recently I ran out of space on a 5 node Elasticsearch cluster. Events were not being indexed, and Logstash had amassed a 10GB disk-backed queue. It was not pretty I discovered that the fifth node was configured incorrectly and was storing the ES data on one of the smaller disk partitions. I stopped the Elasticsearch &hellip; Continue reading Recovering from full Elasticsearch nodes &rarr;","og_url":"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/","og_site_name":"Charles&#039; Blog","article_published_time":"2020-02-10T19:22:26+00:00","article_modified_time":"2020-02-10T19:24:34+00:00","twitter_misc":{"Written by":"crossan007","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/crossan007.dev\/blog\/#website","url":"https:\/\/crossan007.dev\/blog\/","name":"Charles&#039; Blog","description":"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crossan007.dev\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/#webpage","url":"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/","name":"Recovering from full Elasticsearch nodes - Charles&#039; Blog","isPartOf":{"@id":"https:\/\/crossan007.dev\/blog\/#website"},"datePublished":"2020-02-10T19:22:26+00:00","dateModified":"2020-02-10T19:24:34+00:00","author":{"@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979"},"breadcrumb":{"@id":"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crossan007.dev\/blog\/monitoring\/recovering-from-full-elasticsearch-nodes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crossan007.dev\/blog\/"},{"@type":"ListItem","position":2,"name":"Recovering from full Elasticsearch nodes"}]},{"@type":"Person","@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979","name":"crossan007","image":{"@type":"ImageObject","@id":"https:\/\/crossan007.dev\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","caption":"crossan007"},"url":"https:\/\/crossan007.dev\/blog\/author\/crossan007\/"}]}},"_links":{"self":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/706"}],"collection":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/comments?post=706"}],"version-history":[{"count":1,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/706\/revisions"}],"predecessor-version":[{"id":707,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/706\/revisions\/707"}],"wp:attachment":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/media?parent=706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/categories?post=706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/tags?post=706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}