🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 一、下载安装 每一个节点的安装与配置是相同的,在实际工作中,通常在master节点上完成安装和配置后,然后将安装目录复制到其他节点就可以,没有必要把所有节点都配置一遍; 需要先安装JDK; 官网下载介质; ``` wget https://dlcdn.apache.org/hadoop/common/hadoop-3.3.1/hadoop-3.3.1.tar.gz ``` 解压即可; ``` tar -zxvf hadoop-3.3.1.tar.gz mv hadoop-3.3.1 hadoop ``` ## 二、配置 配置目录:/usr/lib/app/hadoop/etc/hadoop ![](https://img.kancloud.cn/0d/6f/0d6f2047a18286a9626cc6c4f9a4ef0e_1419x247.png) ### **hadoop-env.sh** 配置环境变量: ``` export JAVA_HOME=/usr/lib/app/jdk 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 ``` ### **hdfs-site.xml** ``` <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration> ``` ### **core-site.xml** ``` <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://localhost.localdomain:9000</value> <description>hdfs内部通讯访问地址</description> </property> <property> <name>hadoop.tmp.dir</name> <value>/usr/lib/app/hadoop/data/</value> <description>hadoop数据存放</description> </property> </configuration> ``` ### **mappred-site.xml** ``` <configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration> ``` ### **yarn-site.xml** ``` <configuration> <property> <name>yarn.resourcemanager.hostname</name> <value>localhost.localdomain</value> </property> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> </configuration> ``` ## 三、SSH免密登陆 ``` chmod 777 -R /usr/lib/app/hadoop/ chmod 755 /root chmod 700 ~/.ssh chmod 644 ~/.ssh/authorized_keys ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys ``` 测试: ``` ssh localhost ```