Re: Spark standalone cluster - Output file stored in temporary directory in worker
I think the properties that you have in your hdfs-site.xml should go in the core-site.xml (at least for the namenode.name and datanote.data ones). I might be wrong here, but that's what I have in my setup. you should also add hadoop.tmp.dir in your core-site.xml. That might be the source of your inconsistency. as for hadoop-env.sh, I just use it to export variable such as HADOOP_PREFIX, LOG_DIR, CONF_DIR and JAVA_HOME. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-standalone-cluster-Output-file-stored-in-temporary-directory-in-worker-tp23653p23697.html Sent from the Apache Spark User List mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org
Re: Spark standalone cluster - Output file stored in temporary directory in worker
core-site.xml fs.default.name hdfs://localhost:9000 hdfs_site.xml - dfs.replication 1 dfs.namenode.name.dir file:/usr/local/hadoop_store/hdfs/namenode dfs.datanode.data.dir file:/usr/local/hadoop_store/hdfs/datanode I have not made any changes to the default hadoo-env.sh apart from manually adding the JAVA_HOME entry. What should the properties be configured to ? To the master HDFS where the file is actually present ? Thanks. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-standalone-cluster-Output-file-stored-in-temporary-directory-in-worker-tp23653p23683.html Sent from the Apache Spark User List mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org
Re: Spark standalone cluster - Output file stored in temporary directory in worker
Can you share your hadoop configuration file please? - etc/hadoop/core-site.xml - etc/hadoop/hdfs-site.xml - etc/hadoop/hadoo-env.sh AFAIK, the following properties should be configured: hadoop.tmp.dir, dfs.namenode.name.dir, dfs.datanode.data.dir and dfs.namenode.checkpoint.dir Otherwise, an HDFS slave will use it's default temporary folder to save blocks. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-standalone-cluster-Output-file-stored-in-temporary-directory-in-worker-tp23653p23656.html Sent from the Apache Spark User List mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org
Spark standalone cluster - Output file stored in temporary directory in worker
I have a Spark standalone cluster with 2 workers - Master and one slave thread run on a single machine -- Machine 1 Another slave running on a separate machine -- Machine 2 I am running a spark shell in the 2nd machine that reads a file from hdfs and does some calculations on them and stores the result in hdfs. This is how I read the file in spark shell - val file = sc.textFile("hdfs://localhost:9000/user/root/table.csv") And this is how I write the result back to a file - finalRDD.saveAsTextFile("hdfs://localhost:9000/user/root/output_file") When I run the code, it runs in the cluster and the job succeeds with each worker processing roughly half of the input file. I am also able to see the records processed in the webUI. But when I check HDFS in the 2nd machine, I find only one part of the output file. The other part is stored in the hdfs in the 1st machine. But even the part is not actually present in the proper hdfs location and is instead stored in a _temporary directory In machine 2 - root@worker:~# hadoop fs -ls ./output_file Found 2 items -rw-r--r-- 3 root supergroup 0 2015-07-06 16:12 output_file/_SUCCESS -rw-r--r-- 3 root supergroup 984337 2015-07-06 16:12 output_file/part-0 In machine 1 - root@spark:~# hadoop fs -ls ./output_file/_temporary/0/task_201507061612_0003_m_01 -rw-r--r-- 3 root supergroup 971824 2015-07-06 16:12 output_file/_temporary/0/ task_201507061612_0003_m_01/part-1 I have a couple of questions - 1. Shouldn't both parts be on the worker 2 ( since the hdfs referred to in the saveAsTextFile is the local hdfs) ? OR will the output be always split in the workers ? 2. Why is the output stored in the _temporary directory in machine 1 ? -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-standalone-cluster-Output-file-stored-in-temporary-directory-in-worker-tp23653.html Sent from the Apache Spark User List mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org