在使用hdfs的api设置路径时一定要查看core-site.xml配置文件中的fs.defaultFS标签中的写法是否与你当前的
val path = "hdfs://localhost:9000/tmp/frf/pScheduleSparkSqls"中的主机名以及端口号是否一致,否则就会报错
Caused by: java.net.ConnectException: Connection refused: no further information
core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>