Wednesday, June 17, 2015

Run Hadoop Unit-Tests on an Amazon EC2 Ubuntu instance, then disconnect

I am using an Amazon EC2 Ubuntu instance to build Hadoop codebase and it takes several hours. During Unit-Tests run the Putty SSH connection disconnects and the build also stops along with it, since the session ends. So I had the problem where I couldn't complete the build.

I raised with as a question in the AWS forum as well.
https://forums.aws.amazon.com/thread.jspa?threadID=182760&tstart=0

Later I found out it could be done using the "nohup" command as follows:
The maven build command is highlighted in yellow.
nohup mvn -Dmaven.test.failure.ignore=true test </dev/null > unit-test.log 2>&1 &


When you log into the instance again use the following command to see the Unit Test output:
tail -f -n 20 unit-test.log

No comments:

Post a Comment