如何将Sparlyr连接到Spark独立集群

时间:2018-07-28 16:18:07

标签: r apache-spark sparklyr

这就是我尝试连接到群集的方式

Sys.setenv(SPARK_HOME="/usr/local/Cellar/apache-spark/2.3.1/")
config <- spark_config()
sc <- spark_connect(master = "spark://192.168.0.100:7077", config = 
config, version = '2.3.1')

这是结果:

Error in force(code) : 
  Failed while connecting to sparklyr to port (8880) for sessionid (88284): Gateway in port (8880) did not respond.
Path: /usr/local/Cellar/apache-spark/2.3.1/bin/spark-submit
Parameters: --class, sparklyr.Shell, '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/sparklyr/java/sparklyr-2.3-2.11.jar', 8880, 88284
Log: /var/folders/dw/mx796jyn2ydgw0fj536q21tm0000gn/T//RtmpeStX3x/file27531f8f123_spark.log
---- Output Log ----


---- Error Log ----

1 个答案:

答案 0 :(得分:0)

查看了几种解决方案后,这是一种简单的方法。问题是我在Brew所安装的Mac上使用spark,因此该路径是libexec中仅2.3.1插入的一个文件夹-因此,现在工作正常。

sc <- spark_connect(master="spark://192.168.0.100:7077", 
                    version = "2.3.1",
                    config = conf,
                    spark_home = "/usr/local/Cellar/apache-spark/2.3.1/libexec/