1、guava包冲突
解决方法:spark各个节点版本为guava-14.0,我把spark各个节点本地jar删掉,上传guava-23.5-jre.jar,即可解决。
2、netty包冲突
解决方法:ES集成search-guard安全认证使用到netty包,和spark的netty-all-4.0.29.Final.jar冲突,试过把spark集群的jar包删掉,换我项目的netty包,但是spark作业会报错,后来找到一种解决冲突的方法,使用maven的插件对我项目的jar包路径进行更改,不会出现冲突情况。具体代码如下:
pom文件添加:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>my_netty.common</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/maven/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
最后通过mvn package打包项目就可以了。
检查打好的jar包,会发现io.netty的路径已经变化了
最后问题已解决