Benjamin, my guess is that your jar might not have all the ZooKeeper dependencies. Can you look at the log for the process that was supposed to start ZooKeeper? I'm thinking it didn't start...


On 3/20/12 1:14 PM, Benjamin Heitmann wrote:

after getting my feet wet with the InternalVertexRunner, I tried packaging a 
Giraph job as a jar for the first time.

I am getting the following error:

12/03/20 17:21:04 INFO mapred.JobClient: Task Id : 
attempt_201203201422_0009_m_000000_2, Status : FAILED
java.lang.IllegalStateException: onlineZooKeeperServers: Failed to connect in 
10 tries!
        at org.apache.giraph.graph.GraphMapper.setup(
        at org.apache.hadoop.mapred.MapTask.runNewMapper(
        at org.apache.hadoop.mapred.Child$
        at Method)
        at org.apache.hadoop.mapred.Child.main(

attempt_201203201422_0009_m_000000_2: log4j:WARN No appenders could be found 
for logger (org.apache.giraph.zk.ZooKeeperManager).
attempt_201203201422_0009_m_000000_2: log4j:WARN Please initialize the log4j 
system properly.

Here is some more information, which hopefully might give this mailing list 
some insight into what is happening,
because I cant figure it out...

* I am using Hadoop 1.0.1 and giraph svn revision 1293545 (the last one from 
* If I run the same Vertex class and Input/OutputFormat using 
InternalVertexRunner, then everything works fine. (using again Hadoop 1.0.1 and 
giraph rev 1293545)
* I package the giraph job as a selfcontaining jar, and it contains the giraph 
jar, as well as the zookeeper jar in its lib dir
(I mostly used the recipe from here )
* there was an error in which hadoop could not find a class. And I had to fix 
that error with:
* My Vertex class extends HashMapVertex<Text, Text, Text, NullWritable>
* I followed the code example from SimpleShortestPathVertex regarding the run() 
method and using the main method to call

Here is the code for my run() method:

        public int run(String[] args) throws Exception {
                // takes 3 args: inputDir outputDir numberOfWorkers
            GiraphJob job = new GiraphJob(getConf(), getClass().getName());
            FileInputFormat.addInputPath(job, new Path(args[0]));
            FileOutputFormat.setOutputPath(job, new Path(args[1]));
Integer.parseInt(args[2]), 100.0f);

            return ? 0 : -1;

Am I constructing the GiraphJob in the wrong way ?

I saw the GiraphRunner class, but the giraph source tree currently does not 
seem to contain an example of how to use that class.
Is it safer to use that class for starting a GiraphJob ?
If yes, how should the job jar be assembled in order to use GiraphRunner ?

sincerely, Benjamin Heitmann.

Reply via email to