我试图在我的Fedora 20系统中安装PIG v0.13.0。在提取tar.gz
内容后,我对PATH
和JAVA_HOME
进行了PIG/bin
设置。然后我在控制台中输入命令pig
,这就是我得到的:无法理解出了什么问题:
[root@localhost /]# pig
14/12/21 00:05:15 INFO pig.ExecTypeProvider: Trying ExecType : LOCAL
14/12/21 00:05:15 INFO pig.ExecTypeProvider: Trying ExecType : MAPREDUCE
14/12/21 00:05:15 INFO pig.ExecTypeProvider: Picked MAPREDUCE as the ExecType
2014-12-21 00:05:16,082 [main] INFO org.apache.pig.Main - Apache Pig version 0.13.0 (r1606446) compiled Jun 29 2014, 02:27:58
2014-12-21 00:05:16,083 [main] INFO org.apache.pig.Main - Logging error messages to: //pig_1419100516081.log
2014-12-21 00:05:16,130 [main] INFO org.apache.pig.impl.util.Utils - Default bootup file /root/.pigbootup not found
2014-12-21 00:05:16,765 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
2014-12-21 00:05:16,771 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS
2014-12-21 00:05:16,771 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://localhost:8020
2014-12-21 00:05:16,780 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - mapred.used.genericoptionsparser is deprecated. Instead, use mapreduce.client.genericoptionsparser.used
2014-12-21 00:05:19,130 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
2014-12-21 00:05:19,130 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: localhost:8021
2014-12-21 00:05:19,136 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS
grunt> ls
2014-12-21 00:05:33,697 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Encountered IOException. Call From localhost.localdomain/127.0.0.1 to localhost:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
Details at logfile: //pig_1419100516081.log
请告诉我为什么ls
中的grunt shell
命令会抛出错误?
请指导。
答案 0 :(得分:1)
在控制台中输入pig
时,默认情况下会转到MAPREDUCE
模式,因为您需要访问Hadoop cluster and HDFS installation
。 Mapreduce模式是猪的默认模式
看起来您的hadoop集群配置不正确,这是您获得连接退款错误的原因。请关注此链接以解决此连接拒绝问题。http://wiki.apache.org/hadoop/ConnectionRefused。
作为解决方法使用LOCAL
模式,这不需要安装hadoop
在控制台类型pig -x local
中,这将带来grunt shell并键入ls
命令。
本地模式
$ pig -x local
Mapreduce模式
$ pig
(or) //try to connect HDFS
$ pig -x mapreduce
答案 1 :(得分:0)
好的,我有一个工作。如果我连接到pig mapreduce mode
,则ls
命令将更改为ls hdfs:/
。因此,将上述命令从ls
更改为ls hdfs:/
可以解决我的问题。但同样,如果我连接到local
模式,则ls
命令正常工作。