일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 추상클래스
- Vector
- string
- constantnumber
- fuction
- override
- Polymorphism
- hashCode
- super
- 생성자
- methodArea
- start()
- 객체형변환
- Hashtable
- garbagecollection
- object
- run()
- arguments
- concreteclass
- 콘크리트클래스
- reference
- abstractclass
- overload
- Eureka
- ALTER
- class
- MSA
- hamobee
- eclipse
- value
- Today
- Total
뇌운동일지
Elastic Search : docker에 elasticsearch 설치, logstash 실행하려 했으나 해결하지 못한 과정 본문
Elastic Search : docker에 elasticsearch 설치, logstash 실행하려 했으나 해결하지 못한 과정
purpleduck 2021. 10. 12. 10:52< ElasticSearch CRUD + Table Join + Bulk Data upload(학생 50명 국영수 월별점수) + Batch >
docker 에 install centOS, install Elasticsearch
Docker 기본개념 (영어)
https://aws.amazon.com/ko/docker/
https://www.ibm.com/cloud/learn/docker
Docker 기본개념 (한국어) : 영어로 한번 읽어보고, 한국어로 읽어봄
https://velog.io/@blakekim93/Docker-%EA%B0%9C%EB%85%90-%EB%B0%8F-%ED%8A%B9%EC%A7%95
window10에 docker 설치
https://goddaehee.tistory.com/251
docker에 centOS 이미지 (한국어)
https://firework-ham.tistory.com/78
docker에 Elasticsearch 설치
https://jinhokwon.github.io/devops/elasticsearch/elasticsearch-docker/
ElasticSearch 기본개념, CentOS7에서 ElasticSearch (한국어)
https://victorydntmd.tistory.com/308
-> 이걸로 ElasticSearch 연습을 좀 했다.
{ "error" : { "root_cause" : [ { "type" : "illegal_argument_exception",
이러한 error 발생.
Elasticsearch 7.x 버전부터 curl request 에서
header 명확하게 설정해주어야 함.
mapping 생성 시, include_type_name 을 true로 설정해주어야 함. -> 잘 안되었는데 일단 skip
Elasticsearch 로 csv import (공식문서)
csv import 3가지 방법
https://medium.com/nonstopio/load-csv-data-into-elasticsearch-56e7fb02a232
-> 3가지 방법 중, logstash 사용하는 방법 고려중.
docker에 logstash설치 (elastic 공식문서)
https://www.elastic.co/guide/en/logstash/current/docker.html
< 호스트 컨테이너 사이 파일 복사 : docker cp >
https://hello-bryan.tistory.com/163
-> docker cp 명령어로 로컬에 있는 csv 파일을 logstash image로 보낸다.
container 내 디렉토리 경로를 pwd 로 확인한 후, 경로를 지정해주어야 함. (이걸로 2~3시간은 쓴듯. 윈도우에서 디렉토리 권한 설정 문제를 의심해보았다.)
logstash 컨테이너 내에서의 경로
< logstash로 csv input, json output 하고 Elasticsearch >
이 예제로 전체적인 그림을 본다.
https://pinggoopark.tistory.com/5
이 예제로 filter, output 등 세부적인 설정할 것. 해당 예제는 local 환경에서 실행하고 있으므로, docker 환경에 맞게 변경.
https://peanut159357.tistory.com/27
csv 파일 업로드 시, 첫 행 컬럼명으로 처리 후, 두번째 행부터 data로 입력하는 것 어떻게 처리?
filter plugin 으로 skip_header 가 있다고는 하는데, 된다 안된다 말이 많음 -> 적용은 해보았는데, 원하는대로 동작하는지 확인은 못해봄.
Install Elasticsearch with RPM (공식문서)
https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html#rpm-repo
Elastic
Trouble Shooting )
한줄씩 해석해보자.
Ignoring the 'pipelines.yml' file because modules or command line options are specified
-> -f 또는 -e 옵션으로 실행했기 때문에 pipelines.yml 은 무시한다.
Logstash could not be started because there is already another instance using the configured data directory. If you wish to run multiple instances, you must change the "path.data" setting.
-> 이것을 해결해야 하는 것으로 보임.
나의 상황과 유사한 elastic discuss 를 찾음.
https://discuss.elastic.co/t/logstash/243427
-> 이미 실행중인 instance가 있다.
실행중인 logstash 찾아 kill 하고 다시 실행 : 어떻게 하는지 모르겠다. kill -9 pid 하고 확인해보면 pid가 바뀐 프로세스가 나옴.
ps -ef | grep logstash
이 문제에 대한 참고자료
https://stackoverflow.com/questions/27757405/how-to-kill-process-inside-container-docker-top-command
10/14 (화)
container 실행 시, 자동으로 종료되는 문제 -> log 를 확인해보기
Errno::EADDRNOTAVAIL: Cannot assign requested address - bind(2) for
1. 해당 오류에 대해 찾아본다.
2. 해당 포트 번호를 local machine 에서 어떻게 쓰고 있는지 확인해본다. -> 9600 포트를 안쓰고 있는 것으로 보인다.
netstat option 참고자료
https://studyforus.tistory.com/244
https://ansan-survivor.tistory.com/409
-> 이걸 지금 단계에서 이렇게까지 해야하나. 그냥 컨테이너 remove하고 새로 띄우는게 낫지 않을까하는 생각을 해보았다. (파일 어떻게 작성했는지 저장해둘걸...)
다시 해봄.
connection 은 기본 설정 상태로 있을 때 오류가 나는 것.
# scoredata.conf input { file { path => "/usr/share/logstash/pipeline/scoredata.csv" start_position => "beginning" } filter { csv { columns => ["No", "semester", "Name", "Korean", "English", "Math"] separator => "," } } } output { elasticsearch { hosts => ["elasticsearch:9200"] index = > "scoredata" } stdout {} } |
파일명, 인덱스명 정도만 바꿔서 scoredata2.conf 도 작성함.
pipelines.yml 수정
logstash 실행 자체가 안됨.
config directory 의 logstash.yml 에서 host.http 를 0.0.0.0 -> 에서 내 무선랜 IPv4 주소로 바꿔줌.
logstash 사용법
https://blog.naver.com/PostView.naver?blogId=techshare&logNo=222081428739&redirect=Dlog&widgetTypeCall=true&directAccess=false
10/15 (목)
docker 에서 logstash 이미지 내리고 다시 받아봤는데 잘 안된다.
참고)
윈도우 창 내리기 단축기 Alt + Space + n
csv 파일형식은 시트 하나만 저장된다
docker ps -a : 현재 떠있는 docker container 정보 확인
'purple duck 일지' 카테고리의 다른 글
mongoDB (0) | 2021.10.15 |
---|---|
Elasticsearch CRUD (0) | 2021.10.15 |
Vue.js + express 에서 알림서비스 : email, slack, kakaotalk (0) | 2021.10.07 |
Vue.js + express 탐구생활 (0) | 2021.10.06 |
dashboard 만들기 (0) | 2021.10.05 |