hadoop2.4.1 伪分布
最终的 /etc/profile :#在文件最后添加
# /etc/profile # System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc # It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates. pathmunge () {
case ":${PATH}:" in
*:"$1":*)
;;
*)
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
} if [ -x /usr/bin/id ]; then
if [ -z "$EUID" ]; then
# ksh workaround
EUID=`id -u`
UID=`id -ru`
fi
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
fi # Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
else
pathmunge /usr/local/sbin after
pathmunge /usr/sbin after
pathmunge /sbin after
fi HOSTNAME=`/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
export HISTCONTROL=ignoreboth
else
export HISTCONTROL=ignoredups
fi export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL # By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
if [ "${-#*i}" != "$-" ]; then
. "$i"
else
. "$i" >/dev/null 2>&1
fi
fi
done
#在文件最后添加
export JAVA_HOME=/usr/java/jdk1.7.0_79
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export HADOOP_HOME=/usr/local/hadoop-2.4.1
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native/"
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HADOOP_HOME/lib unset i
unset -f pathmunge ulimit -n 65535 1.准备Linux环境
1.0点击VMware快捷方式,右键打开文件所在位置 -> 双击vmnetcfg.exe -> VMnet1 host-only ->修改subnet ip 设置网段:192.168.8.0 子网掩码:255.255.255.0 -> apply -> ok
回到windows --> 打开网络和共享中心 -> 更改适配器设置 -> 右键VMnet1 -> 属性 -> 双击IPv4 -> 设 置windows的IP:192.168.8.100 子网掩码:255.255.255.0 -> 点击确定
在虚拟软件上 --My Computer -> 选中虚拟机 -> 右键 -> settings -> network adapter -> host only -> ok
1.1修改主机名
vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=itcast01 ###
1.2修改IP
两种方式:
第一种:通过Linux图形界面进行修改(强烈推荐)
进入Linux图形界面 -> 右键点击右上方的两个小电脑 -> 点击Edit connections -> 选中当前 网络System eth0 -> 点击edit按钮 -> 选择IPv4 -> method选择为manual -> 点击add按钮 -> 添加IP:192.168.8.118 子 网掩码:255.255.255.0 网关:192.168.1.1 -> apply
第二种:修改配置文件方式(屌丝程序猿专用)
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static" ###
HWADDR="00:0C:29:3C:BF:E7"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="ce22eeca-ecde-4536-8cc2-ef0dc36d4a8c"
IPADDR="192.168.8.118" ###
NETMASK="255.255.255.0" ###
GATEWAY="192.168.8.1" ###
1.3修改主机名和IP的映射关系
vim /etc/hosts
127.0.0.1 localhost
192.168.8.118 itcast01
1.4关闭防火墙
#查看防火墙状态
service iptables status
#关闭防火墙
service iptables stop
#查看防火墙开机启动状态
chkconfig iptables --list
#关闭防火墙开机启动
chkconfig iptables off
1.5重启Linux
reboot 2.安装JDK
2.1上传
2.2解压jdk
#创建文件夹
mkdir /usr/java
#解压
tar -zxvf jdk-7u55-linux-i586.tar.gz -C /usr/java/
2.3将java添加到环境变量中
vim /etc/profile
#在文件最后添加
export JAVA_HOME=/usr/java/jdk1.7.0_55
export PATH=$PATH:$JAVA_HOME/bin
#刷新配置
source /etc/profile
3.安装hadoop2.4.1
注意:hadoop2.x的配置文件$HADOOP_HOME/etc/hadoop
伪分布式需要修改5个配置文件
3.1配置hadoop
第一个:hadoop-env.sh
vim hadoop-env.sh
#第27行
export JAVA_HOME=/usr/java/jdk1.7.0_65
第二个:core-site.xml
<!-- 制定HDFS的老大(NameNode)的地址 -->
<property>
<name>fs.defaultFS</name>
<value>hdfs://itcast01:9000</value>
</property>
<!-- 指定hadoop运行时产生文件的存储目录 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/itcast/hadoop-2.4.1/tmp</value>
</property> ===============ok=================
<configuration>
<!-- 制定HDFS的老大(NameNode)的地址 -->
<property>
<name>fs.defaultFS</name>
<value>hdfs://itcast01:9000</value>
</property>
<!-- 指定hadoop运行时产生文件的存储目录 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/home/tempData</value>
</property>
</configuration>
===================================
第三个:hdfs-site.xml
<!-- 指定HDFS副本的数量 -->
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
第四个:mapred-site.xml (mv mapred-site.xml.template mapred-site.xml)
mv mapred-site.xml.template mapred-site.xml
vim mapred-site.xml
<!-- 指定mr运行在yarn上 -->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
第五个:yarn-site.xml
<!-- 指定YARN的老大(ResourceManager)的地址 -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>itcast01</value>
</property>
<!-- reducer获取数据的方式 -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
3.2将hadoop添加到环境变量
vim /etc/proflie
export JAVA_HOME=/usr/java/jdk1.7.0_65
export HADOOP_HOME=/itcast/hadoop-2.4.1
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin source /etc/profile
3.3格式化namenode(是对namenode进行初始化)
hdfs namenode -format (hadoop namenode -format) 17/05/16 17:13:12 INFO common.Storage: Storage directory
/usr/local/hadoop-2.4.1/tmp/dfs/name has been successfully formatted. [root@itcast01 dfs]# cd name
[root@itcast01 name]# ll
total 4
drwxr-xr-x. 2 root root 4096 May 16 17:13 current
[root@itcast01 name]# cd current/
[root@itcast01 current]# ll
total 16
-rw-r--r--. 1 root root 351 May 16 17:13 fsimage_0000000000000000000
-rw-r--r--. 1 root root 62 May 16 17:13 fsimage_0000000000000000000.md5
-rw-r--r--. 1 root root 2 May 16 17:13 seen_txid
-rw-r--r--. 1 root root 207 May 16 17:13 VERSION 3.4启动hadoop cd /usr/local/hadoop-2.4.1/sbin 先启动HDFS
sbin/start-dfs.sh
再启动YARN
sbin/start-yarn.sh
3.5验证是否启动成功
使用jps命令验证
27408 NameNode
28218 Jps
27643 SecondaryNameNode
28066 NodeManager
27803 ResourceManager
27512 DataNode
http://192.168.233.128:50070 (HDFS管理界面)
http://192.168.233.128:8088 (MR管理界面) http://192.168.30.128:50070 (HDFS管理界面)
http://192.168.30.128:8088 (MR管理界面)
***************************************************************************************************************************************************** 从日志中可以看出hadoop库不在java.library.path所配置的目录下,应该是java.library.path配置的路径有问题。在 hadoop-env.sh中重新配置: export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_HOME}/lib/native export HADOOP_OPTS="-Djava.library.path=${HADOOP_HOME}/lib/native/" 执行start-dfs.sh,告警信息不再显示。经测试,其实只需export HADOOP_OPTS即可解决问题。 验证本地库是否加载成功:hadoop checknative
4.配置ssh免登陆
#生成ssh免登陆密钥
#进入到我的home目录
cd ~/.ssh ssh-keygen -t rsa (四个回车)
执行完这个命令后,会生成两个文件id_rsa(私钥)、id_rsa.pub(公钥)
将公钥拷贝到要免登陆的机器上
ssh-copy-id localhost login as: root
root@192.168.233.128's password:
Access denied
root@192.168.233.128's password:
Last login: Tue May :: from 192.168.233.7
[root@itcast01 ~]# ll
total
-rw-------. root root Jul anaconda-ks.cfg
-rw-r--r--. root root Jul install.log
-rw-r--r--. root root Jul install.log.syslog
[root@itcast01 ~]# cd /home
[root@itcast01 home]# ll
total
drwx------. hadoop hadoop May : hadoop
drwxr-xr-x. root root May : tempData
[root@itcast01 home]# cd tempData/
[root@itcast01 tempData]# ll
total
drwxr-xr-x. root root May : dfs
drwxr-xr-x. root root May : nm-local-dir
[root@itcast01 tempData]# cd dfs
[root@itcast01 dfs]# l
-bash: l: command not found
[root@itcast01 dfs]# ll
total
drwx------. root root May : data
drwxr-xr-x. root root May : name
drwxr-xr-x. root root May : namesecondary
[root@itcast01 dfs]# cd name
[root@itcast01 name]# ll
total
drwxr-xr-x. root root May : current
[root@itcast01 name]# cd current/
-bash: cd: current/: No such file or directory
[root@itcast01 name]# cd current/
[root@itcast01 current]# ll
total
-rw-r--r--. root root May : edits_0000000000000000001-
-rw-r--r--. root root May : edits_0000000000000000003-
-rw-r--r--. root root May : edits_0000000000000000004-
-rw-r--r--. root root May : edits_inprogress_0000000000000000006
-rw-r--r--. root root May : fsimage_0000000000000000002
-rw-r--r--. root root May : fsimage_0000000000000000002.md5
-rw-r--r--. root root May : fsimage_0000000000000000005
-rw-r--r--. root root May : fsimage_0000000000000000005.md5
-rw-r--r--. root root May : seen_txid
-rw-r--r--. root root May : VERSION
[root@itcast01 current]# jps
Jps
[root@itcast01 current]# cd /usr
[root@itcast01 usr]# ll
total
dr-xr-xr-x. root root May : bin
drwxr-xr-x. root root Sep etc
drwxr-xr-x. root root Sep games
-rw-r--r--. root root Aug hadoop-2.4..tar.gz
-rw-r--r--. root root May : hadoop-native--2.4..tar
drwxr-xr-x. root root Jul include
drwxr-xr-x. root root May : java
-rw-r--r--. root root May : jdk-7u79-linux-x64.tar.gz
dr-xr-xr-x. root root Jul lib
dr-xr-xr-x. root root May : lib64
drwxr-xr-x. root root May : libexec
drwxr-xr-x. root root May : local
dr-xr-xr-x. root root May : sbin
drwxr-xr-x. root root May : share
drwxr-xr-x. root root Jul src
lrwxrwxrwx. root root Jul tmp -> ../var/tmp
[root@itcast01 usr]# cd local/
[root@itcast01 local]# ll
total
drwxr-xr-x. root root Sep bin
drwxr-xr-x. root root Sep etc
drwxr-xr-x. root root Sep games
drwxr-xr-x. users May : hadoop-2.4.
drwxr-xr-x. root root Sep include
drwxr-xr-x. root root Sep lib
drwxr-xr-x. root root Sep lib64
drwxr-xr-x. root root Sep libexec
drwxr-xr-x. root root Sep sbin
drwxr-xr-x. root root Jul share
drwxr-xr-x. root root Sep src
[root@itcast01 local]# cd hadoop-2.4./
[root@itcast01 hadoop-2.4.]# ll
total
drwxr-xr-x. users Jun bin
drwxr-xr-x. users Jun etc
drwxr-xr-x. users Jun include
drwxr-xr-x. games Jun lib
drwxr-xr-x. users Jun libexec
-rw-r--r--. users Jun LICENSE.txt
drwxr-xr-x. root root May : logs
-rw-r--r--. users Jun NOTICE.txt
-rw-r--r--. users Jun README.txt
drwxr-xr-x. users Jun sbin
drwxr-xr-x. users Jun share
drwxr-xr-x. root root May : tmp
[root@itcast01 hadoop-2.4.]# cd sbin/
[root@itcast01 sbin]# ll
total
-rwxr-xr-x. users Jun distribute-exclude.sh
-rwxr-xr-x. users Jun hadoop-daemon.sh
-rwxr-xr-x. users Jun hadoop-daemons.sh
-rwxr-xr-x. users Jun hdfs-config.cmd
-rwxr-xr-x. users Jun hdfs-config.sh
-rwxr-xr-x. users Jun httpfs.sh
-rwxr-xr-x. users Jun mr-jobhistory-daemon.sh
-rwxr-xr-x. users Jun refresh-namenodes.sh
-rwxr-xr-x. users Jun slaves.sh
-rwxr-xr-x. users Jun start-all.cmd
-rwxr-xr-x. users Jun start-all.sh
-rwxr-xr-x. users Jun start-balancer.sh
-rwxr-xr-x. users Jun start-dfs.cmd
-rwxr-xr-x. users Jun start-dfs.sh
-rwxr-xr-x. users Jun start-secure-dns.sh
-rwxr-xr-x. users Jun start-yarn.cmd
-rwxr-xr-x. users Jun start-yarn.sh
-rwxr-xr-x. users Jun stop-all.cmd
-rwxr-xr-x. users Jun stop-all.sh
-rwxr-xr-x. users Jun stop-balancer.sh
-rwxr-xr-x. users Jun stop-dfs.cmd
-rwxr-xr-x. users Jun stop-dfs.sh
-rwxr-xr-x. users Jun stop-secure-dns.sh
-rwxr-xr-x. users Jun stop-yarn.cmd
-rwxr-xr-x. users Jun stop-yarn.sh
-rwxr-xr-x. users Jun yarn-daemon.sh
-rwxr-xr-x. users Jun yarn-daemons.sh
[root@itcast01 sbin]# start-dfs.sh
Starting namenodes on [itcast01]
root@itcast01's password:
root@itcast01's password: itcast01: Permission denied, please try again. itcast01: starting namenode, logging to /usr/local/hadoop-2.4./logs/hadoop-root-namenode-itcast01.out
root@localhost's password:
root@localhost's password: localhost: Permission denied, please try again. localhost: starting datanode, logging to /usr/local/hadoop-2.4./logs/hadoop-root-datanode-itcast01.out
Starting secondary namenodes [0.0.0.0]
root@0.0.0.0's password:
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop-2.4./logs/hadoop-root-secondarynamenode-itcast01.out
[root@itcast01 sbin]# jps
DataNode
NameNode
SecondaryNameNode
Jps
[root@itcast01 sbin]# start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /usr/local/hadoop-2.4./logs/yarn-root-resourcemanager-itcast01.out
root@localhost's password:
localhost: starting nodemanager, logging to /usr/local/hadoop-2.4./logs/yarn-root-nodemanager-itcast01.out
[root@itcast01 sbin]# jps
NodeManager
Jps
DataNode
NameNode
ResourceManager
SecondaryNameNode
[root@itcast01 sbin]#
hadoop2.4.1 伪分布的更多相关文章
- Hadoop2.6.0伪分布环境搭建
用到的软件: 一.安装jdk: 1.要安装的jdk,我把它拷在了共享文件夹里面. (用优盘拷也可以) 2.我把jdk拷在了用户文件夹下面. (其他地方也可以,不过路径要相应改变) 3.执行复制安装 ...
- hadoop-2.7.1伪分布环境搭建
1.准备Linux环境 1.0 点击VMware快捷方式,右键打开文件所在位置 -> 双击vmnetcfg.exe -> VMnet1 host-only ->修改subnet i ...
- 【hadoop之翊】——基于CentOS的hadoop2.4.0伪分布安装配置
今天总算是把hadoop2.4的整个开发环境弄好了,包括 windows7上eclipse连接hadoop,eclipse的配置和測试弄得烦躁的一逗比了~ 先上一张成功的图片,hadoop的伪分布式安 ...
- Hadoop-2.7.1伪分布--安装配置hbase 1.1.2
hbase-1.1.2下载地址:http://www.eu.apache.org/dist/hbase/stable/hbase-1.1.2-bin.tar.gz 下载之后解压至\usr\local目 ...
- Hadoop2.6.0安装—单机/伪分布
目录 环境准备 创建hadoop用户 更新apt 配置SSH免密登陆 安装配置Java环境 安装Hadoop Hadoop单机/伪分布配置 单机Hadoop 伪分布Hadoop 启动Hadoop 停止 ...
- hadoop2.7【单节点】单机、伪分布、分布式安装指导
问题导读 1.从本文部署实际部署,总结本地模式.伪分布.分布式的区别是什么?2.单机是否是伪分布?3.本地模式是否可以运行mapreduce? 来源:about云 http://www.aboutyu ...
- hadoop2.6.0 + hbase-1.0.0 伪分布配置
1 基本配置 主机名: 192.168.145.154 hadoop2 ======= 2 etc/hadoop下文件配置 1)core-site.xml <configuration> ...
- Hadoop之伪分布环境搭建
搭建伪分布环境 上传hadoop2.7.0编译后的包并解压到/zzy目录下 mkdir /zzy 解压 tar -zxvf hadoop.2.7.0.tar.gz -C /zzy 配置hado ...
- Hadoop伪分布配置与基于Eclipse开发环境搭建
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
随机推荐
- Java代理和动态代理机制分析和应用
本博文中项目代码已开源下载地址:GitHub Java代理和动态代理机制分析和应用 概述 代理是一种常用的设计模式,其目的就是为其他对象提供一个代理以控制对某个对象的访问.代理类负责为委托类预处理消息 ...
- 20165317 Linux安装及学习
Linux安装及学习 一.Linux的安装 我通过virtualbox和ubuntu官网下载了virtualbox5.2.6和ubuntu17.04版本. 在操作过程中,我基本是按照老师的步骤进行的, ...
- 【PyQt5-Qt Designer】添加图片+鼠标点击
添加图片+鼠标点击 graphicsView中添加图片 效果图 添加之后左边1处 生成qrc文件 选择文件右键编译-生成图片的16进制文件 课后作业:
- FTP主动模式和被动模式的区别(转)
dd by zhj: 一般使用被动模式,在命令行下,被动模式的格式是:ftp -p (yinservice_env) ajian@ubuntu-desk:~$ ftp -pftp> 之前在用命令 ...
- sublime 指定打开某文件的类型(text/plain)
看下图,点击open all width ...选取你指定文件,以后打开都是你指定文件类型
- 如何调用finecms指定栏目的描述关键词
有时我们在用finecms建站时需要调用指定栏目的描述和关键词,实现个性化需求,比如id为23的栏目很重要,要让它在首页展示出来,这时我们要如何调用呢?{dr_cat_value(23, 'name' ...
- GOROOT、GOPATH、GOBIN
GOROOT golang安装路径. GOPATH GOPATH可以设置多个工程目录,linux下用冒号分隔(必须用冒号,fish shell的空格分割会出错),windows下用分号分隔,但是go ...
- DataFrame WordCount
测试数据: ** * 使用DataFrame实现WordCount */ object DataFrameWordCount { def main(args: Array[String]): Unit ...
- 浅谈Python web框架
一.Python web框架 Web Framework,Ruby的世界Rails一统江湖,而Python则是一个百花齐放的世界,各种micro-framework.framework不可胜数,不完全 ...
- jenkins 的一个BUG
最近更新了一批jenkin插件,更新完问题来了全局设置无法保存了... 报错如下 Stack trace net.sf.json.JSONException: null object at net.s ...