I was doing some work in AWS and I decided to stop my free tier instance and start up a new medium tier instance. I was going through the usual drill of selecting the Amazon AMI, configuring and tagging the instance, and then launching it. Once in installing Anaconda and setting up Hadoop except this time I ran into a problem I didn’t have in the free instance so I thought I would write about it and how I solved it in case someone else hits a similar snag.
After running the start scripts for hdfs, yarn, and history server you should run jps to get the list of java processes running to make sure things are working. Unlike the last time in the other instance where there was no problem when I ran it this time I got an error message:
[ec2-user@ip ~]$ jps
-bash: jps: command not found
That is strange since the OpenJDK is installed already as part of the AMI so my first thought was that there must be a path problem which seemed reasonable especially when I found a StackExchange thread with the same problem/answer. Unfortunately this did not solve the problem so I began to wonder why. I checked the contents of openjdk’s bin and I noticed there was no jps.
[ec2-user@ip ~]$ ls /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin
java keytool orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200
So back to Google to find another StackExchange thread which indicated that the openjdk development tools also needed to be installed and apparently had not been as part of this AMI build.
[ec2-user@ip ~]$ sudo yum install java-1.7.0-openjdk-devel
Loaded plugins: priorities, update-motd, upgrade-helper
–> Running transaction check
—> Package java-1.7.0-openjdk-devel.x86_64 1:188.8.131.52-184.108.40.206.69.amzn1 will be installed
–> Finished Dependency Resolution
Package Arch Version Repository Size
java-1.7.0-openjdk-devel x86_64 1:220.127.116.11-18.104.22.168.69.amzn1 amzn-updates 11 M
Install 1 Package
Total download size: 11 M
Installed size: 36 M
Is this ok [y/d/N]: y
java-1.7.0-openjdk-devel-22.214.171.124-126.96.36.199.69.amzn1.x86_64.rpm | 11 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Installing : 1:java-1.7.0-openjdk-devel-188.8.131.52-184.108.40.206.69.amzn1.x86_64 1/1
Verifying : 1:java-1.7.0-openjdk-devel-220.127.116.11-18.104.22.168.69.amzn1.x86_64 1/1
This did end up solving the problem
[ec2-user@ip ~]$ jps
At least it is fixed now.
sudo yum install ant
This will install the needed dependencies.