0
votes

I'm running Elasicsearch (floragunncom/sg-elasticsearch:7.0.1-oss-35.0.0) on kubernetes cluster(v1.18 - kind).

I've assigned each Elasticsearch data node (ie. pod) with 200Mi of PVC as storage. But when the elasticseach cluster(3 master, 3 data, 2 ingest) is up, it is showing the following warning message:

{"type": "server", "timestamp": "2020-07-20T06:27:14,354+0000", "level": "WARN", "component": "o.e.c.r.a.DiskThresholdMonitor", "cluster.name": "topology-es", "node.name": "master-topology-es-1", "cluster.uuid": "U0Yf6tiJSHC57R_QHa2qiw", "node.id": "tDet2llLQaydoxfYT4TcpQ", "message": "high disk watermark [90%] exceeded on [C-TUE5_cR1ihqrhThpWnsg][data-topology-es-1][/usr/share/elasticsearch/data/nodes/0] free: 5.5gb[7%], shards will be relocated away from this node" }

  • Where is this 5.5gb[7%] coming from?

I aslo checked the shard's status:

$ curl -XGET "https://localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason" -u "admin:XXXXX" --insecure
searchguard 0 p STARTED    
searchguard 0 r UNASSIGNED REPLICA_ADDED
searchguard 0 r UNASSIGNED REPLICA_ADDED
  • If 200Mi is not enough, then how comes the primary shard is successfully assigned in data-node-0 but the replicas are not in data-node-1 and data-node-2 respectively?

Update:

$ curl -XGET "https://localhost:9200/_nodes/stats/fs?pretty" -u "admin:XXXX" --insecure
{
  "_nodes" : {
    "total" : 8,
    "successful" : 8,
    "failed" : 0
  },
  "cluster_name" : "topology-es",
  "nodes" : {
    "jYkduRCmQ2GEHMn2DeBrxg" : {
      "timestamp" : 1595231421976,
      "name" : "data-topology-es-0",
      "transport_address" : "10.244.0.59:9300",
      "host" : "10.244.0.59",
      "ip" : "10.244.0.59:9300",
      "roles" : [
        "data"
      ],
      "fs" : {
        "timestamp" : 1595231421989,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 77306,
              "read_operations" : 7745,
              "write_operations" : 69561,
              "read_kilobytes" : 230532,
              "write_kilobytes" : 500284
            }
          ],
          "total" : {
            "operations" : 77306,
            "read_operations" : 7745,
            "write_operations" : 69561,
            "read_kilobytes" : 230532,
            "write_kilobytes" : 500284
          }
        }
      }
    },
    "N7ql_AneQoa6w8yvgBhYZg" : {
      "timestamp" : 1595231421977,
      "name" : "client-topology-es-0",
      "transport_address" : "10.244.0.49:9300",
      "host" : "10.244.0.49",
      "ip" : "10.244.0.49:9300",
      "roles" : [
        "ingest"
      ],
      "fs" : {
        "timestamp" : 1595231421981,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 84052,
              "read_operations" : 7853,
              "write_operations" : 76199,
              "read_kilobytes" : 231804,
              "write_kilobytes" : 565340
            }
          ],
          "total" : {
            "operations" : 84052,
            "read_operations" : 7853,
            "write_operations" : 76199,
            "read_kilobytes" : 231804,
            "write_kilobytes" : 565340
          }
        }
      }
    },
    "gse01W_XR7qKvZPHPq7n7g" : {
      "timestamp" : 1595231421984,
      "name" : "master-topology-es-2",
      "transport_address" : "10.244.0.57:9300",
      "host" : "10.244.0.57",
      "ip" : "10.244.0.57:9300",
      "roles" : [
        "master"
      ],
      "fs" : {
        "timestamp" : 1595231421993,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 77627,
              "read_operations" : 7747,
              "write_operations" : 69880,
              "read_kilobytes" : 230560,
              "write_kilobytes" : 504608
            }
          ],
          "total" : {
            "operations" : 77627,
            "read_operations" : 7747,
            "write_operations" : 69880,
            "read_kilobytes" : 230560,
            "write_kilobytes" : 504608
          }
        }
      }
    },
    "bBNEuz2pSkWeOUmDIowEDQ" : {
      "timestamp" : 1595231421991,
      "name" : "client-topology-es-1",
      "transport_address" : "10.244.0.51:9300",
      "host" : "10.244.0.51",
      "ip" : "10.244.0.51:9300",
      "roles" : [
        "ingest"
      ],
      "fs" : {
        "timestamp" : 1595231421995,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 82173,
              "read_operations" : 7788,
              "write_operations" : 74385,
              "read_kilobytes" : 231144,
              "write_kilobytes" : 546544
            }
          ],
          "total" : {
            "operations" : 82173,
            "read_operations" : 7788,
            "write_operations" : 74385,
            "read_kilobytes" : 231144,
            "write_kilobytes" : 546544
          }
        }
      }
    },
    "-hwsv3rqQeSVdfOsKqzrwA" : {
      "timestamp" : 1595231422013,
      "name" : "master-topology-es-0",
      "transport_address" : "10.244.0.53:9300",
      "host" : "10.244.0.53",
      "ip" : "10.244.0.53:9300",
      "roles" : [
        "master"
      ],
      "fs" : {
        "timestamp" : 1595231422080,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 79542,
              "read_operations" : 7762,
              "write_operations" : 71780,
              "read_kilobytes" : 230792,
              "write_kilobytes" : 521656
            }
          ],
          "total" : {
            "operations" : 79542,
            "read_operations" : 7762,
            "write_operations" : 71780,
            "read_kilobytes" : 230792,
            "write_kilobytes" : 521656
          }
        }
      }
    },
    "C-TUE5_cR1ihqrhThpWnsg" : {
      "timestamp" : 1595231421984,
      "name" : "data-topology-es-1",
      "transport_address" : "10.244.0.61:9300",
      "host" : "10.244.0.61",
      "ip" : "10.244.0.61:9300",
      "roles" : [
        "data"
      ],
      "fs" : {
        "timestamp" : 1595231422003,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 77169,
              "read_operations" : 7736,
              "write_operations" : 69433,
              "read_kilobytes" : 230396,
              "write_kilobytes" : 498544
            }
          ],
          "total" : {
            "operations" : 77169,
            "read_operations" : 7736,
            "write_operations" : 69433,
            "read_kilobytes" : 230396,
            "write_kilobytes" : 498544
          }
        }
      }
    },
    "zlL7F5kRTLWWogzffZXomA" : {
      "timestamp" : 1595231422000,
      "name" : "data-topology-es-2",
      "transport_address" : "10.244.0.63:9300",
      "host" : "10.244.0.63",
      "ip" : "10.244.0.63:9300",
      "roles" : [
        "data"
      ],
      "fs" : {
        "timestamp" : 1595231422001,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 77048,
              "read_operations" : 7736,
              "write_operations" : 69312,
              "read_kilobytes" : 230396,
              "write_kilobytes" : 496864
            }
          ],
          "total" : {
            "operations" : 77048,
            "read_operations" : 7736,
            "write_operations" : 69312,
            "read_kilobytes" : 230396,
            "write_kilobytes" : 496864
          }
        }
      }
    },
    "tDet2llLQaydoxfYT4TcpQ" : {
      "timestamp" : 1595231421993,
      "name" : "master-topology-es-1",
      "transport_address" : "10.244.0.55:9300",
      "host" : "10.244.0.55",
      "ip" : "10.244.0.55:9300",
      "roles" : [
        "master"
      ],
      "fs" : {
        "timestamp" : 1595231422020,
        "total" : {
          "total_in_bytes" : 84054204416,
          "free_in_bytes" : 10231291904,
          "available_in_bytes" : 5917450240
        },
        "data" : [
          {
            "path" : "/usr/share/elasticsearch/data/nodes/0",
            "mount" : "/usr/share/elasticsearch/data (/dev/sda3)",
            "type" : "ext4",
            "total_in_bytes" : 84054204416,
            "free_in_bytes" : 10231291904,
            "available_in_bytes" : 5917450240
          }
        ],
        "io_stats" : {
          "devices" : [
            {
              "device_name" : "sda3",
              "operations" : 77766,
              "read_operations" : 7748,
              "write_operations" : 70018,
              "read_kilobytes" : 230576,
              "write_kilobytes" : 505892
            }
          ],
          "total" : {
            "operations" : 77766,
            "read_operations" : 7748,
            "write_operations" : 70018,
            "read_kilobytes" : 230576,
            "write_kilobytes" : 505892
          }
        }
      }
    }
  }
}
2
What do you get when you run this GET _nodes/stats/fs ?Val
@Val, updated my question. Please take a look.Kamol Hasan
@KamolHasan it has been a long time that you have not accepted and upvoted my answer, it would be great if u can accept and upvote the answer if your issue is resolveduser156327
@opsterelasticsearchninja, Thank you so much for your answer. It was helpful. Hence I upvoted it. But It didn’t solve my problem. I added the reason in another answer.Kamol Hasan
@KamolHasan oh ok, thanks, glad i was helpfuluser156327

2 Answers

1
votes

This is filesystem statistics for the master node C-TUE5_cR1ihqrhThpWnsg taken from the _nodes/stats output:

    "total" : {
      "total_in_bytes" : 84054204416,
      "free_in_bytes" : 10231291904,
      "available_in_bytes" : 5917450240
    },

As you can see 5917450240 / 84054204416 = ~7%, so the storage space on that node is 93% full, hence why you're getting that warning.

1
votes

So, here is my problem: I've assigned storage of 200Mi to each Elasticsearch data node via PVC. When I checked the _nodes/stats:

 "total" : {
      "total_in_bytes" : 84054204416, <-- ~84Gi
      "free_in_bytes" : 10231291904,
      "available_in_bytes" : 5917450240
    },

So, the expected value should be 200Mi instead of ~84Gi.

Explanation:

Since I'm in kind cluster. The default storage is provisioned by hostpath and we get a directory mounted from the host, not a separate file system.

And kind uses rancher/local-path-provisioner, and the current limitation of using it are:

- No support for the volume capacity limit currently.
    - The capacity limit will be ignored for now.

That's why I was getting ~84Gi (host) instead of 200Mi (assigned via PVC).