hadoop安装与配置步骤的命令
时间: 2024-06-18 10:06:15 浏览: 210
Hadoop是一个大数据处理框架,安装和配置步骤如下:
1. 下载Hadoop的压缩包并解压:
```
wget http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-3.3.1/hadoop-3.3.1.tar.gz
tar zxvf hadoop-3.3.1.tar.gz
```
2. 配置环境变量(需要根据实际安装路径进行设置):
```
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
```
3. 配置Hadoop的core-site.xml文件:
```
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
```
4. 配置Hadoop的hdfs-site.xml文件:
```
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/usr/local/hadoop/hadoop_data/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/usr/local/hadoop/hadoop_data/hdfs/datanode</value>
</property>
</configuration>
```
5. 配置Hadoop的mapred-site.xml文件:
```
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
```
6. 配置Hadoop的yarn-site.xml文件:
```
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>localhost</value>
</property>
<property>
<name>yarn.nodemanager.resource.memory-mb</name>
<value>1024</value>
</property>
</configuration>
```
7. 格式化HDFS文件系统:
```
hdfs namenode -format
```
8. 启动Hadoop:
```
start-all.sh
```
9. 检查Hadoop是否启动成功:
```
jps
```
阅读全文