码迷,mamicode.com
首页 > 其他好文 > 详细

hadoop安装

时间:2018-06-30 18:51:10      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:class   jps   gen   file   for   cat   def   ase   etc   

下载https://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.9.3.tar.gz

1、配置环境变量 vim /etc/proflie

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH
export HADOOP_HOME=/home/simon/software/hadoop
export PATH=${HADOOP_HOME}/bin:$PATH

2、simon@simon-Lenovo-G400:  source /etc/profile

3、hadoop-env.sh

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

4、core-site.xml

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
    </property>
    <property>
        <name>hadoop.tmp.dir</name>
        <value>file:/home/simon/hadWorkspace/tmp</value>
        <description>Abase for other temporary directories.</description>
    </property>
</configuration>

5、hdfs-site.xml

<configuration>
    <property>
        <name>dfs.namenode.secondary.http-address</name>
        <value>localhost:50090</value>
    </property>
    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
    <property>
        <name>dfs.namenode.name.dir</name>
        <value>file:/home/simon/hadWorkspace/namenode</value>
    </property>
    <property>
        <name>dfs.datanode.data.dir</name>
        <value>file:/home/simon/hadWorkspace/datanode</value>
    </property>
</configuration>

6、mapred-site.xml

<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
    <property>
        <name>mapreduce.jobhistory.address</name>
        <value>localhost:10020</value>
    </property>
    <property>
        <name>mapreduce.jobhistory.webapp.address</name>
        <value>localhost:19888</value>
    </property>
</configuration>

7、yarn-site.xml

<configuration>
     <property>
        <name>yarn.resourcemanager.hostname</name>
        <value>localhost</value>
    </property>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
</configuration>

 

8、配置ssh

sudo apt-get install ssh
sudo apt-get install rsync
ssh-keygen -t rsa -P ‘‘ -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
ssh localhost

9、运行

simon@simon-Lenovo-G400:~$ cd /home/simon/software/hadoop/bin
simon@simon-Lenovo-G400:~/software/hadoop/bin$ hadoop namenode -format
simon@simon-Lenovo-G400:~$ cd /home/simon/software/hadoop/sbin
simon@simon-Lenovo-G400:~/software/hadoop/sbin$ ./start-all.sh
simon@simon-Lenovo-G400:~/software/hadoop/sbin$ jps
10564 NodeManager
10692 Jps
10329 SecondaryNameNode
10140 DataNode
9996 NameNode
9534 ResourceManager

hadoop安装

标签:class   jps   gen   file   for   cat   def   ase   etc   

原文地址:https://www.cnblogs.com/ggzhangxiaochao/p/9248165.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!