Hadoop配置环境-伪分布式
Posted chromer
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hadoop配置环境-伪分布式相关的知识,希望对你有一定的参考价值。
目录
1.Linux设置静态IP地址
# cd /etc/sysconfig/network-scripts/
# vi ifcfg-auto_eth0
BOOTPRPTO=none
IPADDR=192.168.0.202
NETMASK=255.255.255.0
GATE=192.168.0.1
wq
2.修改主机名和映射文件
# cd /etc/sysconfig/
# vi network
HOSTNAME=simple02
wq
# cat network
# vi /etc/hosts
192.168.0.202 simple02
wq
# reboot
3.SSH免密码配置
# cd ~/.ssh
# ssh-keygen -t rsa
# ssh-copy-id simple02
# ssh simple02
4.Linux系统JDK的安装和配置
# rpm -qa | grep jdk
# rpm -e –nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
# cd /
# mkdir simple
# cd simple
# mkdir soft
# cd ../
# tar -zvxf /simple/soft/jdk-7u79-linux-i586.tar.gz
# vi /etc/profile
JAVA_HOME=/simple/jdk1.7.0_79
export PATH=$JAVA_HOME/bin:$PATH
wq
# source /etc/profile
# java -version
5.Hadoop伪分布式配置和测试
# cd /simple
# tar -zvxf /simple/soft/hadoop-2.4.1.tar.gz
# cd /simple/hadoop-2.4.1/etc/hadoop/
# vi hadoop-env.sh
export JAVA_HOME=/simple/jdk1.7.0_79
wq
# vi core-site.xml
<property>
<name>fs.default.name</name>
<value>hdfs://169.254.25.128:9000</value>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://169.254.25.128:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/simple/hadoop-2.4.1/tmp</value>
</property>
wq
# vi hdfs-site.xml
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>/simple/hadoop-2.4.1/hdfs/name</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>/simple/hadoop-2.4.1/hdfs/data</value>
</property>
wq
# vi mapred-site.xml
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
wq
# vi yarn-site.xml
<property>
<name>yarn.resourcemanager.hostname</name>
<value>169.254.25.128</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
wq
# vi /etc/profile
HADOOP_HOME=/simple/hadoop-2.4.1
export PATH=$JAVAHOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
wq
# source /etc/profile
# cd /simple/hadoop-2.4.1
# mkdir tmp
# mkdir hdfs
# cd hdfs
# mkdir name
# mkdir data
# hdfs namenode -format
# cd /simple/hadoop-2.4.1/sbin
# ./start-dfs.sh
# ./start-yarn.sh
# ./start-all.sh
# jps
Jps
ResourceManager
SecondaryNameNode
NameNode
NodeManager
DataNode
5.1 测试hdfs和yarn
在浏览器地址栏输入:
http:localhost:50070(HDFS管理界面)
http:localhost:8088(MR管理界面)
以上是关于Hadoop配置环境-伪分布式的主要内容,如果未能解决你的问题,请参考以下文章