centos7: install hadoop

Preparing:

Source JDK 1.8.0
Source Hadoop

install hadoop

tar -zxvf jdk*****
tar -zxvf hadoop****.tar.gz
mv   hadoop-***    hadoop
mv jdk*** jdk

vim  ~/.bash_profile
export JAVA_HOME="/root/jdk"
export HADOOP_HOME="/root/hadoop"
export ZOOKEEPER_HOME="/root/zookeeper"
export PATH="$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$ZOOKEEPER_HOME/bin"

export HDFS_NAMENODE_USER=root 
export HDFS_DATANODE_USER=root 
export HDFS_SECONDARYNAMENODE_USER=root 
export YARN_RESOURCEMANAGER_USER=root 
export YARN_NODEMANAGER_USER=root

source  ~/.bash_profile

# verify
echo $PATH    
hadoop settings

vim /hadoop/etc/hadoop/hadoop-env.sh

export JAVA_HOME="/Install/jdk/jre"

vim hdfs-site.xml

<configuration>
	<property>
		<name>dfs.nameservices</name>
		<value>ns</value>
	</property>
	<property>
		<name>dfs.ha.namenodes.ns</name>
		<value>nn1, nn2</value>
	</property>
	<property>
	<name>dfs.namenode.rpc-address.ns.nn1</name>
		<value>sv1:9000</value>
	</property>
	<property>
		<name>dfs.namenode.http-address.ns.nn1</name>
		<value>sv1:50070</value>
	</property>
	<property>
		<name>dfs.namenode.rpc-address.ns.nn2</name>
		<value>sv2:9000</value>
	</property>
	<property>
		<name>dfs.namenode.http-address.ns.nn2</name>
		<value>sv2:50070</value>
	</property>
	<property>
		<name>dfs.namenode.shared.edits.dir</name>
		<value>qjournal://:8485;sv2:8485;sv3:8485/ns</value>
	</property>
	<property>
		<name>dfs.datanode.data.dir</name>
		<value>/root/backup/hadoop/hdfs/data, /backup/hadoop/hdfs/data</value>
	</property>
	<property>
		<name>dfs.namenode.checkpoint.dir</name>
		<value>/root/backup/hadoop/hdfs/namesecondary, /backup/hadoop/hdfs/namesecondary</value>
	</property>
</configuration>

vim core-site.xml

<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://ns</value>
</property>
</configuration>

vim mapred-site.xml

<configuration>
	<property>
		<name>mapreduce.framework.name</name>
		<value>yarn</value>
	</property>
	<property>
		<name>mapreduce.map.memory.mb</name>
		<value>512</value>
	</property>
	<property>
		<name>mapreduce.reduce.memory.mb</name>
		<value>512</value>
	</property>
	<property>
		<name>mapreduce.map.java.opts</name>
		<value>-Xmx150m</value>
	</property>
	<property>
		<name>mapreduce.reduce.java.opts</name>
		<value>-Xmx512m</value>
	</property>
	<property>
		<name>yarn.app.mapreduce.am.resource.mb</name>
		<value>512</value>
	</property>
	<property>
		<name>yarn.app.mapreduce.am.command-opts</name>
		<value>-Xmx512m</value>
	</property>
</configuration>

vim yarn-site.xml

<configuration>
		<property>
		<name>yarn.resourcemanager.hostname</name>
		<value>sv3</value>
	</property>
		<property>
		<name>yarn.resourcemanager.zk-address</name>
		<value>sv1:2181,sv2:2181,sv3:2181</value>
	</property>
	<property>
		<name>yarn.nodemanager.aux-services</name>
		<value>mapreduce_shuffle</value>
	</property>
		<property>
		<name>yarn.scheduler.minimum-allocation-mb</name>
		<value>256</value>
	</property>
		<property>
		<name>yarn.scheduler.maximum-allocation-mb</name>
		<value>1024</value>
	</property>
		<property>
		<name>yarn.nodemanager.resource.memory-mb</name>
		<value>1024</value>
	</property>
	<property>
		<name>yarn.nodemanager.vmem-check-enabled</name>
		<value>false</value>
	</property>
	</configuration>

vim slavers

sv1
sv2
sv3

verify

hdfs getconf -namenodes

start-all.sh 
stop-all.sh

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值