운영체제 :  window7 





1. 모든 인덱스 조회


GET _search

{

  "query": {

    "match_all": {}

  }

}


2, AGE 값이 20 인 데이터 찾기

GET _search

{

  "query": { "match": { "age": "20" } }

}


2.1 원하는 인덱스에서 원하는 데이터 찾기

GET /blog1/_search

{

  "query": { "match": { "age": "20" } }

}


3. 신규 데이터 넣기
PUT /blog1/article/4
{
  
  "age":"1"
}


운영체제 :  window7 


1.Logstash다운로드 

> https://www.elastic.co/downloads/logstash





2.CONF 파일 생성


2-1   1. 에서 다운 받은 ZIP을 원하는 디렉토리에 압축 해제 하여 CONF 파일을 생성 하기전 아래와 같이 CMD 에서 실행 해본다

(바로 2-2로 가도 상관 없음.)

>> bin\logstash.bat -e 'input { stdin {} } output { stdout {} }'

 


2-2 CONF파일 생성 후 실행 


BIN 폴더와 같은 디렉토리에  아래와 같이 CONF 파일을 설정 한다



input {

        stdin {

                codec => json

        }

file {

            path => "B:/***/2017-09-18.log"   # 해당 위치의 파일이 변경 되면 엘라스틱 엔진에 데이터를 넣는다

          }

}


output {

        elasticsearch {

               # host => "localhost"

               index => "log"                      # LOG 인덱스가 없을 경우 생성 하여 해당 인덱스에 넣어준다   

               # index_type => "article"

               # protocol => "http"

      hosts => ["localhost:9200"]

        }

        stdout {

                codec => json { }

        }

file {

                path => "B:/STUDY/Java/logstash-5.6.0/logs/WebLog/webLog.log"

codec => json { }

        }


}


2-3 cmd 에서  bin\logstash.bat -f logstash.conf 때린다


오류없이 정상 처리 되면 성공



3.테스트 

3-1. B:/***/2017-09-18.log 파일을 열어 테스트 데이터를 넣어 정상적으로 넣어지는지 확인한다


{"document_srl":1, "subject":"first", "content":"first_content", "account":"first_acc", "reg_date":"2017-08-21"}

{"BOLLOG":1, "subject":"first", "content":"first_content", "account":"first_acc", "reg_date":"2017-08-21"}

{"BOLLOG":2, "subject":"first1", "content":"first_content", "account":"first_acc", "reg_date":"2017-08-21"}




3-2. 키바나에서 아래와 같이 넣어진 데이터를 확인 할 수 있다





해당 로그 파일데이터가 바뀔 때 마다 cmd에 로그가 찍힌다



3-3 넣은 데이터를 키바나 말고 웹브라우져 에서 확인 하기

>> http://localhost:9200/log/logs/AV6ZIqaHpVuiGdVMgWnQ








운영체제 :  window7 


1.키바나 다운로드 

> https://www.elastic.co/downloads/kibana



2. KIBANA 설정 변경

config 의 kibana.yml      

   elasticsearch.url 주석 해제





3. kibana.bat 실행




4. http://localhost:5601/ 




>> 혹시 설치 후 키바나 호스트를 못잡을 경우 elastic엔진 구동 후 재시도 

'검색엔진' 카테고리의 다른 글

5.[Elasticsearch] KIBANA로 데이터 조회 및 넣기  (0) 2017.09.19
4.[Elasticsearch] Logstash다운로드 하기  (0) 2017.09.15
2.[Elasticsearch] 데이터 넣기  (0) 2017.08.31
1. 엘라스틱서치 설치  (0) 2016.10.19
참고 링크  (0) 2016.09.07

운영체제 :  window7 



1. cmd


1) cd B:\STUDY\Java\elasticsearch\bin

2) service start 로 엘라스틱 실행




2. git 으로 데이터 넣기

1) 아래 git-bash.exe 를 실행 하여 명령어 입력

curl -XPUT http://localhost:9200/blog/article/1 -d '{"name":"noh","age":"20","family":["father","mother"]}'



2) 브라우저에  http://localhost:9200/blog/article/1





운영체제 :  window7 



0,  서버에 최소 Java 7 이상 설치



>> 참고링크 http://jjig810906.tistory.com/1


엘라스틱 서치는 JAVA 위에서 동작하는 엔진이기때문에 JDK를 먼저 다운로드 받아 설치를 해야한다.

http://www.oracle.com/technetwork/java/javase/downloads/index.html






>>환경변수 설정  >  http://h5bak.tistory.com/91




1. JDK > 엘라스틱 설치 후  실행


참고 링크 : http://jjig810906.tistory.com/1 > 엘라스틱 설치


다운로드 주소 https://www.elastic.co/downloads/elasticsearch


1.1 위 주소에서 window용 다운




1.2 다운이 완료되면 bin 폴더의 elasticsearch.bat 실행





1.3 웹브라우저에   http://localhost:9200/




설치 완료



2.플러그인 설치하기



bin/plugin --install mobz/elasticsearch-head   (기본적으로 사용하는 HEAD 플러그인 설치)

> 오류


bin\plugin install mobz/elasticsearch-head 

>설치됨 (엘라스틱 버전에 따라 --install 명령어가 아닌 install 로 명령어 변경 )




 2.2 bin\plugin install lukas-vlcek/bigdesk  (기본적으로 사용하는 bigdesk 플러그인 설치)

오류 해결 못함






참조 

http://kugancity.tistory.com/entry/%EC%9C%88%EB%8F%84%EC%9A%B0-%EC%84%9C%EB%B2%84-2012%EC%97%90-%EC%97%98%EB%9D%BC%EC%8A%A4%ED%8B%B1%EA%B2%80%EC%83%89-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0



http://blog.naver.com/cjc07?Redirect=Log&logNo=220725388479  > git 설치(svn)



https://git-scm.com/


git 버전 2.10.1 


git sourceTree 설치



git 콘솔 창에 


$ curl -XPUT http://localhost:9200/blog/article/1 -d '{"title":"new test sample"}'

입력하여 데이터 insert 


확인>

http://localhost:9200/blog/article/1





유지보수 및 설정파일 강화

http://working.zzugg.com/es-logaggregation.html


기본 문법 및 엘라스틱 관리 정보

https://iju707.gitbooks.io/elasticsearch/content/_executing_aggregations.html


1.리눅스 기반

http://geniedev.tistory.com/6

2. 윈도우 기반

http://jjig810906.tistory.com/1



튜토리얼

http://hyeonjae.github.io/elasticsearch/2015/06/29/elasticsearch.html


문법

https://iju707.gitbooks.io/elasticsearch/content/_executing_searches.html

https://bakyeono.net/post/2016-08-20-elasticsearch-querydsl-basic.html#bool--1

https://okdevtv.com/mib/elasticsearch



elasticsearch api 호스트 설정

http://tod2.tistory.com/m/186




검색 점수 적용 (정렬조건/일치조건)

http://www.popit.kr/bm25-elasticsearch-5-0%EC%97%90%EC%84%9C-%EA%B2%80%EC%83%89%ED%95%98%EB%8A%94-%EC%83%88%EB%A1%9C%EC%9A%B4-%EB%B0%A9%EB%B2%95/

https://github.com/wikibook/elasticsearch/tree/master/07.%EC%A7%88%EC%9D%98(QueryDSL)






품사제거, 제외 품사 설정 

https://bitbucket.org/eunjeon/seunjeon/pull-requests/10/feature-exclude-poses/diff


+ Recent posts