我试图在我的Fedora 20系统中安装PIG v0.13.0。提取tar.gz
内容后,我为JAVA_HOME
和PIG/bin
进行了PATH
设置。然后我在控制台中键入命令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
请让我知道为什么grunt shell
中的ls
命令抛出错误?
请指导。
当您在控制台中键入pig
时,默认情况下它将进入MAPREDUCE
模式,为此您需要访问 Hadoop cluster and HDFS installation
.Mapreduce模式是猪的默认模式。
看起来您的Hadoop集群未正确配置,这就是您收到连接退款错误的原因。请点击此链接来解决此连接拒绝问题.http://wiki.apache.org/hadoop/ConnectionRefused。
作为解决方法,请使用LOCAL
模式,这不需要安装Hadoop。
在控制台中键入pig -x local
这将带来咕噜咕噜的外壳并键入ls
命令。
本地模式
$ pig -x local
地图缩减模式
$ pig
(or) //try to connect HDFS
$ pig -x mapreduce
我让这个工作了。 如果我连接到pig mapreduce mode
,ls
命令将更改为 ls hdfs:/
.因此,将上述命令从 ls
更改为 ls hdfs:/
解决了我的问题。但同样,如果我连接到local
模式,那么ls
命令工作正常。