当前位置:   article > 正文

ElasticSearch Log4j 版本升级方法总结_log4j升级2.17步骤

log4j升级2.17步骤


# 原因

项目中使用了ElasticSearch ,版本为7.13.2,其中用到的Log4j的版本为2.11.1,该版本的Log4j存在漏洞,故需要升级Log4j

# 方法

1、下载最新版编译好的Log4j的jar包

下载地址: https://downloads.apache.org/logging/log4j/2.17.1/

2、解压后,找到如下四个文件,并上传到服务器
log4j-1.2-api-2.17.1.jar
log4j-api-2.17.1.jar
log4j-core-2.17.1.jar
log4j-slf4j-impl-2.17.1.jar
  • 1
  • 2
  • 3
  • 4
3、删除服务器上低版本的Log4j的jar包
rm -rf /usr/share/elasticsearch/lib/log4j-api-2.11.1.jar
rm -rf /usr/share/elasticsearch/lib/log4j-core-2.11.1.jar
rm -rf /usr/share/elasticsearch/modules/repository-url/log4j-1.2-api-2.11.1.jar
rm -rf /usr/share/elasticsearch/modules/x-pack-core/log4j-1.2-api-2.11.1.jar
rm -rf /usr/share/elasticsearch/modules/x-pack-identity-provider/log4j-slf4j-impl-2.11.1.jar
rm -rf /usr/share/elasticsearch/modules/x-pack-security/log4j-slf4j-impl-2.11.1.jar
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
4、将最新版Log4j的jar包复制过去
cp log4j-api-2.17.1.jar /usr/share/elasticsearch/lib/
cp log4j-core-2.17.1.jar /usr/share/elasticsearch/lib/
cp log4j-1.2-api-2.17.1.jar /usr/share/elasticsearch/modules/repository-url/
cp log4j-1.2-api-2.17.1.jar /usr/share/elasticsearch/modules/x-pack-core/
cp log4j-slf4j-impl-2.17.1.jar /usr/share/elasticsearch/modules/x-pack-identity-provider/
cp log4j-slf4j-impl-2.17.1.jar /usr/share/elasticsearch/modules/x-pack-security/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
5、重启ElasticSearch服务即可

# 参考

https://developer.aliyun.com/article/843078


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/548003
推荐阅读
相关标签
  

闽ICP备14008679号