141.3. 单机安装 CentOS 5 + hadoop-0.20.0

简介:

这种安装方式仅仅适用于做实验,快速搭建Hadoop环境,不适合生产环境。

Ubuntu 环境

$ sudo apt-get install openjdk-7-jre
		

过程 141.1. Master configure

  1. Download and Installing Software

    				
    $ cd /usr/local/src/
    $ wget http://apache.etoak.com/hadoop/core/hadoop-0.20.0/hadoop-0.20.0.tar.gz
    $ tar zxvf hadoop-0.20.0.tar.gz
    $ sudo cp -r hadoop-0.20.0 ..
    $ sudo ln -s hadoop-0.20.0 hadoop
    $ cd hadoop
    				
    				
  2. Configuration

    hadoop-env.sh

    				
    $ vim conf/hadoop-env.sh
    export JAVA_HOME=/usr
    				
    				

    conf/core-site.xml

    				
    $ vim conf/core-site.xml
    
    <configuration>
      <property>
        <name>fs.default.name</name>
        <value>hdfs://localhost:9000</value>
      </property>
    </configuration>
    				
    				

    conf/hdfs-site.xml

    				
    $ vim conf/hdfs-site.xml
    
    <configuration>
      <property>
        <name>dfs.replication</name>
        <value>1</value>
      </property>
    </configuration>
    				
    				

    conf/mapred-site.xml

    				
    $ vim conf/mapred-site.xml
    
    <configuration>
      <property>
        <name>mapred.job.tracker</name>
        <value>localhost:9001</value>
      </property>
    </configuration>
    				
    				
  3. Setup passphraseless ssh

    				
    Now check that you can ssh to the localhost without a passphrase:
    $ ssh localhost
    
    If you cannot ssh to localhost without a passphrase, execute the following commands:
    $ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
    $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
    				
    				
  4. Execution

     Format a new distributed-filesystem:
    $ bin/hadoop namenode -format
    
    Start the hadoop daemons:
    $ bin/start-all.sh
    
    When you're done, stop the daemons with:
    $ bin/stop-all.sh
    				
  5. Monitor

    Browse the web interface for the NameNode and the JobTracker; by default they are available at:

    • NameNode - http://localhost:50070/

    • JobTracker - http://localhost:50030/

  6. Test

    				
    $ bin/hadoop dfs -mkdir test
    $ echo helloworld > testfile
    $ bin/hadoop dfs -copyFromLocal testfile test/
    $ bin/hadoop dfs -ls
    Found 1 items
    drwxr-xr-x   - neo supergroup          0 2009-07-10 14:18 /user/neo/test
    
    $ bin/hadoop dfs -ls test
    
    $ bin/hadoop dfs –cat test/file
    				
    				

过程 141.2. slave config

  1. SSH

    				
    $ scp neo@master:~/.ssh/id_dsa.pub .ssh/master.pub
    $ cat .ssh/master.pub >> .ssh/authorized_keys
    				
    				
  2. Hadoop

    				
    $ scp neo@master:/usr/local/hadoop /usr/local/hadoop
    				
    				




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
5天前
|
前端开发 jenkins 持续交付
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
21 1
|
5天前
|
jenkins 网络安全 持续交付
新的centos7.9安装docker版本的jenkins2.436.1最新版本-后端项目发布(四)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-后端项目发布(四)
22 3
|
2天前
|
安全 关系型数据库 MySQL
解决centos7.0安装mysql后出现access defind for user@'localhost'的错误
在使用yum 安装完mariadb, mariadb-server, mariadb-devel后
7 0
|
3天前
|
Linux 网络安全 数据安全/隐私保护
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
|
4天前
|
弹性计算 分布式计算 Hadoop
Linux(阿里云)安装Hadoop(详细教程+避坑)
Linux(阿里云)安装Hadoop(详细教程+避坑)
25 3
|
5天前
|
NoSQL Linux Redis
在CentOS上安装和配置Redis
在CentOS上安装和配置Redis
51 0
|
5天前
|
安全 Linux 测试技术
在CentOS上安装Elasticsearch和Kibana
在CentOS上安装Elasticsearch和Kibana
11 0
|
5天前
|
存储 分布式计算 Hadoop
【分布式计算框架】Hadoop伪分布式安装
【分布式计算框架】Hadoop伪分布式安装
8 2
|
5天前
|
运维 Kubernetes 监控
本地CentOS安装轻量级容器PaaS平台KubeSphere并实现无公网IP远程访问
本地CentOS安装轻量级容器PaaS平台KubeSphere并实现无公网IP远程访问
7 0
|
5天前
|
Kubernetes Docker 容器
Docker 安装 Portainer
Portainer Community Edition是一个针对容器化应用程序的轻量级服务交付平台,可用于管理 Docker、Swarm、Kubernetes 和 ACI 环境。它的设计理念是部署和使用都简单,该应用程序允许您通过“智能”GUI 和/或广泛的 API 管理所有编排器资源。
42 3