当前位置: 代码迷 >> Linux/Unix >> LINUX上单机安装HADOOP+HIVE手册
  详细解决方案

LINUX上单机安装HADOOP+HIVE手册

热度:10618   发布时间:2013-02-26 00:00:00.0
LINUX下单机安装HADOOP+HIVE手册
HADOOP篇
HADOOP安装
1.tar -zvxf hadoop-0.19.2.tar.gz
2.HADOOP的安装路径添加到环境文件/etc/profile中:
export HADOOP_HOME=/home/hadoop/setup/hadoop-0.19.2
export PATH=$HADOOP_HOME/bin:$PATH
HADOOP配置
1.在$HADOOP/conf/hadoop-env.sh中配置JAVA环境
export JAVA_HOME=/home/hadoop/setup/jdk1.7.0_04
2.在$HADOOP/conf/hadoop-site.xml中增加如下配置
Xml代码??收藏代码
  1. <span?style="font-size:?small;"><property>?????
  2. ??<name>fs.default.name</name>?????
  3. ??<value>hdfs://localhost:9000</value>?????
  4. </property>?????
  5. <property>?????
  6. ??<name>mapred.job.tracker</name>?????
  7. ??<value>localhost:9001</value>?????
  8. </property>?????
  9. <property>?????
  10. ???<name>dfs.replication</name>?????
  11. ???<value>1</value>?????
  12. ?</property></span>??
?HADOOP运行
1.格式化namenode
$HADOOP_HOME/bin/hadoop namenode -format
2.启动hadoop
$HADOOP_HOME/bin/start-all.sh
?

HIVE篇
HIVE安装
1.tar -zvxf hive-0.6.0.tar.gz
2.HIVE的安装路径配置到环境文件/etc/profile中:
export HIVE_HOME=/home/hadoop/setup/hive-0.6.0
export PATH=$HIVE_HOME/bin:$PATH
HIVE配置
1.在$HIVE_HOME/conf下创建文件hive-site.xml
Xml代码??收藏代码
  1. <span?style="font-size:?small;"><?xml?version="1.0"?>????
  2. <?xml-stylesheet?type="text/xsl"?href="configuration.xsl"?>????
  3. ????
  4. <configuration>????
  5. ?<property>????
  6. ?<name>hive.metastore.local</name>????
  7. ???<value>true</value>????
  8. ?</property>????
  9. ????
  10. ?<property>????
  11. ?<name>javax.jdo.option.ConnectionURL</name>????
  12. ???<value>jdbc:mysql://192.168.0.237:3306/metastore_db?createDatabaseIfNotExist=true</value>????
  13. ?</property>????
  14. ?????
  15. ?<property>????
  16. ?<name>javax.jdo.option.ConnectionDriverName</name>????
  17. ???<value>com.mysql.jdbc.Driver</value>????
  18. ?</property>????
  19. ?????
  20. ?<property>?????
  21. ???<name>javax.jdo.option.ConnectionUserName</name>?????
  22. ???<value>t237</value>?????
  23. ?</property>?????
  24. ???????
  25. ?<property>?????
  26. ???<name>javax.jdo.option.ConnectionPassword</name>?????
  27. ???<value>123456</value>?????
  28. ?</property>?????
  29. ?<property>?????
  30. ???<name>datanucleus.fixedDatastore</name>?????
  31. ???<value>false</value>?????
  32. ?</property>?????
  33. </configuration>??</span>??
2.HIVE运行
hadoop@ubuntu:~$ hive?