簡體   English   中英

執行地圖減少通過php使用hadoop流

[英]Executing map reduce using hadoop streaming through php

我有以下腳本:

<?php
$a =isset($_POST['text'])?$_POST['text']:'not yet';
$comm='/usr/local/hadoop/bin/hadoop jar /usr/local/hadoop/contrib/streaming/hadoop-*streaming*.jar -mapper "/usr/bin/python /var/www/DataMining/AnalysisByYear/AnalysisByYear_mapper.py '.$a.'" -reducer "/usr/bin/python /var/www/DataMining/AnalysisByYear/AnalysisByYear_reducer.py" -input /user/hduser/dataset/final_eval.txt -output /user/hduser/dataset-outputyear';
$mys=exec($comm);
$comm1='/usr/local/hadoop/bin/hadoop dfs -copyToLocal /user/hduser/dataset-outputyear/part-00000 /var/www/year.txt';
$mys1=exec($comm1);
$file = '/var/www/year.txt';
$contents = file($file); 
$string = implode($contents);
echo $string;
?>

我正在嘗試通過php通過shell執行$ comm和$ comm1命令。 但是我沒有任何結果。請幫助

首先檢查您的apache日志中是否有錯誤,然后使用hadoop用戶運行腳本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM