单节点hadoop安装

版本:hadoop-2.6.0-cdh5.7.0.tar.gz

hadoop下载安装

下载 : cdh5

解压

配置环境变量:vi ~/.bash_profile

生效环境变量文件:source ~/.bash_profile

检测 : $HADOOP_HOME

配置文件:

配置文件目录:cd etc/hadoop

1.hadoop-env.sh

export JAVA_HOME=/root/soft_install/jdk1.8.0

2.core-site.xml

<configuration>
    
    <property>
        <name>fs.defaultFSname>
        <value>hdfs://192.168.145.128:8020value>
    property>

    
    <property>
        <name>hadoop.tmp.dirname>
        <value>/root/soft_workspace/hadoop/tmpvalue>
    property>
configuration>

3.hdfs-site.xml

<configuration>
   
  <property>
     <name>dfs.replicationname>
     <value>1value>
  property>
configuration>

4.slave

192.168.145.128

对nameNode进行格式化

cd bin/

./hdfs namenode -format

检测:是否指定目录有目录生成

启动hdfs服务

cd sbin/

./start-dfs.sh

检测:jps–> DataNode、NameNode 、SecondaryNameNode | 192.168.145.128:50070

测试hdfs

hadoop fs -mkdir /data

hadoop fs -put a.txt /data/

hadoop fs -ls /data/

搭建YARN

cd etc/hadoop

mapred-site.xml

cp mapred-site.xml.template mapred-site.xml

<configuration>
    <property>
        <name>mapreduce.framework.namename>
        <value>yarnvalue>
    property>
configuration>

yarn-site.xml

<configuration>
    
    <property>
        <name>yarn.nodemanager.aux-servicesname>
        <value>mapreduce_shufflevalue>
    property>
configuration>

启动yarn

./start-yarn.sh

检测:jps >> NodeManager、 ResourceManager || 192.168.145.128:8088

测试yarn

cd share/hadoop/mapreduce

hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.7.0.jar pi 2 3



配置文件下载:https://pan.baidu.com/s/1mij8jqw

你可能感兴趣的:(hadoop,大数据,大数据,hadoop)