编译安装logstash-output-jdbc插件--(1、g
2021-03-26 本文已影响0人
garfieldkai
-
logstash版本:7.10.1
-
Log stash-output-jdbc插件版本:5.4.0
在用mac编译插件时,需要用jruby,而mac默认的ruby环境不是,需要先安装jruby。mac安装使用ruby最安全方便的方式是使用rvm。
- 离线安装rvm
- 下载离线安装包
curl -sSL https://github.com/rvm/rvm/tarball/stable -o rvm-stable.tar.gz
- 创建文件夹
mkdir rvm && cd rvm
- 解压缩
tar --strip-components=1 -zxf ../rvm-stable.tar.gz
- 安装
./install --auto-dotfiles
- 加载
source ~/.rvm/scripts/rvm
- 安装jruby
rvm install jruby
- 应用jruby
rvm use jruby
因jruby需要另外单独安装bundle,和原ruby的bundle不通用,需要重新安装bundle
- 安装bundle
gem install bundler
- checkout插件源码
git clone https://github.com/theangryangel/logstash-output-jdbc
cd logstash-output-jdbc
- 安装依赖
bundle install
- 剩下的按照官方发布流程操作
bundle exec rake install_jars
bundle exec rake pre_release_checks
gem build logstash-output-jdbc.gemspec
最后得到的logstash-output-jdbc-5.4.0.gem 便是我们要的