本文主要是介绍SparkR运行时报错:Error in socketConnection(port = monitorPort) : cannot open the connection,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在安装完Spark和R之后运行Spark自带的R示例报错:
[SparkR@Master1 spark-1.6.1-bin-hadoop2.6]$ bin/spark-submit examples/src/main/r/dataframe.R
Loading required package: methods
Attaching package: ‘SparkR’
The following objects are masked from ‘package:stats’:
cov, filter, lag, na.omit, predict, sd, var
The following objects are masked from ‘package:base’:
colnames, colnames<-, intersect, rank, rbind, sample, subset,
summary, table, transform
Error in value[[3L]](cond) : Failed to connect JVM
Calls: sparkR.init ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
In addition: Warning message:
In socketConnection(host = hostname, port = port, server = FALSE, :
localhost:37904 cannot be opened
Execution halted
之后查看R脚本逐行执行出现如下错误:
Launching java with spark-submit command /home/SparkR/spark-1.6.1-bin-hadoop2.6/bin/spark-submit "sparkr-shell" /tmp/RtmpYejr1t/backend_port18b47205d38
Error in socketConnection(port = monitorPort) :
cannot open the connection
In addition: Warning message:
In socketConnection(port = monitorPort) : localhost:59096 cannot be opened
错误原因:
用户的访问地址不正确,查看/etc/hosts文件多了如下内容:
注释掉之后就可以了
这篇关于SparkR运行时报错:Error in socketConnection(port = monitorPort) : cannot open the connection的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!