ELK部署安装[二]

原生安装

# /usr/share/logstash/bin/logstash-plugin install logstash-input-jdbc  
Validating logstash-input-jdbc  
Installing logstash-input-jdbc  
WARNING: can not set Session#timeout=(0) no session context  

能看到输出的任一更新都需要非常久 - 一两个小时没反应,几乎不能完成任务。

改镜像源安装

办法:给 Ruby 加上国内的镜像站:https://gems.ruby-china.org,替代https://rubygems.org

安装Gem并更新

[root@linux-node2 ~]# echo "54.235.82.130   artifacts.elastic.co" >> /etc/hosts 
[root@linux-node2 ~]# yum install -y gem  
[root@linux-node2 ~]# gem -v
2.0.14.1
[root@linux-node2 ~]# gem -v
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
2.7.4

检查并修改镜像源

[root@linux-node2 ~]# gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/  
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
https://gems.ruby-china.org/ added to sources
https://rubygems.org/ removed from sources
[root@linux-node2 ~]# cat ~/.gemrc   
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- https://gems.ruby-china.org/
:update_sources: true
:verbose: true
[root@linux-node2 ~]# gem install bundler  
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
Fetching: bundler-1.16.1.gem (100%)
Successfully installed bundler-1.16.1
Parsing documentation for bundler-1.16.1
Installing ri documentation for bundler-1.16.1
1 gem installed
[root@linux-node2 ~]# bundle config mirror.https://rubygems.org https://gems.ruby-china.org

修改 logstash的 gem 镜像源

[root@linux-node2 ~]# head /usr/share/logstash/Gemfile  
# This is a Logstash generated Gemfile.
# If you modify this file manually all comments and formatting will be lost.

source "https://rubygems.org"
gem "logstash-core", :path => "./logstash-core"
gem "logstash-core-plugin-api", :path => "./logstash-core-plugin-api"
gem "paquet", "~> 0.2.0"
gem "ruby-progressbar", "~> 1.8.1"
gem "builder", "~> 3.2.2"
gem "file-dependencies", "0.1.6"

修改后

[root@linux-node2 ~]# head /usr/share/logstash/Gemfile
# This is a Logstash generated Gemfile.
# If you modify this file manually all comments and formatting will be lost.

source "https://gems.ruby-china.org"
gem "logstash-core", :path => "./logstash-core"
gem "logstash-core-plugin-api", :path => "./logstash-core-plugin-api"
gem "paquet", "~> 0.2.0"
gem "ruby-progressbar", "~> 1.8.1"
gem "builder", "~> 3.2.2"
gem "file-dependencies", "0.1.6"

查看

[root@linux-node2 ~]# gem sources -l 
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
*** CURRENT SOURCES ***

https://gems.ruby-china.org/

更改默认的 https://rubygems.org 为https://gems.ruby-china.org

Gemfile.jruby-1.9.lock文件不用改,会自动更新。

安装 logstash-input-jdbc

[root@linux-node2 ~]# /usr/share/logstash/bin/logstash-plugin install logstash-input-jdbc  
Validating logstash-input-jdbc
Installing logstash-input-jdbc
Installation successful
[root@linux-node2 ~]# /usr/share/logstash/bin/logstash-plugin   install  logstash-output-jdbc
Validating logstash-output-jdbc
Installing logstash-output-jdbc
Installation successful
[root@linux-node2 ~]# /usr/share/logstash/bin/logstash-plugin list | grep jdbc
logstash-input-jdbc
logstash-output-jdbc

 

posted @ 2018-01-04 22:32  reborn枪  阅读(86)  评论(0)    收藏  举报