A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

首先将下载包拷贝到相关路径下解压:下载地址:https://mirrors.cnnic.cn/apache/

进入到conf配置:

vim log4j.properties

内容如下:

# ***** Set root logger level to DEBUG and its only appender to A.
log4j.logger.org.apache.pig=info, A

# ***** A is set to be a ConsoleAppender.
log4j.appender.A=org.apache.log4j.ConsoleAppender
# ***** A uses PatternLayout.
log4j.appender.A.layout=org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
pig.logfile=/root/pig-0.16.0/logs
log4jconf=/root/pig-0.16.0/conf/log4j.properties
exectype=mapreduce

vim /etc/profile

export JAVA_HOME=/usr/local/jdk1.8.0_172   #这里路径为自己解压的JDK的路径  
export CLASSPATH=${JAVA_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
# Hadoop Environment Variables
export HADOOP_HOME=/root/hadoop-2.8.4
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin
#zookper
export ZOOKEEPER_HOME=/root/zookeeper-3.4.12
export PATH=$PATH:$ZOOKEEPER_HOME/bin
#hbase  
export HBASE_HOME=/root/hbase-2.0.0
export PATH=$PATH:$HBASE_HOME/bin
#scala
export SCALA_HOME=/root/scala
export PATH=$PATH:$SCALA_HOME/bin
#spark
export SPARK_HOME=/root/spark
export PATH=$PATH:$SPARK_HOME/bin
#HIVE
export HIVE_HOME=/root/hive2
export PATH=$PATH:$HIVE_HOME/bin
#PIG
export PIG_HOME=/root/pig-0.16.0
export PIG_CLASSPATH=$HADOOP_HOME/etc/hadoop
export PATH=$PATH:$PIG_HOME/bin

然后启动hadoop,既可以了输入pig,成功!!!


3 个回复

倒序浏览
奈斯,优秀
回复 使用道具 举报
回复 使用道具 举报
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马