当前位置: 首页 > 工具软件 > fix_log4j2 > 使用案例 >

es7.10.2 修复log4j2

松铭
2023-12-01

参考
https://www.bilibili.com/read/cv14385171
https://learnku.com/articles/63565

1、# 下载最新jar包

curl -O https://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-core/2.17.2/log4j-core-2.17.2.jar 
curl -O https://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-1.2-api/2.17.2/log4j-1.2-api-2.17.2.jar
curl -O https://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-jcl/2.17.2/log4j-jcl-2.17.2.jar
curl -O https://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-slf4j-impl/2.17.2/log4j-slf4j-impl-2.17.2.jar
mkdir  fix_pack 
chmod elasticsearch.elasticsearch  -R fix_pack
cd fix_pack

2、# 备份原jar包

for i in `find /data/elasticsearch-1/ -name "*log4j*.jar" | grep -v fix`;do echo $i -------;mv $i ${i}.bak.source; done

3、# 修改

for i in `find /data/elasticsearch-1/ -name "*log4j*.bak.source"`;do c_pack=` echo ${i##*/} | sed 's/2.11.1/2.17.2/;s/.bak//' `; c_dir=${i%/*}/ ;echo $c_pack -----; cp -p $c_pack  $c_dir ;done

4、# 重启

kill   es进程
su - elasticsearch
./elasticsearch -d
 类似资料: