安装Pig
我的Hadoop集群为node50064、node50069和node51054。本文的Pig软件仅在node50064上安装。
下载并解压缩Pig
wget http://apache.cs.utah.edu/pig/pig-0.15.0/pig-0.15.0.tar.gz
tar -xzf pig-0.15.0.tar.gz
sudo mv pig-0.15.0 /usr/local/pig
sudo chown -R "hadoop:hadoop" /usr/local/pig
环境变量设置
export HADOOP_HOME=/usr/local/hadoop
export HADOOP_PREFIX=$HADOOP_HOME
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_PREFIX/lib/native
export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_PREFIX/lib/native"
export PIG_HOME=/usr/local/pig
export PIG_CLASSPATH=$HADOOP_HOME/conf
export PATH=$PATH:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin:$PIG_HOME/bin
最后通过source~/.bashrc刷新配置文件。
conf/pig.properties
pig.properties用于配置Pig各种参数。参数说明如下: