# File Based Discovery plugin not working

**URL:** <https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150>\
**Category:** Elasticsearch\
**Created:** [March 10, 2017, 1:28pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150 "2017-03-10T13:28:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mormaii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mormaii/32/10790_2.png) [@Mormaii](https://discuss.elastic.co/u/Mormaii)\
**Post date:** [March 10, 2017, 1:28pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/1 "2017-03-10T13:28:45Z")

</div>

I'm trying to set up an elasticsearch cluster with docker containers with marathon on mesos and I'm trying to use the file based discovery. I have a cronjob that runs every 1 minute and updates the file with the list of hosts. The problem is this only works once, it doesn't update dynamically as the documentation here says: [https://www.elastic.co/guide/en/elasticsearch/plugins/current/discovery-file.html](https://www.elastic.co/guide/en/elasticsearch/plugins/current/discovery-file.html)

"Anytime a change is made to the unicast\_hosts.txt file, even as Elasticsearch continues to run, the new changes will be picked up by the plugin and the new hosts list will be used for the next pinging round for master election."

^ This is the part that isn't working at all.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 10, 2017, 2:56pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/2 "2017-03-10T14:56:31Z")

</div>

How do you know that it's not working?  
What should happen on your nodes when this file is updated?

I mean: you started some nodes, then update the file, starting new ones then kill all the old ones or something like this?

Or you called an API to check that?

---

<div class="post-metadata">

**Author:** ![Mormaii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mormaii/32/10790_2.png) [@Mormaii](https://discuss.elastic.co/u/Mormaii)\
**Post date:** [March 10, 2017, 3:31pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/3 "2017-03-10T15:31:40Z")

</div>

I have a marathon job that has 3 nodes. Each node has a cron job that updates the file dynamically. First, none of the nodes form a cluster. I scale down to 2 nodes, the file gets updated, no cluster still.

Even with scaling up again to 5 nodes, the file gets updated with all of the new IPs but still elasticsearch doesn't try to form a cluster with them. I know my connectivity works because if I use the regular unicast host list they work so I'm almost 100% sure it's the plugin not working.

Not sure if this is relevant or not but I'm running elasticsearch on the alpine based docker container from the official docker hub.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 10, 2017, 3:49pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/4 "2017-03-10T15:49:11Z")

</div>

> [@Mormaii](#):
>
> First, none of the nodes form a cluster.

That's the problem you need to solve I think.

It's unrelated to the file based discovery plugin IMO.

Can you start a first node, then add a second one and share the logs?  
Also sharing your `elasticsearch.yml` file could help.

---

<div class="post-metadata">

**Author:** ![Mormaii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mormaii/32/10790_2.png) [@Mormaii](https://discuss.elastic.co/u/Mormaii)\
**Post date:** [March 10, 2017, 4:06pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/5 "2017-03-10T16:06:35Z")

</div>

Here's the logs from the both of the nodes and the config file. [http://pastebin.com/H9NPqJC0](http://pastebin.com/H9NPqJC0)

I turned one on, waited a bit, turned another on, the list got updated with the new node yet they still don't form a cluster.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 10, 2017, 4:59pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/6 "2017-03-10T16:59:04Z")

</div>

Can you change the log level to DEBUG for `org.elasticsearch.discovery.file` package?

---

<div class="post-metadata">

**Author:** ![Mormaii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mormaii/32/10790_2.png) [@Mormaii](https://discuss.elastic.co/u/Mormaii)\
**Post date:** [March 10, 2017, 5:17pm UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/7 "2017-03-10T17:17:57Z")

</div>

> [@dadoonet](#):
>
> org.elasticsearch.discovery.file

How can I do that specifically for the discovery plugin? I know how to change it to debug using config/log4j2.properties but I'm not sure if it's what you're asking for.

`rootLogger.level = info` to debug?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 11, 2017, 12:06am UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/8 "2017-03-11T00:06:40Z")

</div>

I "think" you can run:

```auto
PUT /_cluster/settings
{
    "transient" : {
        "logger.org.elasticsearch.discovery.file" : "DEBUG"
    }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 8, 2017, 12:06am UTC](https://discuss.elastic.co/t/file-based-discovery-plugin-not-working/78150/9 "2017-04-08T00:06:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
