logstash mysql 연동

docker-compose로 ELK 세팅 후 logstash와 Mysql 연동 중입니다.
Mysql에 데이터가 입력되면 연동되어있는 logstash로 일정시간마다 동기화 시키는게 목적입니다.
연동이 되어야 스케줄러를 적용하기 때문에 연동 과정에서 에러가 생겼습니다.

centOS
jdk 1.8

질문 1.
[root@1aefff002dd2 logstash]# bin/logstash -f ./pipeline/logstash.conf

이렇게 conf 파일을 실행하면 아래와 같은 에러가 뜹니다.
logstash가 이미 instance가 실행되어 있어서 start안되는거 같은데, 이게 뭔지 감이 잘 안잡히네요 ㅠㅠ
여러개 인스턴스가 아니라 단일로 사용할 예정입니다.

Thread.exclusive is deprecated, use Thread::Mutex
Sending Logstash logs to /usr/share/logstash/logs which is now configured via log4j2.properties
[2020-02-14T07:42:29,645][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2020-02-14T07:42:29,660][FATAL][logstash.runner ] 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.
[2020-02-14T07:42:29,670][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

질문 2.
/usr/share/logstash/pipeline/logstash.conf 의 내용입니다.

input {
tcp {
port => 5000
}
jdbc {
jdbc_driver_library => "/usr/share/logstash/lib/mysql-connector-java-8.0.18.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://...*/"
jdbc_user => "root"
jdbc_password => "
"
statement => "select * from TABLE"
schedule => "
* * * *"
}
}

Add your filters / logstash plugins configuration here

output {
elasticsearch {
hosts => "elasticsearch:9200"
index => "qwer"
}
stdout {
codec => rubydebug
}
}

이렇게 작성했는데 수정할 부분이 있으면 답변 부탁드립니다 ㅠㅠ
며칠째 구글링 하는데도 해결 안되어 여기까지 찾아왔습니다.
고수님들 부탁드립니다! :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.