diff --git a/.circleci/config.yml b/.circleci/config.yml index 326a058..b63cb1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: '2' jobs: build: docker: - - image: ubuntu:yakkety + - image: ubuntu:xenial working_directory: ~/code steps: - setup_remote_docker diff --git a/elasticsearch_collectd.py b/elasticsearch_collectd.py index 05f8b02..b223925 100755 --- a/elasticsearch_collectd.py +++ b/elasticsearch_collectd.py @@ -1019,6 +1019,10 @@ def detect_es_master(self): cluster_state = self.fetch_url(self.es_url_scheme + "://" + self.es_host + ":" + str(self.es_port) + "/_cluster/state/master_node") + if cluster_state is None: + self.es_current_master = False + return + if self.es_current_master is False \ and cluster_state['master_node'] == self.node_id: self.es_current_master = True