官方测试例子
cd $HADOOP_PREFIX
# run the mapreduce
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.0.jar grep input output 'dfs[a-z.]+'
# check the output
bin/hdfs dfs -cat output/*
将Hadoop在后台运行
后台运行Docker,需要加上 -d 参数
set hadoop port 50010 50070 to you outer server
docker run -d -p 50010 -p 50070 -i -t sequenceiq/hadoop-docker:2.5.0 /etc/bootstrap.sh –bash
use docker ps command, you get
docker set port 50070 to port 49154
you can use http://127.0.0.1:49154 to Browse HDFS.
the number 49154 is random generate.
docker run -d -p 50010:50010 -p 50070:50070 -i -t sequenceiq/hadoop-docker:2.5.0 /etc/bootstrap.sh –bash
use the up command, docker will set image’s 50070 to your machine’s 50070