首页 > 代码库 > Hadoop学习笔记——安装Hadoop

Hadoop学习笔记——安装Hadoop

sudo mv /home/common/下载/hadoop-2.7.2.tar.gz /usr/local
sudo tar -xzvf hadoop-2.7.2.tar.gz
sudo mv hadoop-2.7.2 hadoop    #改个名

 在etc/profile文件中添加

export HADOOP_HOME=/usr/local/hadoop
export PATH=.:$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin

 1.修改/usr/local/hadoop/etc/hadoop/hadoop-env.sh文件

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_121

2.修改/usr/local/hadoop/etc/hadoop/core-site.xml文件

<configuration>

	<property>
		<name>fs.default.name</name>
		<value>hdfs://hadoop0:9000</value>
	</property>
	<property>
		<name>hadoop.tmp.dir</name>
		<value>/usr/local/hadoop/tmp</value>
	</property>

</configuration>

 3.修改/usr/local/hadoop/etc/hadoop/hdfs-site.xml文件

<property>
	<name>dfs.replication</name>
	<value>1</value>
</property>
<property>
	<name>dfs.permissions</name>
	<value>false</value>
</property>

 4./usr/local/hadoop/etc/hadoop/mapred-site.xml(新建)

<configuration>

	<property>
		<name>mapred.job.tracker</name>
		<value>hadoop0:9001</value>
	</property>

</configuration>

 5.使得/etc/profile生效

sudo source /etc/profile

 

Hadoop学习笔记——安装Hadoop