NoSQL/Elasticsearch

x-pack 설정시 client 접근 방법

세모데 2017. 3. 23. 19:12

1. HTTP/REST Clients


모든 요청 헤더에 아래와 같이 인증 정보 추가 


Authorization: Basic <TOKEN>    => TOKEN is base64 of username:password



* CRUL 사용시


curl --user rdeniro:taxidriver -XPUT 'localhost:9200/idx'



2.  Python Clients


from elasticsearch import Elasticsearch


# you can use RFC-1738 to specify the url

es = Elasticsearch(['https://user:secret@localhost:443'])



3. Javascript Clients


var client = new elasticsearch.Client({

  host: 'https://user:password@my-site.com:9200'

})