1. 下载logstash
[root@localhost ~]# wget https://artifacts.elastic.co/downloads/logstash/logstash-6.7.0.tar.gz
2. 解压并复制到指定目录下
[root@localhost ~]# tar xzf logstash-6.7.0.tar.gz
[root@localhost ~]# cp -rf logstash-6.7.0 /usr/local/logstash
3. 自定义配置之后启动服务
[root@localhost ~]# nohup bin/logstash -t -f /usr/local/logstash/conf/logstash.conf &
4. 安装logstash-input-jdbc插件
[root@localhost ~]# yum install gem
[root@localhost ~]# gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
[root@localhost ~]# gem sources -l
[root@localhost ~]# cd /usr/local/logstash
# 替换源
[root@localhost ~]# vi Gemfile
#修改Gemfile文件
#source https://rubygems.org/
source "https://gems.ruby-china.com/"
[root@localhost ~]# vi Gemfile.lock
#remote: https://rubygems.org/
remote: https://gems.ruby-china.com/
[root@localhost ~]# cd /usr/local/logstash/bin
[root@localhost bin]# ./logstash-plugin install --no-verify logstash-input-jdbc