Hadoop instances don't publish their Hadoop version by RMI, only their protocol version. Hadoop 0.20.x will use JobTracker protocol 65, DataNode protocol 14, and so forth. You can query this using the Protocol RMI interface, although I'm not sure that this method is accessible through any public manner from JobClient.
There is an nmap script for Hadoop which queries (I believe) the web interface available at http://seclists.org/nmap-dev/2011/q4/58 - porting this script to Java using commons-httpclient and either Pattern or Scanner will not be hard. S. On 17 October 2011 17:41, <[email protected]> wrote: > Hi, > > Is there a way to get the version of a remote hadoop instance through java > API? > > Suppose there are two machines: A and B. I deploy the hadoop instance on > machine A, while my application is deployed on machine B. Before starting > my application, I want to check whether the hadoop instance version is > compatible with my application, so I want to get the version of the hadoop > instance on machine A from B. > > I go through all the API, only find there is a VersionInfo class which can > get you the local Hadoop version, not the remote instance. Do you have any > ideas about this? > > Thanks and regards! > Tao > >
