下载

​https://mirrors.cnnic.cn/apache/hadoop/common/​

创建用户

sudo useradd -m hadoop -s /bin/bash
sudo passwd hadoop
sudo adduser hadoop sudo

ssh

切换 hadoop
sudo apt-get update
sudo apt-get install openssh-server

配置无密码ssh

cd ~/.ssh/
ssh-keygen -t rsa 会有提示,都按回车就可以
cat ./id_rsa.pub >> ./authorized_keys 加入授权

ssh localhost 无需密码就可以访问

wordcount

file中创建txt 文件

./bin/hadoop fs -put file/*.txt input

./bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.4.jar wordcount input output