RPA2020.4.0 依赖升级

主要针对 RPA2020.3.0 — RPA2021.1.0 依赖升级

  • FastJSON 1.2.x 推荐升级到 1.2.78
  • Logback 1.2.10 以下版本 推荐升级到 1.2.10
  • Jackson-databind 2.9.x 推荐升级到 2.10.1 (不需要升级)
  • Log4j 2.x 推荐升级到 2.17.1 直接替换 jar 包
  • MyBatis 3.4.x 推荐升级到 3.5.7
  • Shiro 1.x 推荐升级到 1.8.0 参考地址
# 创建升级上传目录
mkdir -p /isearch/isa/datas/upgrade/jar
# 上传jar 到/isearch/isa/datas/upgrade/jar 目录并解压
tar -xzvf upgrade.tar.gz 

升级 jar 文件.zip

PS:
1.《升级 jar 文件.zip》下载后先解压一下(因有些服务器没有 unzip 命令),把 upgrade.tar.gz 上传到服务器 /isearch/isa/datas/upgrade/jar 下 , 并解压
2. 确认当前项目是否存在上面五个依赖,可以通过命令全局搜索 find /isearch/ -name {组件名}\*.jar

后端服务升级

版本确认


# 进入lib目录
cd /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
## 确认当前版本
ls | grep -e log4j -e fastjson -e mybatis -e shiro -e logback -e jackson
# fastjson-1.2.47.jar
# jackson-annotations-2.10.1.jar
# jackson-core-2.10.1.jar
# jackson-core-asl-1.9.13.jar
# jackson-databind-2.10.1.jar
# jackson-dataformat-cbor-2.10.1.jar
# jackson-dataformat-smile-2.10.1.jar
# jackson-dataformat-yaml-2.10.1.jar
# jackson-datatype-jdk8-2.10.1.jar
# jackson-datatype-jsr310-2.10.1.jar
# jackson-mapper-asl-1.9.13.jar
# jackson-module-parameter-names-2.10.1.jar
# log4j-api-2.10.0.jar
# log4j-to-slf4j-2.10.0.jar
# logback-classic-1.2.3.jar
# logback-core-1.2.3.jar
# mybatis-3.4.6.jar
# mybatis-plus-3.0.7.1.jar
# mybatis-plus-annotation-3.0.7.1.jar
# mybatis-plus-boot-starter-3.0.7.1.jar
# mybatis-plus-core-3.0.7.1.jar
# mybatis-plus-extension-3.0.7.1.jar
# mybatis-spring-1.3.2.jar
# mybatis-spring-boot-autoconfigure-1.3.2.jar
# mybatis-spring-boot-starter-1.3.2.jar
# shiro-cache-1.5.3.jar
# shiro-config-core-1.5.3.jar
# shiro-config-ogdl-1.5.3.jar
# shiro-core-1.5.3.jar
# shiro-crypto-cipher-1.5.3.jar
# shiro-crypto-core-1.5.3.jar
# shiro-crypto-hash-1.5.3.jar
# shiro-ehcache-1.5.3.jar
# shiro-event-1.5.3.jar
# shiro-lang-1.5.3.jar
# shiro-spring-1.5.3.jar
# shiro-web-1.5.3.jar
# thymeleaf-extras-shiro-2.0.0.jar

# 经确认以下17个jar需要升级 ( fastjson log4j logback mybatis shiro  )
# fastjson-1.2.47.jar
# log4j-to-slf4j-2.10.0.jar
# log4j-api-2.10.0.jar
# logback-classic-1.2.3.jar
# logback-core-1.2.3.jar
# mybatis-3.4.6.jar
# mybatis-spring-1.3.2.jar
# shiro-cache-1.5.3.jar
# shiro-config-core-1.5.3.jar
# shiro-config-ogdl-1.5.3.jar
# shiro-core-1.5.3.jar
# shiro-crypto-cipher-1.5.3.jar
# shiro-crypto-core-1.5.3.jar
# shiro-crypto-hash-1.5.3.jar
# shiro-ehcache-1.5.3.jar
# shiro-event-1.5.3.jar
# shiro-lang-1.5.3.jar
# shiro-spring-1.5.3.jar
# shiro-web-1.5.3.jar

升级

# 停止服务
/isearch/bin/tomcat.sh stop
# 创建升级备份目录
mkdir -p /isearch/isa/datas/upgrade/bak/ROOT

# 进入lib目录
cd /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
#备份之前的版本
cp fastjson-1.2.47.jar /isearch/isa/datas/upgrade/bak/ROOT
cp log4j-to-slf4j-2.10.0.jar /isearch/isa/datas/upgrade/bak/ROOT
cp log4j-api-2.10.0.jar /isearch/isa/datas/upgrade/bak/ROOT
cp logback-classic-1.2.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp logback-core-1.2.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp mybatis-3.4.6.jar /isearch/isa/datas/upgrade/bak/ROOT
cp mybatis-spring-1.3.2.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-cache-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-config-core-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-config-ogdl-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-core-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-crypto-cipher-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-crypto-core-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-crypto-hash-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-ehcache-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-event-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-lang-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-spring-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT
cp shiro-web-1.5.3.jar /isearch/isa/datas/upgrade/bak/ROOT

# 删除老版本文件 (已经备份可以直接删除)
rm -rf fastjson-1.2.47.jar
rm -rf logback-classic-1.2.3.jar
rm -rf log4j-to-slf4j-2.10.0.jar
rm -rf log4j-api-2.10.0.jar
rm -rf logback-core-1.2.3.jar
rm -rf mybatis-3.4.6.jar
rm -rf mybatis-spring-1.3.2.jar
rm -rf shiro-cache-1.5.3.jar
rm -rf shiro-config-core-1.5.3.jar
rm -rf shiro-config-ogdl-1.5.3.jar
rm -rf shiro-core-1.5.3.jar
rm -rf shiro-crypto-cipher-1.5.3.jar
rm -rf shiro-crypto-core-1.5.3.jar
rm -rf shiro-crypto-hash-1.5.3.jar
rm -rf shiro-ehcache-1.5.3.jar
rm -rf shiro-event-1.5.3.jar
rm -rf shiro-lang-1.5.3.jar
rm -rf shiro-spring-1.5.3.jar
rm -rf shiro-web-1.5.3.jar

cd /isearch/isa/datas/upgrade/jar
cp fastjson-1.2.78.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp log4j-to-slf4j-2.17.1.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp log4j-api-2.17.1.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp logback-classic-1.2.10.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp logback-core-1.2.10.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp mybatis-3.5.7.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp mybatis-spring-2.0.6.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-cache-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-config-core-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-config-ogdl-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-core-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-crypto-cipher-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-crypto-core-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-crypto-hash-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-ehcache-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-event-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-lang-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-spring-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-web-1.8.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib

# 查看结果
cd /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
## 确认当前版本
ls | grep -e log4j -e fastjson -e mybatis -e shiro -e logback -e jackson
## 结果如下
# fastjson-1.2.78.jar
# jackson-annotations-2.10.1.jar
# jackson-core-2.10.1.jar
# jackson-core-asl-1.9.13.jar
# jackson-databind-2.10.1.jar
# jackson-dataformat-cbor-2.10.1.jar
# jackson-dataformat-smile-2.10.1.jar
# jackson-dataformat-yaml-2.10.1.jar
# jackson-datatype-jdk8-2.10.1.jar
# jackson-datatype-jsr310-2.10.1.jar
# jackson-mapper-asl-1.9.13.jar
# jackson-module-parameter-names-2.10.1.jar
# log4j-api-2.17.1.jar
# log4j-to-slf4j-2.17.1.jar
# logback-classic-1.2.10.jar
# logback-core-1.2.10.jar
# mybatis-3.5.7.jar
# mybatis-plus-3.0.7.1.jar
# mybatis-plus-annotation-3.0.7.1.jar
# mybatis-plus-boot-starter-3.0.7.1.jar
# mybatis-plus-core-3.0.7.1.jar
# mybatis-plus-extension-3.0.7.1.jar
# mybatis-spring-2.0.6.jar
# mybatis-spring-boot-autoconfigure-1.3.2.jar
# mybatis-spring-boot-starter-1.3.2.jar
# shiro-cache-1.8.0.jar
# shiro-config-core-1.8.0.jar
# shiro-config-ogdl-1.8.0.jar
# shiro-core-1.8.0.jar
# shiro-crypto-cipher-1.8.0.jar
# shiro-crypto-core-1.8.0.jar
# shiro-crypto-hash-1.8.0.jar
# shiro-ehcache-1.8.0.jar
# shiro-event-1.8.0.jar
# shiro-lang-1.8.0.jar
# shiro-spring-1.8.0.jar
# shiro-web-1.8.0.jar
# thymeleaf-extras-shiro-2.0.0.jar

还原(可选)

# 删除更新后的版本
cd /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
rm -rf fastjson-1.2.78.jar 
rm -rf log4j-to-slf4j-2.17.1.jar
rm -rf log4j-api-2.17.1.jar
rm -rf logback-classic-1.2.10.jar 
rm -rf logback-core-1.2.10.jar 
rm -rf mybatis-3.5.7.jar 
rm -rf mybatis-spring-2.0.6.jar 
rm -rf shiro-cache-1.8.0.jar 
rm -rf shiro-config-core-1.8.0.jar 
rm -rf shiro-config-ogdl-1.8.0.jar 
rm -rf shiro-core-1.8.0.jar 
rm -rf shiro-crypto-cipher-1.8.0.jar 
rm -rf shiro-crypto-core-1.8.0.jar 
rm -rf shiro-crypto-hash-1.8.0.jar 
rm -rf shiro-ehcache-1.8.0.jar 
rm -rf shiro-event-1.8.0.jar 
rm -rf shiro-lang-1.8.0.jar 
rm -rf shiro-spring-1.8.0.jar 
rm -rf shiro-web-1.8.0.jar 

#还原之前的版本 (可选)
cd /isearch/isa/datas/upgrade/bak/ROOT
cp fastjson-1.2.47.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp log4j-to-slf4j-2.10.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp log4j-api-2.10.0.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp logback-classic-1.2.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp logback-core-1.2.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp mybatis-3.4.6.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp mybatis-spring-1.3.2.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-cache-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-config-core-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-config-ogdl-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-core-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-crypto-cipher-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-crypto-core-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-crypto-hash-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-ehcache-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-event-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-lang-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-spring-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib
cp shiro-web-1.5.3.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib

快照升级

版本确认

# 进入lib目录
cd /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
## 确认当前版本
ls | grep -e log4j -e fastjson -e mybatis -e shiro -e logback -e jackson
# fastjson-1.2.47.jar
# jackson-annotations-2.9.0.jar
# jackson-core-2.9.6.jar
# jackson-core-asl-1.9.13.jar
# jackson-databind-2.9.6.jar
# jackson-dataformat-cbor-2.9.6.jar
# jackson-dataformat-smile-2.9.6.jar
# jackson-dataformat-yaml-2.9.6.jar
# jackson-datatype-jdk8-2.9.6.jar
# jackson-datatype-jsr310-2.9.6.jar
# jackson-mapper-asl-1.9.13.jar
# jackson-module-parameter-names-2.9.6.jar
# log4j-1.2.17.jar
# log4j-api-2.10.0.jar
# log4j-to-slf4j-2.10.0.jar
# logback-classic-1.2.3.jar
# logback-core-1.2.3.jar
# mybatis-3.4.6.jar
# mybatis-plus-3.0.7.1.jar
# mybatis-plus-annotation-3.0.7.1.jar
# mybatis-plus-boot-starter-3.0.7.1.jar
# mybatis-plus-core-3.0.7.1.jar
# mybatis-plus-extension-3.0.7.1.jar
# mybatis-spring-1.3.2.jar
# mybatis-spring-boot-autoconfigure-1.3.2.jar
# mybatis-spring-boot-starter-1.3.2.jar
# shiro-cache-1.4.0.jar
# shiro-config-core-1.4.0.jar
# shiro-config-ogdl-1.4.0.jar
# shiro-core-1.4.0.jar
# shiro-crypto-cipher-1.4.0.jar
# shiro-crypto-core-1.4.0.jar
# shiro-crypto-hash-1.4.0.jar
# shiro-ehcache-1.4.0.jar
# shiro-event-1.4.0.jar
# shiro-lang-1.4.0.jar
# shiro-spring-1.4.0.jar
# shiro-web-1.4.0.jar
# thymeleaf-extras-shiro-2.0.0.jar


# 经确认以下28个jar需要升级 ( fastjson mybatis shiro logback jackson)
fastjson-1.2.47.jar
jackson-annotations-2.9.0.jar
jackson-core-2.9.6.jar
jackson-databind-2.9.6.jar
jackson-dataformat-cbor-2.9.6.jar
jackson-dataformat-smile-2.9.6.jar
jackson-dataformat-yaml-2.9.6.jar
jackson-datatype-jdk8-2.9.6.jar
jackson-datatype-jsr310-2.9.6.jar
jackson-module-parameter-names-2.9.6.jar
log4j-api-2.10.0.jar
log4j-to-slf4j-2.10.0.jar
logback-classic-1.2.3.jar
logback-core-1.2.3.jar
mybatis-3.4.6.jar
mybatis-spring-1.3.2.jar
shiro-cache-1.4.0.jar
shiro-config-core-1.4.0.jar
shiro-config-ogdl-1.4.0.jar
shiro-core-1.4.0.jar
shiro-crypto-cipher-1.4.0.jar
shiro-crypto-core-1.4.0.jar
shiro-crypto-hash-1.4.0.jar
shiro-ehcache-1.4.0.jar
shiro-event-1.4.0.jar
shiro-lang-1.4.0.jar
shiro-spring-1.4.0.jar
shiro-web-1.4.0.jar

升级

# 停止服务
/isearch/bin/tomcat.sh stop
# 创建升级备份目录
mkdir -p /isearch/isa/datas/upgrade/bak/Snapshot

# 进入lib目录
cd /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
#备份之前的版本
cp fastjson-1.2.47.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-annotations-2.9.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-core-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-databind-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-dataformat-cbor-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-dataformat-smile-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-dataformat-yaml-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-datatype-jdk8-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-datatype-jsr310-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp jackson-module-parameter-names-2.9.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp log4j-to-slf4j-2.10.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp log4j-api-2.10.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp logback-classic-1.2.3.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp logback-core-1.2.3.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp mybatis-3.4.6.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp mybatis-spring-1.3.2.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-cache-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-config-core-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-config-ogdl-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-core-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-crypto-cipher-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-crypto-core-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-crypto-hash-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-ehcache-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-event-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-lang-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-spring-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot
cp shiro-web-1.4.0.jar /isearch/isa/datas/upgrade/bak/Snapshot


# 删除老版本文件 (已经备份可以直接删除)
cd /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
rm -rf fastjson-1.2.47.jar
rm -rf jackson-annotations-2.9.0.jar
rm -rf jackson-core-2.9.6.jar
rm -rf jackson-databind-2.9.6.jar
rm -rf jackson-dataformat-cbor-2.9.6.jar
rm -rf jackson-dataformat-smile-2.9.6.jar
rm -rf jackson-dataformat-yaml-2.9.6.jar
rm -rf jackson-datatype-jdk8-2.9.6.jar
rm -rf jackson-datatype-jsr310-2.9.6.jar
rm -rf jackson-module-parameter-names-2.9.6.jar
rm -rf log4j-api-2.10.0.jar
rm -rf log4j-to-slf4j-2.10.0.jar
rm -rf logback-classic-1.2.3.jar
rm -rf logback-core-1.2.3.jar
rm -rf mybatis-3.4.6.jar
rm -rf mybatis-spring-1.3.2.jar
rm -rf shiro-cache-1.4.0.jar
rm -rf shiro-config-core-1.4.0.jar
rm -rf shiro-config-ogdl-1.4.0.jar
rm -rf shiro-core-1.4.0.jar
rm -rf shiro-crypto-cipher-1.4.0.jar
rm -rf shiro-crypto-core-1.4.0.jar
rm -rf shiro-crypto-hash-1.4.0.jar
rm -rf shiro-ehcache-1.4.0.jar
rm -rf shiro-event-1.4.0.jar
rm -rf shiro-lang-1.4.0.jar
rm -rf shiro-spring-1.4.0.jar
rm -rf shiro-web-1.4.0.jar

# 更新新版本
cd /isearch/isa/datas/upgrade/jar
cp fastjson-1.2.78.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-annotations-2.10.1.jar  /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-core-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-databind-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-dataformat-cbor-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-dataformat-smile-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-dataformat-yaml-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-datatype-jdk8-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-datatype-jsr310-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp jackson-module-parameter-names-2.10.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp log4j-api-2.17.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp log4j-to-slf4j-2.17.1.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp logback-classic-1.2.10.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp logback-core-1.2.10.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp mybatis-3.5.7.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp mybatis-spring-2.0.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-cache-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-config-core-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-config-ogdl-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-core-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-crypto-cipher-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-crypto-core-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-crypto-hash-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-ehcache-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-event-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-lang-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-spring-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
cp shiro-web-1.8.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/


# 查看结果
cd /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
## 确认当前版本
ls | grep -e log4j -e fastjson -e mybatis -e shiro -e logback -e jackson
## 结果如下
# fastjson-1.2.78.jar
# jackson-annotations-2.10.1.jar
# jackson-core-2.10.1.jar
# jackson-core-asl-1.9.13.jar
# jackson-databind-2.10.1.jar
# jackson-dataformat-cbor-2.10.1.jar
# jackson-dataformat-smile-2.10.1.jar
# jackson-dataformat-yaml-2.10.1.jar
# jackson-datatype-jdk8-2.10.1.jar
# jackson-datatype-jsr310-2.10.1.jar
# jackson-mapper-asl-1.9.13.jar
# jackson-module-parameter-names-2.10.1.jar
# log4j-api-2.10.0.jar
# log4j-to-slf4j-2.10.0.jar
# logback-classic-1.2.10.jar
# logback-core-1.2.10.jar
# mybatis-3.5.7.jar
# mybatis-plus-3.0.7.1.jar
# mybatis-plus-annotation-3.0.7.1.jar
# mybatis-plus-boot-starter-3.0.7.1.jar
# mybatis-plus-core-3.0.7.1.jar
# mybatis-plus-extension-3.0.7.1.jar
# mybatis-spring-2.0.6.jar
# mybatis-spring-boot-autoconfigure-1.3.2.jar
# mybatis-spring-boot-starter-1.3.2.jar
# shiro-cache-1.8.0.jar
# shiro-config-core-1.8.0.jar
# shiro-config-ogdl-1.8.0.jar
# shiro-core-1.8.0.jar
# shiro-crypto-cipher-1.8.0.jar
# shiro-crypto-core-1.8.0.jar
# shiro-crypto-hash-1.8.0.jar
# shiro-ehcache-1.8.0.jar
# shiro-event-1.8.0.jar
# shiro-lang-1.8.0.jar
# shiro-spring-1.8.0.jar
# shiro-web-1.8.0.jar
# thymeleaf-extras-shiro-2.0.0.jar

还原(可选)

# 删除新版本
cd /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/
rm -rf fastjson-1.2.78.jar 
rm -rf jackson-annotations-2.10.1.jar  
rm -rf jackson-core-2.10.1.jar 
rm -rf jackson-databind-2.10.1.jar 
rm -rf jackson-dataformat-cbor-2.10.1.jar 
rm -rf jackson-dataformat-smile-2.10.1.jar 
rm -rf jackson-dataformat-yaml-2.10.1.jar 
rm -rf jackson-datatype-jdk8-2.10.1.jar 
rm -rf jackson-datatype-jsr310-2.10.1.jar 
rm -rf jackson-module-parameter-names-2.10.1.jar 
rm -rf logback-classic-1.2.10.jar 
rm -rf logback-core-1.2.10.jar 
rm -rf mybatis-3.5.7.jar 
rm -rf mybatis-spring-2.0.6.jar 
rm -rf shiro-cache-1.8.0.jar 
rm -rf shiro-config-core-1.8.0.jar 
rm -rf shiro-config-ogdl-1.8.0.jar 
rm -rf shiro-core-1.8.0.jar 
rm -rf shiro-crypto-cipher-1.8.0.jar 
rm -rf shiro-crypto-core-1.8.0.jar 
rm -rf shiro-crypto-hash-1.8.0.jar 
rm -rf shiro-ehcache-1.8.0.jar 
rm -rf shiro-event-1.8.0.jar 
rm -rf shiro-lang-1.8.0.jar 
rm -rf shiro-spring-1.8.0.jar 
rm -rf shiro-web-1.8.0.jar 

#还原之前的版本 (可选)
cp fastjson-1.2.47.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-annotations-2.9.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-core-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-databind-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-dataformat-cbor-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-dataformat-smile-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-dataformat-yaml-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-datatype-jdk8-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-datatype-jsr310-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp jackson-module-parameter-names-2.9.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp logback-classic-1.2.3.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp logback-core-1.2.3.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp mybatis-3.4.6.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp mybatis-spring-1.3.2.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-cache-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-config-core-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-config-ogdl-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-core-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-crypto-cipher-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-crypto-core-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-crypto-hash-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-ehcache-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-event-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-lang-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-spring-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib
cp shiro-web-1.4.0.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib

第三方组件升级

ElasticSearch 依赖升级

版本确认

# 停止服务
/isearch/bin/elasticsearch.sh stop
# 查找需要替换的文件
find /isearch/elasticsearch-7.6.1/ -name log4j\*.jar
# 替换下面文件
/isearch/elasticsearch-7.6.1/lib/log4j-api-2.11.1.jar
/isearch/elasticsearch-7.6.1/lib/log4j-core-2.11.1.jar
/isearch/elasticsearch-7.6.1/modules/x-pack-core/log4j-1.2-api-2.11.1.jar
/isearch/elasticsearch-7.6.1/modules/x-pack-security/log4j-slf4j-impl-2.11.1.jar

备份

# 创建备份目录
mkdir -p /isearch/isa/datas/upgrade/bak/elasticsearch
# 备份文件
cp /isearch/elasticsearch-7.6.1/lib/log4j-api-2.11.1.jar /isearch/isa/datas/upgrade/bak/elasticsearch
cp /isearch/elasticsearch-7.6.1/lib/log4j-core-2.11.1.jar /isearch/isa/datas/upgrade/bak/elasticsearch
cp /isearch/elasticsearch-7.6.1/modules/x-pack-core/log4j-1.2-api-2.11.1.jar /isearch/isa/datas/upgrade/bak/elasticsearch
cp /isearch/elasticsearch-7.6.1/modules/x-pack-security/log4j-slf4j-impl-2.11.1.jar /isearch/isa/datas/upgrade/bak/elasticsearch

升级

# 删除老版本
rm -rf /isearch/elasticsearch-7.6.1/lib/log4j-api-2.11.1.jar
rm -rf /isearch/elasticsearch-7.6.1/lib/log4j-core-2.11.1.jar
rm -rf /isearch/elasticsearch-7.6.1/modules/x-pack-core/log4j-1.2-api-2.11.1.jar
rm -rf /isearch/elasticsearch-7.6.1/modules/x-pack-security/log4j-slf4j-impl-2.11.1.jar

#升级
cd /isearch/isa/datas/upgrade/jar
cp log4j-api-2.17.1.jar /isearch/elasticsearch-7.6.1/lib/
cp log4j-core-2.17.1.jar /isearch/elasticsearch-7.6.1/lib/
cp log4j-1.2-api-2.17.1.jar /isearch/elasticsearch-7.6.1/modules/x-pack-core/
cp log4j-slf4j-impl-2.17.1.jar /isearch/elasticsearch-7.6.1/modules/x-pack-security/

# 确认
find /isearch/elasticsearch-7.6.1/ -name log4j\*.jar
# 如下log4j版本是 2.17.1 
/isearch/elasticsearch-7.6.1/lib/log4j-api-2.17.1.jar
/isearch/elasticsearch-7.6.1/lib/log4j-core-2.17.1.jar
/isearch/elasticsearch-7.6.1/modules/x-pack-core/log4j-1.2-api-2.17.1.jar
/isearch/elasticsearch-7.6.1/modules/x-pack-security/log4j-slf4j-impl-2.17.1.jar

## 重启服务
/isearch/bin/logstash.sh restart

还原

# 删除新版本
rm -rf /isearch/elasticsearch-7.6.1/lib/log4j-api-2.17.1.jar
rm -rf /isearch/elasticsearch-7.6.1/lib/log4j-core-2.17.1.jar
rm -rf /isearch/elasticsearch-7.6.1/modules/x-pack-core/log4j-1.2-api-2.17.1.jar
rm -rf /isearch/elasticsearch-7.6.1/modules/x-pack-security/log4j-slf4j-impl-2.17.1.jar
# 还原老版本
cd /isearch/isa/datas/upgrade/bak/elasticsearch
cp log4j-api-2.11.1.jar /isearch/elasticsearch-7.6.1/lib/
cp log4j-core-2.11.1.jar /isearch/elasticsearch-7.6.1/lib/
cp log4j-1.2-api-2.11.1.jar /isearch/elasticsearch-7.6.1/modules/x-pack-core/
cp log4j-slf4j-impl-2.11.1.jar /isearch/elasticsearch-7.6.1/modules/x-pack-security/

Logstash 升级依赖

版本确认

# 停止服务
/isearch/bin/logstash.sh stop
# 查找需要替换的文件
find /isearch/logstash-7.6.1/logstash-core/ -name log4j\*.jar

#下面的文件替换
/isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-slf4j-impl-2.12.1.jar
/isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-core-2.12.1.jar
/isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-api-2.12.1.jar

备份


# 创建备份目录
mkdir -p /isearch/isa/datas/upgrade/bak/logstash
# 备份文件
cp /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-slf4j-impl-2.12.1.jar /isearch/isa/datas/upgrade/bak/logstash
cp /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-core-2.12.1.jar /isearch/isa/datas/upgrade/bak/logstash
cp /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-api-2.12.1.jar /isearch/isa/datas/upgrade/bak/logstash

# 查看备份结果
ll  /isearch/isa/datas/upgrade/bak/logstash
总用量 2452
-rw-r--r--. 1 isearch isearch  276771 2月  17 14:17 log4j-api-2.12.1.jar
-rw-r--r--. 1 isearch isearch 1674433 2月  17 14:17 log4j-core-2.12.1.jar
-rw-r--r--. 1 isearch isearch   23518 2月  17 14:17 log4j-slf4j-impl-2.12.1.jar

升级

## 删除老版本
rm -rf /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-slf4j-impl-2.12.1.jar 
rm -rf /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-core-2.12.1.jar
rm -rf /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-api-2.12.1.jar
## 替换新版本
cd /isearch/isa/datas/upgrade/jar
cp log4j-api-2.17.1.jar /isearch/logstash-7.6.1/logstash-core/lib/jars/
cp log4j-core-2.17.1.jar /isearch/logstash-7.6.1/logstash-core/lib/jars/
cp log4j-slf4j-impl-2.17.1.jar /isearch/logstash-7.6.1/logstash-core/lib/jars/

## 查看结果
ll /isearch/logstash-7.6.1/logstash-core/lib/jars/ |grep log4j
# 结果如下
-rw-rw-r--. 1 isearch isearch   301872 2月  17 14:19 log4j-api-2.17.1.jar
-rw-rw-r--. 1 isearch isearch  1790452 2月  17 14:19 log4j-core-2.17.1.jar
-rw-rw-r--. 1 isearch isearch    24279 2月  17 14:19 log4j-slf4j-impl-2.17.1.jar



## 启动服务
/isearch/bin/logstash.sh restart

还原

# 删除新版本
# 删除新版本
rm -rf /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-api-2.17.1.jar
rm -rf /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-core-2.17.1.jar
rm -rf /isearch/logstash-7.6.1/logstash-core/lib/jars/log4j-slf4j-impl-2.17.1.jar
# 还原老版本
cd /isearch/isa/datas/upgrade/bak/logstash
cp log4j-api-2.12.1.jar /isearch/logstash-7.6.1/logstash-core/lib/jars/
cp log4j-core-2.12.1.jar /isearch/logstash-7.6.1/logstash-core/lib/jars/
cp log4j-slf4j-impl-2.12.1.jar /isearch/logstash-7.6.1/logstash-core/lib/jars/

## 查看结果
ll /isearch/logstash-7.6.1/logstash-core/lib/jars/ |grep log4j
# 结果如下
-rw-rw-r--. 1 isearch isearch   301872 2月  17 14:19 log4j-api-2.11.1.jar
-rw-rw-r--. 1 isearch isearch  1790452 2月  17 14:19 log4j-core-2.11.1.jar
-rw-rw-r--. 1 isearch isearch    24279 2月  17 14:19 log4j-slf4j-impl-2.11.1.jar