hadoop-streaming: map running good in pesudo-distributed mode, but reducer doesn't seem to work correctly
===

My `Map` looks like

    import sys
    
    index = int(sys.argv[1])
    max = 0
    for line in sys.stdin:
        fields = line.strip().split(",")
        if fields[index].isdigit():
            val = int(fields[index])
            if (val > max):
                max = val
    else:
        print max

My `Reducer` looks like

    import sys
    
    for line in sys.stdin:
        print line

- I run just map task with flag `D mapred.reduce.tasks=0` and get 4 output files as result of each map, which looks good

- Then I add a reducer with flag option `D mapred.reduce.tasks=1` and `-reduce <reduce_filepath>` but then things start to change, the status stays as  

>     > 12/07/31 06:15:41 INFO streaming.StreamJob:  map 0%  reduce 0%
>     > 12/07/31 06:15:57 INFO streaming.StreamJob:  map 49%  reduce 0%
>     > 12/07/31 06:16:01 INFO streaming.StreamJob:  map 50%  reduce 0%
>     > 12/07/31 06:16:07 INFO streaming.StreamJob:  map 69%  reduce 0%
>     > 12/07/31 06:16:10 INFO streaming.StreamJob:  map 100%  reduce 0%

I go back and check in logs, I see in `attempt_201207301615_0006_r_000000_0/syslog` as  

    2012-07-31 06:23:00,178 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Need another 4 map output(s) where 1 is already in progress
    2012-07-31 06:23:00,178 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Scheduled 0 outputs (0 slow hosts and3 dup hosts)
    2012-07-31 06:24:00,179 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Need another 4 map output(s) where 1 is already in progress
    2012-07-31 06:24:00,180 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Scheduled 0 outputs (0 slow hosts and3 dup hosts)
    2012-07-31 06:25:00,180 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Need another 4 map output(s) where 1 is already in progress
    2012-07-31 06:25:00,180 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Scheduled 0 outputs (0 slow hosts and3 dup hosts)
    2012-07-31 06:25:40,789 WARN org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 copy failed: attempt_201207301615_0006_m_000000_0 from 10.1.71.253
    2012-07-31 06:25:40,791 WARN org.apache.hadoop.mapred.ReduceTask: java.net.SocketTimeoutException: connect timed out
    	at java.net.PlainSocketImpl.socketConnect(Native Method)
    	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
    	at java.net.Socket.connect(Socket.java:529)
    	at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
    	at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
    	at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
    	at sun.net.www.http.HttpClient.<init>(HttpClient.java:227)
    	at sun.net.www.http.HttpClient.New(HttpClient.java:300)
    	at sun.net.www.http.HttpClient.New(HttpClient.java:317)
    	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
    	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
    	at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$MapOutputCopier.getInputStream(ReduceTask.java:1618)
    	at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$MapOutputCopier.setupSecureConnection(ReduceTask.java:1575)
    	at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$MapOutputCopier.getMapOutput(ReduceTask.java:1483)
    	at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$MapOutputCopier.copyOutput(ReduceTask.java:1394)
    	at org.apache.hadoop.mapred.ReduceTask$ReduceCopier$MapOutputCopier.run(ReduceTask.java:1326)
    
    2012-07-31 06:25:40,791 INFO org.apache.hadoop.mapred.ReduceTask: Task attempt_201207301615_0006_r_000000_0: Failed fetch #3 from attempt_201207301615_0006_m_000000_0
    2012-07-31 06:25:40,791 WARN org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 adding host 10.1.71.253 to penalty box, next contact in 21 seconds
    2012-07-31 06:25:40,791 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0: Got 1 map-outputs from previous failures
    2012-07-31 06:26:00,797 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Need another 4 map output(s) where 0 is already in progress
    2012-07-31 06:26:00,798 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Scheduled 0 outputs (1 slow hosts and0 dup hosts)
    2012-07-31 06:26:00,798 INFO org.apache.hadoop.mapred.ReduceTask: Penalized(slow) Hosts: 
    2012-07-31 06:26:00,798 INFO org.apache.hadoop.mapred.ReduceTask: 10.1.71.253 Will be considered after: 1 seconds.
    2012-07-31 06:26:05,800 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Scheduled 1 outputs (0 slow hosts and0 dup hosts)
    2012-07-31 06:27:00,798 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Need another 4 map output(s) where 1 is already in progress
    2012-07-31 06:27:00,798 INFO org.apache.hadoop.mapred.ReduceTask: attempt_201207301615_0006_r_000000_0 Scheduled 0 outputs (0 slow hosts and3 dup hosts)


What is causing this? I am running job in `pseudo-distributed` mode

How can I fix this?