Jade Han
Jade Han

Reputation: 1285

when I network.bind_host: localhost , it doesn't working

I install elasticsearch in aws ubuntu 14.04

install document

i change some settings in elasticsearch.yml

elasticsearch.yml

#network.bind_host: 192.168.0.1

to

network.bind_host: localhost

the document told me localhost is good at secure

when I start elasticsearch

sudo service elasticsearch restart

* Stopping Elasticsearch Server                                              [ OK ]
* Starting Elasticsearch Server

and when I send curl

sudo curl -X GET 'http://localhost:9200'

curl: (7) Failed to connect to localhost port 9200: Connection refused

so I change network.bind_host

network.bind_host: 0.0.0.0

and

sudo curl -X GET 'http://localhost:9200'

{
  "status" : 200,
  "name" : "****",
  "cluster_name" : "elasticsearch_***",
  "version" : {
    "number" : "1.7.2",
    "build_hash" : "e12r1r33r3fs593f7202acbd816e8ec",
    "build_timestamp" : "2015-09-14T09:49:53Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

but I think 0.0.0.0 is so danger when i product my web site

please somebody help me?

Upvotes: 0

Views: 1182

Answers (1)

Kulasangar
Kulasangar

Reputation: 9434

My guess is that you should be having your network.host set to localhost or 127.0.0.1 within your elasticsearch yml.

network.host: localhost <-- try 127.0.0.1 as well

Normally the network.bind_host binds to your network.host by default. You could have a look at this maybe for more details.

And just in case, try adding the http.port as well, so that you could make sure that you could access the ES port, which could look something like this.

http.port: 9200

Hope it helps!

Upvotes: 1

Related Questions