빅데이터/Elasticsearch

window10+elasticsearch sample 실행 시 오류 curl: (1) Protocol "'http" not supported or disabled in libcurl

나쁜천사1004 2019. 10. 14. 11:24

window10+elasticsearch sample 아래 명령어를 실행시 아래와 같은 오류가 발생 하였다.

 

curl -XPUT 'http://localhost:9200/blog/user/dilbert' -H 'Content-Type: application/json' -d '{ "name" : "Dilbert Brown" }'

 

curl: (1) Protocol "'http" not supported or disabled in libcurl
curl: (6) Could not resolve host: name
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: Dilbert Brown
curl: (3) [globbing] unmatched close brace/bracket in column 1

 

원인은 'http -> "http 큰따옴표를 해야 오류가 발생 안한다.

 

그리고 데이터 부분도  '{ "name" : "Dilbert Brown" }' -> "{ ""name"" : ""Dilbert Brown"" }" 이렇게 안하면 

아래와 같은 오류 발생

 

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}curl: (6) Could not resolve host: name
curl: (3) Bad URL, colon is first character
curl: (3) [globbing] unmatched close brace/bracket in column 14

 

 

결국 아래와 같이 생행해야 성공

 

curl -XPUT "http://localhost:9200/blog/user/dilbert" -H "Content-Type: application/json" -d "{ ""name"" : ""Dilbert Brown""}"

 

반응형