伪分布式版
最后更新于:2022-04-02 04:02:37
[TOC]
> [参考网址](https://www.jianshu.com/p/9c8a0f7b98cf)
## 创建用户
```
export username=im_user
useradd -d /home/${username} -m ${username}
passwd ${username}
echo "${username} ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/${username}
```
## 设置免登陆
```
cat >> /etc/hosts <
hadoop.tmp.dir
file:/usr/local/hadoop/tmp
Abase for other temporary directories.
fs.defaultFS
hdfs://localhost:9000
```
vim /usr/local/hadoop/etc/hadoop/hdfs-site.xml
```
dfs.replication
1
dfs.namenode.name.dir
file:/usr/local/hadoop/tmp/dfs/name
dfs.datanode.data.dir
file:/usr/local/hadoop/tmp/dfs/data
```
### 格式化节点
`/usr/local/hadoop/bin/hdfs namenode -format`
![UTOOLS1576056391244.png](http://yanxuan.nosdn.127.net/210b0d578b9df87046424995f1e2c991.png)
### 启动 Hadoop
`/usr/local/hadoop/start-dfs.sh`
### 关闭 Hadoop
`/usr/local/hadoop/stop-dfs.sh`
### Web界面查看HDFS信息
http://localhost:9870
';