星火+ Python的 - Java的网关进程发送驱动其端口号之前退出? [英] Spark + Python - Java gateway process exited before sending the driver its port number?

查看:361
本文介绍了星火+ Python的 - Java的网关进程发送驱动其端口号之前退出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我得到我的浏览器屏幕上的这个错误,

Why do I get this error on my browser screen,

:Java的网关进程退出前
  发送驱动其端口号
        ARGS =('Java的网关发送驱动其端口号之前退出的过程',)
        消息='Java的网关进程发送驱动程序之前退出其端口号

: Java gateway process exited before sending the driver its port number args = ('Java gateway process exited before sending the driver its port number',) message = 'Java gateway process exited before sending the driver its port number'

#!/Python27/python
print "Content-type: text/html; charset=utf-8"
print

# enable debugging
import cgitb
cgitb.enable()

import os
import sys

# Path for spark source folder
os.environ['SPARK_HOME'] = "C:\Apache\spark-1.4.1"

# Append pyspark to Python Path
sys.path.append("C:\Apache\spark-1.4.1\python")

from pyspark import SparkContext
from pyspark import SparkConf

print ("Successfully imported Spark Modules")

# Initialize SparkContext
sc = SparkContext('local')
words = sc.parallelize(["scala","java","hadoop","spark","akka"])
print words.count()

我跟着这个例如

任何想法我怎么能解决这个问题?

Any ideas how I can fix it?

推荐答案

我有一个类似的问题这一点,并最终当我看着我的测试输出有来自 $ SPARK_HOME / bin中的错误信息/火花级,行号。

I had a similar issue to this, and eventually when I looked at the my test's output there were error messages from $SPARK_HOME/bin/spark-class, with line numbers.

跟踪发生了什么事受影响的线路上的事实证明,还有周围的 $ JAVA_HOME 值的单引号在我的环境变量,这是导致与问题之后路径扩展(这是假设由于某种原因,是相对于我的主目录,而不是绝对路径)

After tracking down what was going on on the affected lines it turned out that there were single quotes around the $JAVA_HOME value in my environmental variables, which was causing issues with path expansion (it was assumed for some reason to be relative to my home directory, rather than an absolute path)

虽然这可能不是你确切的问题,这是值得研究的输出额外的信息开始在缩小的根本原因,以帮助。

While this may not be your exact issue, it is worth examining the start of your output for extra information to help in narrowing down the root cause.

这篇关于星火+ Python的 - Java的网关进程发送驱动其端口号之前退出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆