首先JDK安装及相关环境变量配置

# Java environment setting
JAVA_HOME=/usr/java/default
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
PATH=$JAVA_HOME/bin:$PATH
JRE_HOME=$JAVA_HOME/jre
export JAVA_HOME CLASSPATH PATH JRE_HOME # Maven configuration
M2_HOME=/usr/local/apache-maven/default
PATH=$PATH:$M2_HOME/bin # hadoop setting
HADOOP_HOME=/home/asn/opt/hadoop-1.2.
PATH=$PATH:$HADOOP_HOME/bin

1. 修改主机名

[asn@vm-centos6-asn opt]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=vm-centos6-asn

在/etc/hosts文件中,添加主机名映射

[root@vm-centos6-asn ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 vm-centos6-asn
:: localhost localhost.localdomain localhost6 localhost6.localdomain6

2. hadoop配置

1)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://192.168.56.101:9000</value>
</property> <property>
<name>hadoop.tmp.dir</name>
<value>/home/asn/opt/hadoop-tmp</value>
</property>
</configuration>

2) hdfs-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>dfs.data.dir</name>
<value>/home/asn/opt/hadoop-data</value>
</property> <property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>

3) 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>192.168.56.101:9001</value>
</property>
</configuration>

4)  设置hadoop-env.sh文件中的JAVA_HOME环境变量

[asn@vm-centos6-asn conf]$ cat hadoop-env.sh
# Set Hadoop-specific environment variables here.

JAVA_HOME环境变量必须配置,其他环境变量可选。 当运行一个分布式配置时,最好配置该文件中的JAVA_HOME环境变量,以便于在远程节点上被正确定义。
# The only required environment variable is JAVA_HOME. All others are optional.
# When running a distributed configuration it is best to
# set JAVA_HOME in this file, so that it is correctly defined on remote nodes. # The java implementation to use. Required.
export JAVA_HOME=/usr/java/default # Extra Java CLASSPATH elements. Optional.
# export HADOOP_CLASSPATH= # The maximum amount of heap to use, in MB. Default is .
# export HADOOP_HEAPSIZE= # Extra Java runtime options. Empty by default.
# export HADOOP_OPTS=-server

3. 免密码登陆ssh配置

[asn@vm-centos6-asn ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/asn/.ssh/id_rsa): 私钥存放文件
Created directory '/home/asn/.ssh'.
Enter passphrase (empty for no passphrase): 直接回车
Enter same passphrase again: 直接回车
Your identification has been saved in /home/asn/.ssh/id_rsa.
Your public key has been saved in /home/asn/.ssh/id_rsa.pub. 公钥存放文件
The key fingerprint is:
6e::e0:::b5:6b:fb:::::1e:b2:8f: asn@vm-centos6-asn
The key's randomart image is:
+--[ RSA ]----+
| ... ..oo= |
| . . . = . |
| . . . . . E|
| . . . o . |
| = o S . o |
| . = = . |
| . + + |
| . + |
| . |
+-----------------+
[asn@vm-centos6-asn ~]$ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys 把公钥拷贝到认证文件中 [asn@vm-centos6-asn ~]$ ssh localhost
The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is bd:c8:f0:::be:ee:2f::6d::::d7:c0:.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts. 首次连接提示是否把localhost添加到已知的主机列表中
Last login: Tue Dec :: from localhost
[asn@vm-centos6-asn ~]$ exit
logout
Connection to localhost closed. [asn@vm-centos6-asn ~]$ ssh localhost 直接免密码登录成功
Last login: Tue Dec :: from localhost
[asn@vm-centos6-asn ~]$

4. hadoop  namenode -format  格式化名字节点

5. start-all.sh 启动

[asn@vm-centos6-asn ~]$ start-all.sh
starting namenode, logging to /home/asn/opt/hadoop-1.2./libexec/../logs/hadoop-asn-namenode-vm-centos6-asn.out
localhost: starting datanode, logging to /home/asn/opt/hadoop-1.2./libexec/../logs/hadoop-asn-datanode-vm-centos6-asn.out
localhost: starting secondarynamenode, logging to /home/asn/opt/hadoop-1.2./libexec/../logs/hadoop-asn-secondarynamenode-vm-centos6-asn.out
starting jobtracker, logging to /home/asn/opt/hadoop-1.2./libexec/../logs/hadoop-asn-jobtracker-vm-centos6-asn.out
localhost: starting tasktracker, logging to /home/asn/opt/hadoop-1.2./libexec/../logs/hadoop-asn-tasktracker-vm-centos6-asn.out

[asn@vm-centos6-asn ~]$ jps
Jps
NameNode
SecondaryNameNode
JobTracker
TaskTracker
DataNode

hadoop-1.2.1 伪分布配置的更多相关文章

  1. Hadoop伪分布配置与基于Eclipse开发环境搭建

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  2. hadoop2.6.0 + hbase-1.0.0 伪分布配置

    1 基本配置 主机名: 192.168.145.154 hadoop2 ======= 2 etc/hadoop下文件配置 1)core-site.xml <configuration> ...

  3. 启动原生Hadoop集群或伪分布环境

    一:启动Hadoop 集群或伪分布安装成功之后,通过执行./sbin/start-all.sh启动Hadoop环境 通过jps命令查看当前启动进程是否正确~ [root@neusoft-master ...

  4. Hadoop 安装(本地、伪分布、分布式模式)

    本地模式 环境介绍 一共三台测试机 master   192.168.4.91 slave1   192.168.4.45 slave2   192.168.4.96 操作系统配置 1.Centos7 ...

  5. hadoop 伪分布配置

    配置 Hadoop 伪分布式 任务配置说明: VMware 15 Centos 6.5 java -jdk 1.8 hadoop-2.6.0-cdh5.14.0.tar.gz 第一步 自行安装虚拟机 ...

  6. hadoop学习第一天-hadoop初步环境搭建&伪分布式计算配置(详细)

    一.虚拟机环境搭建 我们用的虚拟机为vmware,Linux镜像为centOS6.5. vmware安装 安装没什么多说的,一路下一步,但是在新建虚拟机的时候有两个地方需要注意: 1.分配处理器1个就 ...

  7. 伪分布配置完成启动jobtracker和tasktracker没有启动

    检查logs目录下的hadoop-root-jobtracker日志文件 2014-02-26 19:56:06,782 FATAL org.apache.hadoop.mapred.JobTrack ...

  8. hive1.2伪分布mysql数据库配置具体解释

    hadoop2.6伪分布配置:http://blog.csdn.net/gamer_gyt/article/details/46793731 hive1.2  derby元数据库配置:http://b ...

  9. 转载:Hadoop安装教程_单机/伪分布式配置_Hadoop2.6.0/Ubuntu14.04

    原文 http://www.powerxing.com/install-hadoop/ 当开始着手实践 Hadoop 时,安装 Hadoop 往往会成为新手的一道门槛.尽管安装其实很简单,书上有写到, ...

随机推荐

  1. homeworkvue

    两个半圆,点一下转90°,两个颜色 <!DOCTYPE html> <html lang="en"> <head> <meta chars ...

  2. PHP原生DOM对象操作XML的方法解答

    创建一个新的XML文件,并且写入一些数据到这个XML文件中. /** 创建xml文件*/ $info = array(array('obj' => 'power','info' => 'p ...

  3. TCP keepalive的机理及使用

    TCP 是面向连接的 , 在实际应用中通常都需要检测对端是否还处于连接中.如果已断开连接,主要分为以下几种情况: 1.连接的对端正常关闭,即使用 closesocket 关闭连接. 2.连接的对端非正 ...

  4. PHP开发api接口安全验证的实例,值得一看

    php的api接口 在实际工作中,使用PHP写api接口是经常做的,PHP写好接口后,前台就可以通过链接获取接口提供的数据,而返回的数据一般分为两种情况,xml和json,在这个过程中,服务器并不知道 ...

  5. R语言实现Xbar-R控制图

    R语言实现Xbar-R控制图 Xbar-R控制图在质量管理中主要用于对计量数据进行检测,以达到控制对象质量的目的. 虽然用Excel可以轻松实现控制图的操作,不过作为R软件初学者,我试着用仅有的一点R ...

  6. Inno setup 卸载时删除程序文件夹(文件)

    Inno setup 卸载时删除程序文件夹(文件) //删除所有配置文件以达到干净卸载的目的 procedure CurUninstallStepChanged(CurUninstallStep: T ...

  7. 为什么printf()用%f输出double型,而scanf却用%lf呢?

    之前没有注意过这个问题,  转自: http://book.51cto.com/art/200901/106880.htm 问:有人告诉我不能在printf中使用%lf.为什么printf()用%f输 ...

  8. this的作用

    1.在一般函数方法中使用 this 指代全局  function test(){ this.x = 1; alert(this.x);  }  test(); // 1 2.作为对象方法调用,this ...

  9. Libevent:2设置

    Libevent有一些整个进程共享的全局设置.这些设置会影响到整个的库.因此必须在调用Libevent其他函数之前进行设置,否则,LIbevent就会陷入不一致的状态. 一:Libevent中的日志信 ...

  10. ELK3之进阶学习

    1.昨日内容回顾 es的基本操作:增删改查 es的两种查询方式: (1)query string (2)query DSL match match match_all sort bool:must,s ...