Cov txheej txheem:

Kuv tuaj yeem khiav Python ntawm Hadoop?
Kuv tuaj yeem khiav Python ntawm Hadoop?

Video: Kuv tuaj yeem khiav Python ntawm Hadoop?

Video: Kuv tuaj yeem khiav Python ntawm Hadoop?
Video: Data Science with Python! Analyzing File Types from Avro to Stata 2024, Hlis ntuj nqeg
Anonim

Nrog kev xaiv ntawm cov lus programming xws li Java, Scala thiab Python rau Hadoop ecosystem, feem ntau developers siv Python vim nws txhawb cov tsev qiv ntawv rau cov ntaub ntawv txheeb xyuas cov haujlwm. Hadoop streaming tso cai rau cov neeg siv los tsim thiab ua Daim ntawv qhia / Txo cov hauj lwm nrog ib tsab ntawv los yog executable raws li tus mapper los yog / thiab tus reducer.

Ib yam li ntawd, nws tau nug, Python txuas mus rau Hadoop li cas?

Txuas Hadoop HDFS nrog Python

  1. Kauj ruam 1: Nco ntsoov tias Hadoop HDFS ua haujlwm raug. Qhib Terminal/Command Prompt, xyuas seb HDFS puas ua haujlwm los ntawm kev siv cov lus txib nram qab no: start-dfs.sh.
  2. Kauj ruam 2: Nruab libhdfs3 tsev qiv ntawv.
  3. Kauj ruam 3: Nruab lub tsev qiv ntawv hdfs3.
  4. Kauj ruam 4: Xyuas seb kev sib txuas nrog HDFS puas ua tiav.

Ib yam li ntawd, Hadoop hauv Python yog dab tsi? Python yog lub hom phiaj dav dav turing ua tiav cov lus programming uas tuaj yeem siv los ua txhua yam hauv ntiaj teb programming. Hadoop yog ib lub moj khaum loj cov ntaub ntawv sau hauv Java los cuam tshuam nrog cov ntaub ntawv loj loj. Muaj ntau lub koom haum online uas Hadoop nrog Python cov kev kawm xws li: Analytixlabs. Edureka.

Tom qab ntawd, lo lus nug yog, Kuv yuav ua li cas thiaj li khiav Python MapReduce program hauv Hadoop?

Sau Ib Hadoop MapReduce Program hauv Python

  1. Kev txhawb siab.
  2. Peb xav ua dab tsi.
  3. Yam yuavtsum tau kawm uantej.
  4. Python MapReduce Code. Daim ntawv qhia kauj ruam: mapper.py. Txo cov kauj ruam: reducer.py.
  5. Khiav Python Code ntawm Hadoop. Download piv txwv input data. Luam cov ntaub ntawv piv txwv hauv zos rau HDFS.
  6. Txhim kho Mapper thiab Reducer code: siv Python iterators thiab generators. mapper.py. txo.py.

Hadoop Streaming thawv yog dab tsi?

Hadoop kev faib khoom muab Java utility hu ua Hadoop Streaming . Nws yog ntim rau hauv a thawv ntaub ntawv. Nrog Hadoop Streaming , peb tuaj yeem tsim thiab khiav Daim Ntawv Qhia Txo cov haujlwm nrog cov ntawv ua tiav. Hadoop Streaming yog ib qho khoom siv uas tuaj nrog lub Hadoop kev faib tawm. Nws tuaj yeem siv los ua cov haujlwm rau kev txheeb xyuas cov ntaub ntawv loj.

Pom zoo: