@zhangyy
2018-05-18T18:40:54.000000Z
字数 2989
阅读 182
hadoop的部分
- 一:系统需求与软件包
- 二:系统环境初始化
- 三:hadoop 伪分布式搭建
- 四:运行wordcount测试
关闭CentOS6.4x64 系统防火墙与selinux
配置系统信息
新建安装用户,更改主机名,配置静态IP设置
1.1 新建安装用户hadoop
#useradd hadoop
#echo "hadoop" |passwd hadoop --stdin
上传所有安装文件到hadoop 用户目录下面,并新建安装目录yangyang下面
1.2 更改主机名与host文件
#hostname namenode01.hadoop.com
#vim /etc/sysconfig/network
#vim /etc/hosts
1.3 配置静态IP设置
#vim /etc/sysconfig/network-script/ifcfg-eth1
#tar -zxvf jdk-7u67-linux-x64.tar.gz
#mv jdk-7u67-linux-x64 yangyang/jdk
#vim .bash_profile
#source .bash_profile
export JAVA_HOME=/home/hadoop/yangyang/jdk
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
export HADOOP_HOME=/home/hadoop/yangyang/hadoop
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:${HADOOP_HOME}/bin
java -version
#tar -zxvf hadoop-2.5.0.tar.gz
#mv hadoop-2.5.0 yangyang/hadoop
#echo "export JAVA_HOME=/home/hadoop/yangyang/jdk" >> hadoop-env.sh
#echo "export JAVA_HOME=/home/hadoop/yangyang/jdk" >> mapred-env.sh
#echo "export JAVA_HOME=/home/hadoop/yangyang/jdk" >> yarn-env.sh
1.2 更改配置文件
1.2.1 配置core-site.xml
#cd yangyang/hadoop/etc/
#vim core-site.xml 配置内容
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/yangyang/hadoop/data</value>
<description>hadoop_temp</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://namenode01.hadoop.com:8020</value>
<description>hdfs_derect</description>
</property>
</configuration>
1.2.2 配置hdfs-site.xml 文件
#vim hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>num</description>
<name>dfs.namenode.http-address</name>
<value>namenode01.hadoop.com:50070</value>
</property>
</configuration>
1.2.3 配置map-site.xml
#cp -p mapred-site.xml.template mapred-site.xml
#vim mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>namenode01.hadoop.com:19888</value>
</property>
</configuration>
1.2.4 配置yarn-site.xml
#vim yarn-site.xml
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
1.2.5 替换native 包
#cd yangyang/hadoop/lib/native
#rm -rf *
#tar -zxvf native-2.5.0.tar.gz -C yangyang/hadoop/lib/native/
1.2.6 格式文件系统
# hdfs namenode -format
1.2.7 启动相关服务器
#cd yangyang/sbin
#./hadoop-deamon.sh start namenode
#./hadoop-deamon.sh start datanode
#./yarn-deamon.sh start resourcemanager
#./yarn-deamon.sh start nodemanager
#jps
1.2.8 上传 文件
#hdfs dfs -mkdir /input
#hdfs dfs -put file1 /input/
#hdfs dfs -mkdir /output
1.2.9 打开浏览器
192.168.3.1:50070
192.168.3.1:8088