安装hadoop

http://mirror.bit.edu.cn/apache/


1.wget 'http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-1.0.3/hadoop-1.0.3.tar.gz'

2.创建一个group为hadoopuser为hadoop的用户以及组

useradd -U hadoop 

添加sudo权限 http://blog.csdn.net/lkernel/article/details/8116146

3. 添加无密码登陆

ssh-keygen 

cp  ~/.ssh/id_rsa.pub  ~/.ssh/authorized_keys

4. sudo mkdir /usr/local/hadoop/

cd  /usr/local/hadoop/

sudo tar  zxvf  hadoop-1.0.3.tar.gz 

5.加入环境变量vim /etc/profile

export HADOOP_HOME=/usr/local/hadoop/hadoop-1.0.3
export PATH=$HADOOP_HOME/bin:$PATH

export HADOOP_HOME_WARN_SUPPRESS=1

6.修改配置文件 core-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>


<!-- Put site-specific property overrides in this file. -->


<configuration>
  <property>


    <name>fs.default.name</name>


    <value>hdfs://localhost:9000</value>


  </property>


  <property>


    <name>dfs.replication</name>


    <value>1</value>


  </property>


  <property>


    <name>hadoop.tmp.dir</name>


    <value>/home/hadoop/hadoop-datastore/</value>


  </property>


</configuration>


7.修改配置文件mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>


<!-- Put site-specific property overrides in this file. -->


<configuration>
  <property>


    <name>mapred.job.tracker</name>


    <value>localhost:9001</value>


  </property>


</configuration>


8. 修改配置文件 hadoop-env.sh,添加

export JAVA_HOME=/usr/local/jvm/jdk1.6.0_35/


9. sudo chown -R hadoop:hadoop /usr/local/hadoop/ 

10.hadoop namenode -format

11. start-all.sh 


你可能感兴趣的:(安装hadoop)