Configuration configuration = new Configuration();
FileSystem fs = FileSystem.get(new URI("hdfs://172.17.0.123:9000"), configuration, "hadoop");
将maven依赖的hadoop-hdfs-client的scope注释掉
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs-client</artifactId>
<version>3.3.0</version>
<!-- <scope>provided</scope>-->
</dependency>