我使用hadoop 2.6.3,spark 2.0.0(以前是1.6.1),hive 2.0配置了hadoop集群;
最近,我更改了hadoop端口规范。一个重大更改是core-site.xml中的fs.defaultFS。我从更改了此属性
hdfs://10.104.90.40:9000
至
hdfs://10.104.90.40:8020
之后,我重述了hadoop。现在我想用代码编写一个表格与SparkSql配置单元:
df=sqlContext.sql('select * from vehicle')
df.take(1) //this can show the content correctly
df.write.saveAsTable('try')
但是,它总是失败,并显示以下错误:
py4j.protocol.Py4JJavaError: An error occurred while calling o405.saveAsTable.
: java.net.ConnectException: Call From namenode01-bi-dev/10.104.90.40 to
namenode01-bi-dev:9000 failed on connection exception:
java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
回到我使用spark 1.6.1(已经将fs.defaultFS端口更改为8020)之前,当我运行saveAsTable命令时,会弹出完全相同的消息。显然,该错误是由于尝试连接到不再使用的端口而导致的。
我尝试了以下命令,以查找是否忘记了更改某些设置,只是发现没有包含“ 9000”内容的配置文件
grep -rnw '/usr/local/' -e "9000"
其他一切都可以正常工作,下面的命令或代码都可以正常工作
hadoop fs -put/get
hdfs getconf -confKey fs.defaultFS //the outout is hdfs://10.104.90.40:8020
//within pyspark-shell
ff=sc.textFile("somefile")
ff.saveAsTextFile("/ll")
对我来说,saveAsTable调用9000端口没有任何意义。
您是否尝试过重新启动Hive Metastore,
sudo service hive-metastore restart
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句