AnsweredAssumed Answered

Issue running a remote client of PySpark

Question asked by rvelfre on Jun 8, 2016
Latest reply on Jun 8, 2016 by rvelfre


Hello,

 

I'm trying to configure a remote client of PySpark.

My remote is my laptop (Mac) and I would like to execute a job on a VM which is running MapR 5.1 and Spark 1.6.1.

 

I've installed Spark 1.6.1 on my Mac (from Apache) and a MapR Client (which is working perfectly).

 

Here is the code I'm trying to run :

 

1)  Start PySpark on my Mac and configure the master to be my VM.

./pyspark --master spark://192.168.216.128:7077

 

2) Load a file into mydata (the file exist)

mydata = sc.textFile('maprfs:///user/hive/warehouse/data.txt')

 

3) count the number of line of mydata

mydata.count()

 

And the error is the following : "No FileSystem for scheme: maprfs"

 

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/opt/spark-1.6.1-bin-hadoop2.6/python/pyspark/rdd.py", line 1004, in count

    return self.mapPartitions(lambda i: [sum(1 for _ in i)]).sum()

  File "/opt/spark-1.6.1-bin-hadoop2.6/python/pyspark/rdd.py", line 995, in sum

    return self.mapPartitions(lambda x: [sum(x)]).fold(0, operator.add)

  File "/opt/spark-1.6.1-bin-hadoop2.6/python/pyspark/rdd.py", line 869, in fold

    vals = self.mapPartitions(func).collect()

  File "/opt/spark-1.6.1-bin-hadoop2.6/python/pyspark/rdd.py", line 771, in collect

    port = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd())

  File "/opt/spark-1.6.1-bin-hadoop2.6/python/lib/py4j-0.9-src.zip/py4j/java_gateway.py", line 813, in __call__

  File "/opt/spark-1.6.1-bin-hadoop2.6/python/pyspark/sql/utils.py", line 45, in deco

    return f(*a, **kw)

  File "/opt/spark-1.6.1-bin-hadoop2.6/python/lib/py4j-0.9-src.zip/py4j/protocol.py", line 308, in get_return_value

py4j.protocol.Py4JJavaError: An error occurred while calling z:org.apache.spark.api.python.PythonRDD.collectAndServe.

: java.io.IOException: No FileSystem for scheme: maprfs

  at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2584)

  at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2591)

  at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:91)

  at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2630)

  at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2612)

  at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:370)

  at org.apache.hadoop.fs.Path.getFileSystem(Path.java:296)

  at org.apache.hadoop.mapred.FileInputFormat.singleThreadedListStatus(FileInputFormat.java:256)

  at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:228)

  at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:313)

  at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:199)

  at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)

  at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)

  at scala.Option.getOrElse(Option.scala:120)

  at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)

  at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)

  at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)

  at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)

  at scala.Option.getOrElse(Option.scala:120)

  at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)

  at org.apache.spark.api.python.PythonRDD.getPartitions(PythonRDD.scala:58)

  at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)

  at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)

  at scala.Option.getOrElse(Option.scala:120)

  at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)

  at org.apache.spark.SparkContext.runJob(SparkContext.scala:1929)

  at org.apache.spark.rdd.RDD$$anonfun$collect$1.apply(RDD.scala:927)

  at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)

  at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:111)

  at org.apache.spark.rdd.RDD.withScope(RDD.scala:316)

  at org.apache.spark.rdd.RDD.collect(RDD.scala:926)

  at org.apache.spark.api.python.PythonRDD$.collectAndServe(PythonRDD.scala:405)

  at org.apache.spark.api.python.PythonRDD.collectAndServe(PythonRDD.scala)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  at java.lang.reflect.Method.invoke(Method.java:498)

  at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)

  at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)

  at py4j.Gateway.invoke(Gateway.java:259)

  at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)

  at py4j.commands.CallCommand.execute(CallCommand.java:79)

  at py4j.GatewayConnection.run(GatewayConnection.java:209)

  at java.lang.Thread.run(Thread.java:745)

 

I tested many configurations and I'm always getting this Error.

This is not related to the transformation I'm using (I tested with a show or many other transformation).

 

Has someone already solve my issue ?

 

Some more information :

 

MacBook-Pro-de-Raphael:~ raphaelvelfre$ hadoop fs -ls /user/hive/warehouse/

16/06/08 09:50:39 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Found 1 items

-rw-rw-r--   1 2000 2000         61 2016-06-07 12:26 /user/hive/warehouse/data.txt

 

Thanks !

Outcomes