0

I am new to Hadoop/Giraph and Java. As part of a task, I downloaded Cloudera Quickstart VM and Giraph on top of it. I am using this book named "Practical Graph Analytics with Apache Giraph; Authors: Shaposhnik, Roman, Martella, Claudio, Logothetis, Dionysios" from which I tried to run the first example on Page 111 (Twitter Followership Graph).

Defining the Shell Environment for Giraph Execution

$export HADOOP_HOME=/usr/lib/hadoop
$export GIRAPH_HOME=/usr/local/giraph
$export HADOOP_CONF_DIR=$GIRAPH_HOME/conf
$PATH=$HADOOP_HOME/bin:$GIRAPH_HOME/bin:$PATH

Running the Giraph Application

$ giraph target/*.jar GiraphHelloWorld -vip src/main/resources/1
-vif org.apache.giraph.io.formats.IntIntNullTextInputFormat
-w 1 -ca giraph.SplitMasterWorker=false,giraph.logLevel=error

I created both jar file and java program in /home/cloudera/target folder and the graph txt is created in src/main/resources/1.

I am facing the below attached error after running the above commands with the below attached program.

   https://i.stack.imgur.com/tAQaT.jpg  (Error1)
   https://i.stack.imgur.com/GqY2O.jpg  (Error2)
   https://i.stack.imgur.com/ATacy.jpg  (Java Program)

Please let me know if anything else is needed.

  • 1
    I'm not sure, but it seems that you aren't adding the jar in the classpath, that's why it says "ClassNotFoundException". My advice is that you try to run a standard [example](http://giraph.apache.org/quick_start.html) first, in order to check if everything it's OK. After everything is OK with standard executions, you should try to run any algorithm of your own, or an algorithm "borrowed" from a book – chomp Dec 25 '17 at 22:49
  • @chomp Thank you for the comment. I resolved this issue by creating a Maven project on my own and made sure it ran perfectly fine. That was when, I ran the GiraphHelloWorld example from the book. –  Jan 03 '18 at 23:50

1 Answers1

0

The issue with the above error was the process in which the jar file and class were created. It needs to be created in Eclipse with a new Maven Project. I created my own pom file, java program and build the project.

Once it was successful in creating jars and classes, I then tried to run the GiraphHelloWorld example by following a systematic approach as before. Also make sure to provide the HADOOP_CLASSPATH to the folder which contains "classes" folder.