Elasticsearch 설치 및 기본 활용
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Elasticsearch 설치 및 기본 활용

  • 6,276 views
Uploaded on

엘라스틱서치 기본 활용 강좌입니다.

엘라스틱서치 기본 활용 강좌입니다.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • @dhrim 감사드립니다. :) 저도 아직 배워가는 과정에 있습니다. Elasticsearch 많은 활용 부탁드리겠습니다.
    Are you sure you want to
    Your message goes here
  • 좋은 내용을 소개하고 공유해주셔서 감사합니다.
    Are you sure you want to
    Your message goes here
  • OKJSP 참석했던 임도형입니다.
    Elasticsearch에 감탄했습니다. 간단하고, 깔끔하고, 쉽고.
    감사합니다.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
6,276
On Slideshare
1,852
From Embeds
4,424
Number of Embeds
24

Actions

Shares
Downloads
24
Comments
3
Likes
5

Embeds 4,424

http://www.elasticsearch.org 2,446
http://elasticsearch.kr 1,696
http://feedly.com 99
http://digg.com 38
http://www.elasticsearch.com 36
http://elasticsearch.or.kr 31
http://www.newsblur.com 27
http://newsblur.com 16
http://candoitsoft.kr 7
http://www.feedspot.com 6
http://www.inoreader.com 5
http://ec2-54-199-167-213.ap-northeast-1.compute.amazonaws.com 4
http://beta.bazqux.com 2
http://new.elasticsearch.com 1
http://webcache.googleusercontent.com 1
http://feedmark.me 1
http://54.199.167.213 1
http://feeds.feedburner.com 1
http://127.0.0.1 1
https://reader.aol.com 1
http://reader.aol.com 1
http://inoreader.com 1
http://plus.url.google.com 1
http://www.hanrss.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. ELASTICSEARCH 김종민 E-mail : kimjmin@gmail.com Blog : http://kimjmin.net Twitter : @kimjmin
  • 2. Elasticsearch • Schema-free • Distributed & horizontally scalable • Restful API • JSON Document based • Open Source : Apache License 2.0 • Written in Java • Apache Lucene.
  • 3. Elasticsearch 1분만에 설치하기 • wget https://download.elasticsearch.org/ ... /elasticsearch- 1.0.1.tar.gz http://www.elasticsearch.org/download/ • tar –xvfz elasticsearch-1.0.1.tar.gz • cd elasticsearch-1.0.1 • bin/elasticsearch [-d]
  • 4. 살아있는지 체크 (curl & 브라우저) $ curl localhost:9200 { "status" : 200, "name" : "Arcade", "version" : { "number" : "1.0.1", "build_hash" : "5c03844e1978e5cc924dab2a423dc63ce881c42b", "build_timestamp" : "2014-02-25T15:52:53Z", "build_snapshot" : false, "lucene_version" : "4.6" }, "tagline" : "You Know, for Search" }
  • 5. 데이터 구조 관계 DB Elasticsearch Database Index Table Type Row Document Column Field Schema Mapping
  • 6. 데이터 입력 • curl -XPUT host:port/<인덱스>/<타입>/[id] $ curl -XPUT localhost:9200/books/book/1 -d ' { "title" : "Elasticsearch Guide ", "author" : "Kim", "started" : "2014-03-14", "pages" : 250 }' {"_index":"books","_type":"book","_id":"1","_version":1,"created":true}
  • 7. 데이터 수정 • 동일한 Index/Type/ID 로 데이터 입력 $ curl -XPUT localhost:9200/books/book/1 -d ' { "title" : "Elasticsearch Guide", "author" : ["Kim", "Lee"], "started" : "2014-03-14", "pages" : 250 }' {"_index":"books","_type":"book","_id":"1","_version":2,"created":false}
  • 8. 데이터 확인 $ curl -XGET localhost:9200/books/book/1 {"_index":"books","_type":"book","_id":"1","_version":2,"found":true, "_source" : { "title" : "Elasticsearch Guide", "author" : ["Kim", "Lee"], "started" : "2014-03-14", "pages" : 250 } }
  • 9. 데이터 삭제 $ curl -XDELETE localhost:9200/books/book/1 {"found":true,"_index":"books","_type":"book","_id":"1","_version":3}
  • 10. URI 검색 $ curl –XGET localhost:9200/books/book/_search?q=elasticsearch $ curl -XGET localhost:9200/books/book/_search?q=easy {"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"t otal":1,"max_score":0.095891505,"hits":[{"_index":"books","_type":"book","_id":" 2","_score":0.095891505, "_source" : { "title" : "Elasticsearch Easy Guide 2", "author" : ["Kim","Lee"], "started" : "2014-03-20", "pages" : 300 }}]}}
  • 11. URI 검색 (계속) $ curl –XGET localhost:9200/books/book/_search?q=title:elasticsearch $ curl -XGET localhost:9200/books/book/_search?q=author:elasticsearh {"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"t otal":0,"max_score":null,"hits":[]}}
  • 12. Request Body 검색 $ curl localhost:9200/books/book/_search -d ' { "query" : { "term" : { "title" : "elasticsearch" } } }'
  • 13. Shard & Replicas (Head plugin) • bin/plugin -install mobz/elasticsearch-head $ curl -XPUT localhost:9200/books -d ' { "settings" : { "number_of_shards" : 4, "number_of_replicas" : 1 } }' $ curl -XPUT localhost:9200/magazine -d ' { "settings" : { "number_of_shards" : 2, "number_of_replicas" : 0 } }'
  • 14. Shard & Replicas
  • 15. Shard & Replicas
  • 16. 환경 설정 - 노드명 • config/elasticsearch.yml • cluster.name: elasticsearch • node.name: “node1” • bin/elasticsearch -Des.node.name=node1 • bin/elasticsearch --node.name=node1
  • 17. 노드 바인딩 • 실행 포트 : 9200~ • 바인딩 포트 : 9300~
  • 18. 환경 설정 – 마스터노드, 데이터노드 • config/elasticsearch.yml • node.master: false • node.data: true • bin/elasticsearch -Des.node.data=true • bin/elasticsearch --node.data=true
  • 19. 환경 설정 – 마스터노드, 데이터노드
  • 20. 감사합니다 • http://elasticsearch.or.kr • 한국 엘라스틱서치 유저그룹 https://www.facebook.com/groups/elasticsearch.kr/