1 bin/hadoop checknative #检查是否支持本地库
HADOOP_HOME=/develop/hadoop-2.7.5
[root@node01 ~]# $HADOOP_HOME/bin/hadoop checknative
19/05/28 23:12:46 INFO bzip2.Bzip2Factory: Successfully loaded & initialized native-bzip2 library system-native
19/05/28 23:12:46 INFO zlib.ZlibFactory: Successfully loaded & initialized native-zlib library
Native library checking:
hadoop: true /export/servers/hadoop-2.6.0-cdh5.14.0/lib/native/libhadoop.so.1.0.0
zlib: true /lib64/libz.so.1
snappy: true /usr/lib64/libsnappy.so.1
lz4: true revision:10301
bzip2: true /lib64/libbz2.so.1
openssl: true /usr/lib64/libcrypto.so
2 MapReduce会自动忽略文件夹下的.开头的文件
3 hadoop-mapreduce的官方示例的测试执行方法
- 根据给出的精度参数计算 pi :
hadoop jar /develop/hadoop-2.6.0-cdh5.14.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0-cdh5.14.0.jar pi 3 5
- 根据给出的输入文件路径和输出文件路径,将目标文件中的所有单词以及对应的出现次数统计好,输出:
yarn jar /develop/hadoop-2.6.0-cdh5.14.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0-cdh5.14.0.jar wordcount /oozie/input /oozie/output
note: 可以用hadoop,也可使用yarn。hadoop是旧的命令,yarn是新的命令。