[ 
https://issues.apache.org/jira/browse/HADOOP-8232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242560#comment-13242560
 ] 

Steve Loughran commented on HADOOP-8232:
----------------------------------------

Output when a script is provided that does not exist
{code}
bash hadoop-dist/target/hadoop-3.0.0-SNAPSHOT/bin/hadoop --config 
/Users/slo/Java/Hadoop/github/hadoop-patches/misc/topology/missing-script 
org.apache.hadoop.net.TopologyTool test single-host
net.topology.node.switch.mapping.impl=org.apache.hadoop.net.ScriptBasedMapping
Caching wrapper class = class org.apache.hadoop.net.ScriptBasedMapping
Mapping script filename= "there-is-no-script-with-this-name.py"
Mapping script path = 
"/Users/slo/Java/Hadoop/github/trunk/there-is-no-script-with-this-name.py"
2012-03-30 18:16:04,211 WARN  net.TopologyTool (TopologyTool.java:run(91)) - 
Script file not found -the script must be in the execution path
Instance information: script-based mapping with script 
"there-is-no-script-with-this-name.py"
Topology is not  considered single-switch
Resolving single-host
2012-03-30 18:16:04,346 WARN  net.ScriptBasedMapping 
(ScriptBasedMapping.java:runResolveCommand(245)) - Exception running 
there-is-no-script-with-this-name.py single-host 
java.io.IOException: Cannot run program "there-is-no-script-with-this-name.py" 
(in directory "/Users/slo/Java/Hadoop/github/trunk"): error=2, No such file or 
directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
        at org.apache.hadoop.util.Shell.runCommand(Shell.java:206)
        at org.apache.hadoop.util.Shell.run(Shell.java:188)
        at 
org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:381)
        at 
org.apache.hadoop.net.ScriptBasedMapping$RawScriptBasedMapping.runResolveCommand(ScriptBasedMapping.java:242)
        at 
org.apache.hadoop.net.ScriptBasedMapping$RawScriptBasedMapping.resolve(ScriptBasedMapping.java:180)
        at 
org.apache.hadoop.net.CachedDNSToSwitchMapping.resolve(CachedDNSToSwitchMapping.java:119)
        at 
org.apache.hadoop.net.TopologyTool.resolveHostnames(TopologyTool.java:189)
        at org.apache.hadoop.net.TopologyTool.run(TopologyTool.java:103)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
        at org.apache.hadoop.net.TopologyTool.main(TopologyTool.java:228)
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
        at java.lang.ProcessImpl.start(ProcessImpl.java:91)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
        ... 11 more
2012-03-30 18:16:04,352 WARN  net.TopologyTool 
(TopologyTool.java:resolveHostnames(192)) - Hostname resolution returned a null 
list

Final topology:

Mapping: script-based mapping with script "there-is-no-script-with-this-name.py"
Known mappings:
Nodes: 0
Switches: 0
{code}

Here the exec() stack trace is being caught and printed inside the 
{{ScriptBasedMapping}} class -all the {{TopologyTool}} sees is a null value 
being passed back from the resolve operation.

After execution the map is dumped and shown to be empty.

It's hard to give better diagnostics on the failure when the failure itself 
isn't visible to the caller. At least it is now visible outside the daemons.
                
> Provide a command line entry point to view/test topology options
> ----------------------------------------------------------------
>
>                 Key: HADOOP-8232
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8232
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: util
>    Affects Versions: 0.23.1
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>            Priority: Minor
>         Attachments: HADOOP-8232.patch
>
>
> Add a new command line entry point "topo" with commands for preflight 
> checking of a clusters topology setup. 
> The initial operations would be to list the implementation class of the 
> mapper, and attempt to load it, resolve a set of supplied hostnames, then 
> dump the topology map after the resolution process.
> Target audience: 
> # ops teams trying to get a new/changed script working before deploying it on 
> a cluster.
> # someone trying to write their first script.
> Resolve and list the rack mappings of the given host
> {code}
> hadoop topo test [host1] [host2] ... 
> {code}
> This would load the hostnames from a given file, resolve all of them and list 
> the results:
> {code}
> hadoop topo testfile filename
> {code}
>  This version is intended for the ops team who have a list of hostnames, IP 
> addresses. 
> * Rather than just list them, the ops team may want to mandate that there 
> were no /default-rack mappings found, as that is invariably a sign that the 
> script isn't handling a hostname properly.
> * No attempt to be clever and do IP address resolution, FQDN to hostname 
> mapping, etc.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to