Hi Eugeny, I do something like this in a jetty server, which I start with java -jar server.jar.
To monitor hadoop jobs, I simply use the JobClient class and manually set the "fs.default.name"/"mapred.job.tracker" properties on the JobConf object used in the JobClient constructor. Since I don't have to use the hadoop config directory, I don't need to use the bin/hadoop scripts to start my server. To submit hadoop jobs from my server, I shell out with Runtime.getRuntime() to call bin/hadoop jar path/to/job.jar. This is because many users write mapreduce jobs that call System.exit, or write errors to stdout/stderr (particularly during command-line argument processing). It is usually more helpful to capture these errors and return an error status in the webapp, and to prevent the user from shutting down the server by calling System.exit. -Michael On 11/22/07 2:31 AM, "Eugeny N Dzhurinsky" <[EMAIL PROTECTED]> wrote: > Hello gentlemen! > > We would like to integrate our hadoop-based application into Tomcat. The WEB > part will be used to manage job submission and control jobs, and initially all > jobs will reside within same JVM as Tomcat. > > The question is - should we use the Hadoop scripts to start the Tomcat > (bin/hadoop jar path/to/tomcat/jar) with configuring the system properties and > classpath, or there is another way (perhaps simpler and more straightforward) > which does not need Tomcat to be running in Hadoop environment as an Hadoop > application? > > Thank you in advance!
