hadoop-1.2.1 伪分布配置

首先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.1
PATH=$PATH:$HADOOP_HOME/bin

1. 修改主机名

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

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

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

2. hadoop配置

1)core-site.xml

 1 <?xml version="1.0"?>
 2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 3
 4 <!-- Put site-specific property overrides in this file. -->
 5
 6 <configuration>
 7     <property>
 8         <name>fs.default.name</name>
 9         <value>hdfs://192.168.56.101:9000</value>
10     </property>
11
12     <property>
13         <name>hadoop.tmp.dir</name>
14         <value>/home/asn/opt/hadoop-tmp</value>
15     </property>
16 </configuration>

2) hdfs-site.xml

 1 <?xml version="1.0"?>
 2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 3
 4 <!-- Put site-specific property overrides in this file. -->
 5
 6 <configuration>
 7     <property>
 8         <name>dfs.data.dir</name>
 9         <value>/home/asn/opt/hadoop-data</value>
10     </property>
11
12     <property>
13         <name>dfs.replication</name>
14         <value>1</value>
15     </property>
16 </configuration>

3) mapred-site.xml

 1 <?xml version="1.0"?>
 2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 3
 4 <!-- Put site-specific property overrides in this file. -->
 5
 6 <configuration>
 7
 8     <property>
 9         <name>mapred.job.tracker</name>
10         <value>192.168.56.101:9001</value>
11     </property>
12 </configuration>

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

[[email protected] 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 1000.
# export HADOOP_HEAPSIZE=2000

# Extra Java runtime options.  Empty by default.
# export HADOOP_OPTS=-server

3. 免密码登陆ssh配置

[[email protected] ~]$ 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:78:e0:30:10:b5:6b:fb:11:55:55:46:1e:b2:8f:57 [email protected]asn
The key‘s randomart image is:
+--[ RSA 2048]----+
|  ...     ..oo=  |
|   . .   .   = . |
|  . .   .   . . E|
|   . . .     o . |
|    = o S   . o  |
|   . = =     .   |
|    . + +        |
|     . +         |
|      .          |
+-----------------+
[[email protected]-centos6-asn ~]$ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys   把公钥拷贝到认证文件中

[[email protected]-centos6-asn ~]$ ssh localhost
The authenticity of host ‘localhost (::1)‘ can‘t be established.
RSA key fingerprint is bd:c8:f0:20:87:be:ee:2f:05:6d:01:14:94:d7:c0:11.
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 23 14:14:43 2014 from localhost
[[email protected]-centos6-asn ~]$ exit
logout
Connection to localhost closed.

[[email protected]-centos6-asn ~]$ ssh localhost      直接免密码登录成功
Last login: Tue Dec 23 14:16:14 2014 from localhost
[[email protected]-centos6-asn ~]$ 

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

5. start-all.sh 启动

[[email protected] ~]$ start-all.sh
starting namenode, logging to /home/asn/opt/hadoop-1.2.1/libexec/../logs/hadoop-asn-namenode-vm-centos6-asn.out
localhost: starting datanode, logging to /home/asn/opt/hadoop-1.2.1/libexec/../logs/hadoop-asn-datanode-vm-centos6-asn.out
localhost: starting secondarynamenode, logging to /home/asn/opt/hadoop-1.2.1/libexec/../logs/hadoop-asn-secondarynamenode-vm-centos6-asn.out
starting jobtracker, logging to /home/asn/opt/hadoop-1.2.1/libexec/../logs/hadoop-asn-jobtracker-vm-centos6-asn.out
localhost: starting tasktracker, logging to /home/asn/opt/hadoop-1.2.1/libexec/../logs/hadoop-asn-tasktracker-vm-centos6-asn.out
[[email protected]-centos6-asn ~]$ jps
14406 Jps
13823 NameNode
14101 SecondaryNameNode
14193 JobTracker
14319 TaskTracker
13942 DataNode
时间: 2024-10-15 04:19:06

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

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

原文地址: http://my.oschina.net/lanzp/blog/309078 目录[-] 1.开发配置环境: 2.Hadoop服务端配置(Master节点) 3.基于Eclipse的Hadoop2.x开发环境配置 4.运行Hadoop程序及查看运行日志 1.开发配置环境: 开发环境:Win7(64bit)+Eclipse(kepler service release 2) 配置环境:Ubuntu Server 14.04.1 LTS(64-bit only) 辅助工具:WinSCP

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

1 基本配置 主机名: 192.168.145.154 hadoop2 ======= 2 etc/hadoop下文件配置 1)core-site.xml <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://hadoop2:8020</value> </property> <property> <name>io.fil

hadoop的简介与伪分布的搭建

一:大数据hadoop简介 二:hadoop的伪分布安装 三:运行wordcount测试 四:hadoop 常用端口号 五:hadoop的四大模块包含 六:启动脚本: 一: 大数据hadoop简介 hadoop 简介: 开源软件,可靠的,可分布式,可伸缩的. 去IOE --------- IBM // ibm 小型机 Oracle // oracle 数据库服务器 EMC // 共享存储柜 cluster: ----------- 集群 1T = 1024G 1P = 1024T 1E = 10

ubuntu上hadoop 0.20.2 伪分布式配置

1.首先安装好jdk并且配置好java的环境变量(具体方法可以在google中搜到)解压hadoop-0.20.2.tar.gz到你的ubuntu账户的目录中(/home/xxxx/hadoop)(解压到任何目录都可以吧,看个人需要,不过配置下面文件的时候一定要改成自己的路径)修改hadoop下的conf文件夹下的core-site.xml,hadoop-env,sh,hdfs-site.xml,mapred-site.xml core-site.xml <configuration> <

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

hadoop2.6伪分布配置:http://blog.csdn.net/gamer_gyt/article/details/46793731 hive1.2  derby元数据库配置:http://blog.csdn.net/gamer_gyt/article/details/47150621 环境说明 hadoop2.6伪分布          Ubuntu14.04           hive 1.1              MySql 5.5                 MySql

hive1.2伪分布mysql数据库配置详解

hadoop2.6伪分布配置:http://blog.csdn.net/gamer_gyt/article/details/46793731 hive1.2  derby元数据库配置:http://blog.csdn.net/gamer_gyt/article/details/47150621 环境说明 hadoop2.6伪分布          Ubuntu14.04           hive 1.1              MySql 5.5                 MySql

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

原文 http://www.powerxing.com/install-hadoop/ 当开始着手实践 Hadoop 时,安装 Hadoop 往往会成为新手的一道门槛.尽管安装其实很简单,书上有写到,官方网站也有 Hadoop 安装配置教程,但由于对 Linux 环境不熟悉,书上跟官网上简略的安装步骤新手往往 Hold 不住.加上网上不少教程也甚是坑,导致新手折腾老几天愣是没装好,很是打击学习热情. 本教程适合于原生 Hadoop 2,包括 Hadoop 2.6.0, Hadoop 2.7.1

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

参见:http://www.powerxing.com/install-hadoop/ 完全拷贝至上面网址 环境 本教程使用 Ubuntu 14.04 64位 作为系统环境(Ubuntu 12.04 也行,32位.64位均可),请自行安装系统. 如果用的是 RedHat/CentOS 系统,请查看相应的CentOS安装Hadoop教程_单机伪分布式配置. 本教程基于原生 Hadoop 2,在 Hadoop 2.6.0 (stable) 版本下验证通过,可适合任何 Hadoop 2.x.y 版本,

Hadoop2.6.0伪分布环境搭建

用到的软件: 一.安装jdk: 1.要安装的jdk,我把它拷在了共享文件夹里面.   (用优盘拷也可以) 2.我把jdk拷在了用户文件夹下面. (其他地方也可以,不过路径要相应改变) 3.执行复制安装解压命令: 解压完毕: 查看解压的文件夹: 4.配置 环境变量: 写入如下5行代码: 使配置生效: 5.查看安装的jdk: java -version java javac 二.SSH免密码登陆: 1.安装SSH: 2.是否生成 .ssh 目录: 3.如果没有生成,自己手动创建一个 .ssh 目录: