logstash插件升级
环境:
os: centos 7.7
ip: 10.8.6.246
logstash版本:6.7.0 (/usr/share/logstash/bin/logstash -V)
查看当前插件版本:
/usr/share/logstash/bin/logstash-plugin list --verbose
会看到如下
...
logstash-filter-urldecode (3.0.6)
logstash-filter-useragent (3.2.3)
logstash-filter-xml (4.0.7)
logstash-input-beats (5.1.8)
logstash-input-dead_letter_queue (1.1.4)
logstash-input-elasticsearch (4.3.0)
logstash-input-exec (3.3.2)
logstash-input-file (4.1.9)
...
备份当前版本(可选)
/usr/share/logstash/bin/logstash-plugin prepare-offline-pack logstash-input-file
会打包当前版本的插件
(base) [root@bdp-c-204 service]# /usr/share/logstash/bin/logstash-plugin prepare-offline-pack logstash-input-file
Offline package created at: /usr/share/logstash/logstash-offline-plugins-6.7.0.zip
You can install it with this command `bin/logstash-plugin install file:///usr/share/logstash/logstash-offline-plugins-6.7.0.zip`
后续如果回滚,可以从本地安装
升级指定插件
我们要升级**logstash-input-file (4.1.9)**到最新版本
/usr/share/logstash/bin/logstash-plugin update logstash-input-file
成功后可以看到提示Updated logstash-input-file 4.1.9 to 4.2.4
logstash-plugin 提示内存不足, 但物理内存其实还有剩余
现象:
(base) [root@bdp-ls-001 logstash]# ./bin/logstash-plugin
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000004e9990000, 12187009024, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 12187009024 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/share/logstash/hs_err_pid26195.log
可以通过设置LS_JVM_OPTS
LS_JAVA_OPTS="-Xms256m -Xmx512m" /usr/share/logstash/bin/logstash-plugin list
参考:https://github.com/elastic/logstash/blob/v5.5.2/bin/logstash.lib.sh#L31-L49