Need tips on how to integrate Spark on a local Hadoop cluster
Hi.
I am an Engineering student and am currently working on a Big Data project. I am doing the project one of the Computer Labs in my College (5 PCs - 1 Master, 4 Slaves - Ubuntu 18.04 - Hadoop 2.7.7).
For the first part of the project, I successfully configured the Multinode cluster and carried out the required tasks (Analyzing a data set using a K-Nearest Neighbor Alogrithm in Java).
For this I used this blog as a reference. (Additionally, if you think this isn't an ideal configuration, I would love to get some tips and feedback so that my Hadoop cluster works better).
Now, I plan to carry out the same analysis but with Spark on the same Hadoop Cluster. I tried to follow this guide to set it up (Note: I used the appropriate spark version) and it kind of worked. Spark does seem to start but there are numerous errors.
I am a beginner with very basic knowledge in this. It took me about 2-3 weeks to fully understand, configure and run my Hadoop cluster.
I would really appreciate if you could:
- Help point out the issues with the resources I linked and how can I rectify them.
- If you have any better tutorials, blogs or guides that I can read/watch and understand this better please share the links.
- Am I even doing this right? I have had no actual courses on these topics in College and I am just doing this because the field of Big Data, Machine Learning, etc interest me.
- How does Cloudera,, Hortonworks etc actually work? I have full systems with ubuntu and not VMs and I have been unable to find a guide or blog that could help me setup either of those services for my cluster of 5 Computers. If these are any good, I would really appreciate it if you could explain it a little and/or link some blogs, guides or tutorials I could refer to.
I have been stuck on this for a few weeks now. Trying to figure out how to run it. Haven't had a lot of success. Any help would be really appreciated!
Thanks. :)
Posted Dec 9, 2018, 2:12 PM UTC · edited
The steps in the attached link seem about right. Can you share the error you are running into for the spark job? Share the steps that you are using to execute the spark-job for better understanding and troubleshooting.
A good start to sanitise your setup (in context to spark on yarn) would be to open up a quick session of spark-shell and execute a small job. It could just read a simple local file and print the count of the records therein. This https://medium.com/@mrpowers/manually-creating-spark-dataframes-b14dae906393 could help?
I will try this out tomorrow when I go back to the lab. I will also share the error logs then since I don't have them on me right now.
Thank you for the link (and the quick response :) ), I will test that and see what happens. I will post the errors, results, etc tomorrow so that you can get a better picture of the issues.
Hey, I had to fix some issues with one of the nodes and also wait for the tests that we already had running.
This is what I get when I start the spark shell:
https://pastebin.com/F3MDNPjj
Is this fine?
Looks like it isn't able to connect to HDFS. Is it a kerberos enabled cluster? Can you check if basic HDFS commands are working for you? What is the set value for fs.DefaulFs?
Hey, thanks for responding again.
I fixed it after going through the process all over again. It wasn't able to connect to hdfs because my Namenode is called 'master' but while setting up spark I used 'node-master' as that was the name in the Linode article and I'm an idiot :D
It's fixed now and I can submit jobs, but, there's one little (or giant issue) I have and I cannot find the solution.
In Hadoop, I used to pass the location of the output folder as an argument and the output could be found in HDFS.
In Spark, the "spark-logs" folder (in hdfs and even the web UI at master:18080) only has the logs. Can you tell me where I can find the solutions or how I can specify an output folder in my Spark App Code (written in Scala), or how I can pass a specific folder location in HDFS to the spark submit job to get the output there?
Depends what code you are using for your example run. When you say, your spark app does not write to hdfs, what does it do then? Does it succeeds and you don't see any target or does it fail midstream or you simply don't know what's happening? Can you try providing complete file path while referencing hdfs location as hdfs:\path?