配置ssh
要点:要求免密码登陆
cd ~/.ssh
ssh-keygen -t rsa
cat ./id_rsa.pub >> ./authorized_keys
Hadoop 伪分布式安装
# java1.8 !important JAVA必须安装1.8,不要安装高版本,会不兼容
wget https://repo.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-x64.tar.gz
sudo mkdir /usr/lib/jvm
sudo tar -zxf jdk-8u201-linux-x64.tar.gz -C /usr/lib/jvm
# hadoop3.3.6安装
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz
sudo tar -zxf hadoop-3.3.6.tar.gz -C /usr/local/
sudo mv /usr/local/hadoop-3.3.6 /usr/local/hadoop
配置/etc/profile
# JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_201
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
# HADOOP_HOME
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:${HADOOP_HOME}/bin
export PATH=$PATH:${HADOOP_HOME}/sbin
配置hadoop/etc/hadoop/core-site.xml
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/usr/local/hadoop/tmp</value>
<description>Abase for other temporary directories.</description>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
配置hadoop/etc/hadoop/hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/usr/local/hadoop/tmp/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/local/hadoop/tmp/dfs/data</value>
</property>
</configuration>
/usr/local/hadoop/bin/hdfs namenode -format
配置hadoop/sbin/start-dfs.sh
HDFS_DATANODE_USER=username
HDFS_DATANODE_SECURE_USER=hdfs
HDFS_NAMENODE_USER=username
HDFS_SECONDARYNAMENODE_USER=username
配置hadoop/sbin/start-yarn.sh
YARN_RESOURCEMANAGER_USER=username
HADOOP_SECURE_DN_USER=yarn
YARN_NODEMANAGER_USER=username
配置hadoop/etc/hadoop/hadoop-env.sh
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_201
export HADOOP=/usr/local/hadoop
export PATH=$PATH:/usr/local/hadoop/bin
/usr/local/hadoop/sbin/start-dfs.sh
标签:安装,hadoop,export,usr,PATH,HOME,local,分布式
From: https://www.cnblogs.com/moguw/p/18249680