Hadoop stream streaming Run python program

Source: Internet
Author: User
Tags hadoop fs

Put the command first:

Hadoop jar/usr/hadoop-1.2. 1/contrib/streaming/hadoop-streaming-1.2. 1. Jar-mapper mapper.py- file mapper.py-reduce reduce.py- file reduce.py-file Params.txt-file params2.txt-input/data/*-output/output

Where output does not exist can only be.

The output of the mapper.py is passed directly to reduce.py

For example, in a Hadoop cluster, there are several files in the/data/directory:

[Email protected] program]# Hadoop FS-ls/data/FoundTenItems-rw-r--r--3Root supergroup35596  -- .- -  -: $/data/cars-xx-rw-r--r--3Root supergroup35592  -- .- -  -: $/data/cars- on-rw-r--r--3Root supergroup35588  -- .- -  -: $/data/cars- Geneva-rw-r--r--3Root supergroup35584  -- .- -  -: $/data/cars-Geneva-rw-r--r--3Root supergroup35584  -- .- -  -: $/data/cars-Geneva-rw-r--r--3Root supergroup35596  -- .- -  -: $/data/cars- to-rw-r--r--3Root supergroup35588  -- .- -  -: $/data/cars- .-rw-r--r--3Root supergroup35586  -- .- -  -: $/data/cars- --rw-r--r--3Root supergroup35584  -- .- -  -: $/data/cars- ,-rw-r--r--3Root supergroup35574  -- .- -  -: $/data/cars- the

For any one file, if you can do this locally:

cat cars- |./mapper.py |./reduce.py

Hadoop stream streaming Run python program

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.