# Javascrip api request don't work when I change the cluster name

**URL:** <https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460>\
**Category:** Elasticsearch\
**Created:** [January 29, 2016, 10:00am UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460 "2016-01-29T10:00:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gjanger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gjanger/32/5594_2.png) [@Gjanger](https://discuss.elastic.co/u/Gjanger)\
**Post date:** [January 29, 2016, 10:00am UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460/1 "2016-01-29T10:00:54Z")

</div>

hi,

If I change the cluster name of elasticseach from "elasticsearch" to something else then the javascript API cannotspeak to ES anymore.  
Kibana can't too by the way.

I'm not dinfing anything related to the cluster name in the API documentation.

I initialise my client this way :  
`module.exports = function(conf) { return new elasticsearch.Client({ host: conf.hostName + ':' + conf.port, log: conf.logLevel, apiVersion: conf.apiVersion }); };`

this is the conf :

`module.exports = {  
hostName: 'localhost',  
port: '9200',  
logLevel: 'debug',  
apiVersion: '2.1'  
}

`

Any idea?

Thanks.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 29, 2016, 10:28am UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460/2 "2016-01-29T10:28:25Z")

</div>

Are you still able to send HTTP requests directly to the cluster via e.g. curl?

---

<div class="post-metadata">

**Author:** ![Gjanger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gjanger/32/5594_2.png) [@Gjanger](https://discuss.elastic.co/u/Gjanger)\
**Post date:** [January 29, 2016, 2:08pm UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460/3 "2016-01-29T14:08:56Z")

</div>

Well the problem was coming from logstash I had to add : cluster =\> MyClusterName in the configuration file.  
Without doing it the data was send into ES but only worked once I renamed the clustername to elasticsearch.

This is **not** specified in logstash documentation : [https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 29, 2016, 2:13pm UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460/4 "2016-01-29T14:13:51Z")

</div>

I am confused. What does Logstash got to do with the Kibana and JavaScript API you were having problems with? Which version of Logstash are you using?

---

<div class="post-metadata">

**Author:** ![Gjanger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gjanger/32/5594_2.png) [@Gjanger](https://discuss.elastic.co/u/Gjanger)\
**Post date:** [January 29, 2016, 2:23pm UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460/5 "2016-01-29T14:23:24Z")

</div>

I put my clustername to "somethingRandom", and insert data with logstash forwarder and logstash.  
Then kibana say that it cannot find anything  
When I make a request from the Javascript API my node-js server goes in some sort of infinite loop and the request is being log hundreds of times per second.

If I close everything, change the clustername back to "elasticsearch" then everything is working fine, without inserting anything new the data which I inserted when my cluster was named "somethingRandom" are accessible.

that is why I though that there was no problem from logstash, just that kibana and the JSapi needed the new cluster name.

I'm using logstash-1.5.4

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 29, 2016, 2:35pm UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460/6 "2016-01-29T14:35:00Z")

</div>

The logstash link you are looking at is for the current version, not [Logstash 1.5.4](https://www.elastic.co/guide/en/logstash/1.5/plugins-outputs-elasticsearch.html) . For version 2.x of Logstash, the Elasticsearch output plugin changed to use HTTP protocol by default, and the settings and configuration options therefore changed. If you are using the HTTP protocol, you do not need to specify any cluster name, so I do not understand why Kibana would have an issue with a changed cluster name.

---

<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:** [July 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/javascrip-api-request-dont-work-when-i-change-the-cluster-name/40460/7 "2017-07-05T23:20:21Z")

</div>


