Custom Search

Sunday, November 4, 2018

Python ElasticSearch How to get cluster health

from elasticsearch import Elasticsearch

HOST_URLS = ["http://127.0.0.1:9200"]
es_conn = Elasticsearch(HOST_URLS)


es_conn.cluster.health()

{u'status': u'yellow', u'number_of_nodes': 1, u'unassigned_shards': 5, u'number_of_pending_tasks': 0, u'number_of_in_flight_fetch': 0, u'timed_out': False, u'active_primary_shards': 6, u'task_max_waiting_in_queue_millis': 0, u'cluster_name': u'elasticsearch', u'relocating_shards': 0, u'active_shards_percent_as_number': 54.54545454545454, u'active_shards': 6, u'initializing_shards': 0, u'number_of_data_nodes': 1, u'delayed_unassigned_shards': 0}

http://127.0.0.1:9200/_cluster/health




No comments:

Post a Comment