# Single Node Cluster

**URL:** <https://discuss.elastic.co/t/single-node-cluster/172095>\
**Category:** Elasticsearch\
**Created:** [March 13, 2019, 9:19am UTC](https://discuss.elastic.co/t/single-node-cluster/172095 "2019-03-13T09:19:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![srirama](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@srirama](https://discuss.elastic.co/u/srirama)\
**Post date:** [March 13, 2019, 9:19am UTC](https://discuss.elastic.co/t/single-node-cluster/172095/1 "2019-03-13T09:19:17Z")

</div>

In my local elastic setup, if I set the setting  
`discovery.zen.ping.multicast.enabled: false`  
Elastic is not coming up.

After checking [https://github.com/elastic/elasticsearch/issues/22909](https://github.com/elastic/elasticsearch/issues/22909), I removed the setting.

Now, how to make the single node cluster?  
Below are my elasticsearch.yml contents.

```auto
cluster.name: my_cluster
node.name: node-1

```

If try to access any index with out cluster.name appended it is working.  
However if I append it, then I am getting index not found error.

What are the configuration changes need to be done, in order to access the index with cluster.name appended, any information is helpful.

My use case is to check my application how does it fair with cluster queries.

My Shards count is default of 5.

I am using ELK Version:5.4.0

Below is my cluster health report

```auto
curl -XGET http://localhost:9200/_cluster/health?pretty=true
{
  "cluster_name" : "my_cluster",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 5,
  "active_shards" : 5,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 5,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 50.0
}

```

I need to make single node cluster up and running for local testing purpose.

After checking this link [https://stackoverflow.com/questions/19967472/elasticsearch-unassigned-shards-how-to-fix](https://stackoverflow.com/questions/19967472/elasticsearch-unassigned-shards-how-to-fix), I turned the cluster state from yellow to green by executing the below

```auto
curl -XPUT 'localhost:9200/_settings' -d '
{
    "index" : {
        "number_of_replicas" : 0
    }
}'

```

Below is my latest cluster state,

```auto
curl -XGET http://localhost:9200/_cluster/health?pretty=true
{
  "cluster_name" : "my_cluster",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 5,
  "active_shards" : 5,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

```

Still I am unable to access the index with cluster.name prefixed.

```auto
http://127.0.0.1:9200/my_cluster:hello_cluster/ 

```

I am new to ELASTIC, am I doing some thing incorrect here?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 13, 2019, 10:09am UTC](https://discuss.elastic.co/t/single-node-cluster/172095/2 "2019-03-13T10:09:33Z")

</div>

> [@srirama](#):
>
> If try to access any index with out cluster.name appended it is working.  
> However if I append it, then I am getting index not found error.

This is the expected behaviour. The URI you want is `http://127.0.0.1:9200/<INDEX NAME>`, there's no cluster name in there. Can you explain why you think this should work? It is mentioned in some documentation somewhere, for instance?

---

<div class="post-metadata">

**Author:** ![srirama](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@srirama](https://discuss.elastic.co/u/srirama)\
**Post date:** [March 13, 2019, 10:23am UTC](https://discuss.elastic.co/t/single-node-cluster/172095/3 "2019-03-13T10:23:05Z")

</div>

As per the cross cluster search ([https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cross-cluster-search.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cross-cluster-search.html)), the cluster search required cluster.name need to be prefixed.  
So I created single cluster and prefixing the cluster.name to index name and doing the search as below.

```auto
http://127.0.0.1:9200/my_cluster:hello_cluster/

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 13, 2019, 10:48am UTC](https://discuss.elastic.co/t/single-node-cluster/172095/4 "2019-03-13T10:48:29Z")

</div>

The documentation you linked pertains to cross-cluster search: it is for when you have multiple clusters and you want to search across them all at once. It doesn't sound like this is what you are trying to do. If you are trying this out then, as it says [at the top](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cross-cluster-search.html#_using_cross_cluster_search):

> Cross-cluster search requires [configuring remote clusters](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-remote-clusters.html).

---

<div class="post-metadata">

**Author:** ![srirama](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@srirama](https://discuss.elastic.co/u/srirama)\
**Post date:** [March 13, 2019, 11:28am UTC](https://discuss.elastic.co/t/single-node-cluster/172095/5 "2019-03-13T11:28:58Z")

</div>

Ok, what I thought was, ELK knows the cluster details to which we are sending the request, Hence I appended the home cluster name and verifying (similar to remote clusters).

So the cluster to which we are sending the request, that cluster name should not be prefixed (some thing like home cluster) and need to add the names for the remote clusters alone (if required to be searched for).

Or alternatively can we configure in ELASTIC, all the clusters information (including home cluster and remote clusters) in all the clusters. Does this work? Does it proper to configure? Some thing like below,

```auto
PUT http://127.0.0.1:9200/_cluster/settings
Accept: */*
Cache-Control: no-cache
Content-type: application/json

{
  "persistent": {
    "search.remote": {
      "my_cluster": {
        "seeds": ["127.0.0.1:9300"]
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 13, 2019, 11:46am UTC](https://discuss.elastic.co/t/single-node-cluster/172095/6 "2019-03-13T11:46:57Z")

</div>

I'm confused about what you're trying to achieve. You access local indices with `http://127.0.0.1:9200/<INDEX NAME>`. If you have multiple clusters and have configured cross-cluster search correctly then you access remote indices by including the name of the remote cluster. But you seem to want to access local indices as if they were remote ones?

---

<div class="post-metadata">

**Author:** ![srirama](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@srirama](https://discuss.elastic.co/u/srirama)\
**Post date:** [March 13, 2019, 12:45pm UTC](https://discuss.elastic.co/t/single-node-cluster/172095/7 "2019-03-13T12:45:01Z")

</div>

Ok. I want my elk cluster search query URI format to be unique be it local or remote cluster. Some thing like below,

`http://127.0.0.1:9200/HomeCluster:<INDEX NAME>,RemoteCluster:<INDEX NAME>/_search`

Hence the concern.

---

<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 10, 2019, 12:45pm UTC](https://discuss.elastic.co/t/single-node-cluster/172095/8 "2019-04-10T12:45:20Z")

</div>

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