Curl: (6) Couldn't resolve host ''


(Alice) #1

Elasticsearch version:5.5.2
OS version: Suse Linux

When I create a index and its mapping with the command line as follow :

curl -XPUT http://10.62.179.32:9200/shakespeare -d ' {
"mappings" : {
"default" : {
"properties" : {
"speaker" : {"type": "string", "index" : "not_analyzed" },
"play_name" : {"type": "string", "index" : "not_analyzed" },
"line_id" : { "type" : "integer" },
"speech_number" : { "type" : "integer"
}
}
}
}
} ';
But It throws a error like this:
curl: (6) Couldn't resolve host 'l0.62.179.32'
Could anyone can give me any advice?


(Mark Walkom) #2

Is that the exact error?

If not please copy and paste the command with the error and then use the code format tags - </> - to made it properly formatted.


(Alice) #3

Sorry, I can't find any format error.


(David Pilato) #4
} ';

Remove ;

What are your elasticsearch logs?
Are you running that from the same LAN as your elasticsearch node? 10.x is a private IP.


(Alice) #5

When I remove ;, it still throws the same error.


(David Pilato) #6

Can you answer the other questions I asked?


(Alice) #7

Of course, the network.host in elasticsearch.yml of the node is 10.62.179.32. And I run the command line in the 10.62.179.32 server, So I think they are in the same LAN.


(poojagupta) #8

@saliormoon As it seems that there is an issue for resolving host issue.
unable to resolving host on which you are running Elasticsearch.

Your curl request is getting failed due to this. Firstly check you are able to access elasticsearch url.
Via following command:
curl http://ElastisearchIP:9200
if it is getting error then issue is with your host .
for this make an entry in /etc/hosts also.
Please share Elasticsearch logs for better understanding.


(Alice) #9

Ok, thanks a lot.


(system) #10

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