hadoop,hive环境变量配置

我的系统是ubuntu的

1.sudo vi /etc/profile

2.配置变量

export HADOOP_HOME=/home/hadoop
export HIVE_HOME=/home/hadoop/contrib/hive-0.8.1

export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH:$HADOOP_HOME/bin:$HIVE_HOME/bin

3.生效环境变量.source /etc/profile

4.测试

ganliang@ganliang-laptop:~/Downloads$ pwd
/home/ganliang/Downloads
ganliang@ganliang-laptop:~/Downloads$ hadoop fs -ls
Warning: $HADOOP_HOME is deprecated.

Found 5 items
drwxr-xr-x   - ganliang supergroup          0 2012-08-26 17:37 /user/ganliang/hadoop_in
drwxr-xr-x   - ganliang supergroup          0 2012-08-26 13:33 /user/ganliang/hadoop_out
drwxr-xr-x   - ganliang supergroup          0 2012-08-26 17:49 /user/ganliang/hadoop_out2
drwxr-xr-x   - ganliang supergroup          0 2012-11-25 17:32 /user/ganliang/hadoop_out3
drwxr-xr-x   - ganliang supergroup          0 2012-11-27 22:07 /user/ganliang/hive_data
ganliang@ganliang-laptop:~/Downloads$ hive
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/hadoop/contrib/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties
Hive history file=/tmp/ganliang/hive_job_log_ganliang_201212011652_1252101503.txt
hive>

猜你喜欢

转载自ganliang13.iteye.com/blog/1739469