# Not able to set shard allocation filtering in metricbeat template

**URL:** https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405
**Category:** Beats
**Tags:** metricbeat
**Created:** [April 18, 2019, 6:54am UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405 "2019-04-18T06:54:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![shshnk28](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@shshnk28](https://discuss.elastic.co/u/shshnk28)
#### Post date: [April 18, 2019, 6:54am UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405/1 "2019-04-18T06:54:14Z")

</div>

I am running a 8 node cluster (ES 6.7.0) of which one node I am using solely for the purpose of monitoring other 7 nodes. The node name for this lets say is **monitoring**. Now I am trying to monitor other nodes using x-pack (free version). The x -pack creates daily indices. My requirement is that I want these indices which are created by x-pack to have just one shard and no replica and I want the shard to reside on the **monitoring** node only. To achieve this I am updating the **.monitoring-es** template with following curl request.

```auto
curl -X PUT "localhost:9205/_template/.monitoring-es" -H 'Content-Type: application/json' -d'
{
    "index_patterns" : [".monitoring-es-6-*"],
    "settings" : {
        "index.routing.allocation.include.type" : "monitoring",
        "number_of_shards" : 1,
        "number_of_replicas" : 0
    }
}
' 

```

Shard and replica settings are taking effect. But the routing settings are not taking effect. The daily shards are being created on different nodes. How can I tie down the monitoring shard to just one node?

---

<div class="post-metadata">

### Author: ![Mike\_Place](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_place/32/39555_2.png) [@Mike\_Place](https://discuss.elastic.co/u/Mike_Place)
#### Post date: [April 23, 2019, 11:11am UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405/2 "2019-04-23T11:11:53Z")

</div>

Hi @shshnk28.

Typically, users set up an independent monitoring cluster to monitoring the Elastic Stack and this is the configuration that Elastic recommends. From what you're describing, though, it sounds like you're trying to use a single cluster where one node monitors the rest of the others? Is there a specific reason that you don't want to use an independent monitoring cluster?

Best,

-Mike

---

<div class="post-metadata">

### Author: ![shshnk28](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@shshnk28](https://discuss.elastic.co/u/shshnk28)
#### Post date: [April 23, 2019, 11:36am UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405/3 "2019-04-23T11:36:53Z")

</div>

Thanks @Mike_Place for your response, Yes my monitoring node lies in the same cluster. I am trying x-pack monitoring for my nodes. In the x-pack monitoring that comes with the basic license we can only monitor the cluster in which the monitoring node lies. So I had to put this node in the production cluster.

---

<div class="post-metadata">

### Author: ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)
#### Post date: [April 23, 2019, 12:27pm UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405/4 "2019-04-23T12:27:58Z")

</div>

Can you share your `config/elasticsearch.yml` for your monitoring node?

---

<div class="post-metadata">

### Author: ![Mike\_Place](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_place/32/39555_2.png) [@Mike\_Place](https://discuss.elastic.co/u/Mike_Place)
#### Post date: [April 23, 2019, 12:42pm UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405/5 "2019-04-23T12:42:29Z")

</div>

Hi @shshnk28.

With the basic license, you can actually set up a separate cluster and use it to store your monitoring data. Just now, @shaunak did a quick test with the following steps and confirmed that it does work as expected:

```auto
1. Run a dedicated ES cluster for monitoring data, `esmon`
2. Run a separate ES cluster for production data, `esprod`
3. Set `xpack.monitoring.elasticsearch.hosts` in `kibana.yml` to point to an `esmon` node's HTTP address.
4. Setup an `http` exporter on `esprod` to forward data to `esmon`

```

Did you try to set up a separate cluster and if so, did you encounter an error?

---

<div class="post-metadata">

### Author: ![shshnk28](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@shshnk28](https://discuss.elastic.co/u/shshnk28)
#### Post date: [April 25, 2019, 4:05am UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405/6 "2019-04-25T04:05:33Z")

</div>

I have actually got busy with some other task at hand. Will try out the settings recommended by @Mike_Place soon. I did encounter an error while trying to setup a separate cluster. Not able to fetch the error now since I have moved away from that setup.

---

<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: [May 23, 2019, 4:05am UTC](https://discuss.elastic.co/t/not-able-to-set-shard-allocation-filtering-in-metricbeat-template/177405/7 "2019-05-23T04:05:34Z")

</div>

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