简体   繁体   English

在本地或mapreduce模式下都无法运行猪

[英]Trouble running pig in both local or mapreduce mode

I already have Hadoop 1.2 running on my Ubuntu VM which is running on Windows 7 machine. 我已经在Windows 7计算机上运行的Ubuntu VM上运行了Hadoop 1.2。 I recently installed Pig 0.12.0 on my same Ubuntu VM. 我最近在同一Ubuntu VM上安装了Pig 0.12.0。 I have downloaded the pig-0.12.0.tar.gz from the apache website. 我已经从apache网站下载了pig-0.12.0.tar.gz。 I have all the variables such as JAVA_HOME, HADOOP_HOME, PIG_HOME variables set correctly. 我已经正确设置了所有变量,例如JAVA_HOME,HADOOP_HOME,PIG_HOME变量。 When I try to start pig in local mode this is what I see: 当我尝试以本地模式启动Pig时,这是我看到的:

chandeln@ubuntu:~$ pig -x local
pig: invalid option -- 'x'
usage: pig

chandeln@ubuntu:~$ echo $JAVA_HOME
/usr/lib/jvm/java7  
chandeln@ubuntu:~$ echo $HADOOP_HOME
/usr/local/hadoop
chandeln@ubuntu:~$ echo $PIG_HOME
/usr/local/pig
chandeln@ubuntu:~$ which pig
/usr/games/pig

chandeln@ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java7/bin:/usr/local/hadoop/bin:/usr/local/pig/bin

Since I am not a Unix expert I am not sure if this is the problem but the command which pig actually returns /usr/games/pig instead of /usr/local/pig . 因为我不是Unix专家,所以我不确定这是否是问题,但是which pig的命令实际上返回/usr/games/pig而不是/usr/local/pig Is this the root cause of the problem? 这是问题的根本原因吗?

Please guide. 请指导。

I was able to fix the problem by changing the following lines in my .bashrc. 我可以通过更改.bashrc中的以下行来解决此问题。 This gave precedence to the /usr/local/pig directory instead of /usr/games/pig 这优先于/usr/local/pig目录,而不是/usr/games/pig

BEFORE: export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$PIG_HOME/bin
AFTER: export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$PIG_HOME/bin:$PATH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM