Reply
Highlighted
Explorer
Posts: 6
Registered: ‎09-02-2015

Spark Job - An error occurred while trying to connect to the Java server

Hi,

I am using Spark 1.6 and getting the below error, can some one help me pls.

 

 

ERROR:py4j.java_gateway:An error occurred while trying to connect to the Java server
Traceback (most recent call last):
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/py4j-0.9-src.zip/py4j/java_gateway.py", line 690, in start
    self.socket.connect((self.address, self.port))
  File "/usr/lib64/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused
Traceback (most recent call last):
  File "spark.py", line 105, in <module>
    main()
  File "spark.py", line 101, in main
    left_outer_join.write.mode('overwrite').parquet("/user/hadoop/spark_test/")
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/pyspark.zip/pyspark/sql/readwriter.py", line 461, in parquet
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/py4j-0.9-src.zip/py4j/java_gateway.py", line 811, in __call__
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/py4j-0.9-src.zip/py4j/java_gateway.py", line 631, in send_command
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/py4j-0.9-src.zip/py4j/java_gateway.py", line 624, in send_command
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/py4j-0.9-src.zip/py4j/java_gateway.py", line 579, in _get_connection
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/py4j-0.9-src.zip/py4j/java_gateway.py", line 585, in _create_connection
  File "/mnt/yarn/usercache/hadoop/appcache/application_1464969839758_0041/container_1464969839758_0041_01_000001/py4j-0.9-src.zip/py4j/java_gateway.py", line 697, in start
py4j.protocol.Py4JNetworkError: An error occurred while trying to connect to the Java server