1. 在VirtualBox中安装Ubuntu 14.04
2. 在Ubuntu 14.04中安装Docker
3. 安装基于Docker的Hadoop
下载image
docker pull sequenceiq/hadoop-docker:2.6.0
运行container
docker run -i -t sequenceiq/hadoop-docker:2.6.0 /etc/bootstrap.sh –bash
测试Hadoop(将ubuntu的内存调到2G,即2048MB,否则运行会出错)
cd $HADOOP_PREFIX
# 运行mapreduce
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar grep input output ‘dfs[a-z.]+‘
# 检查结果
bin/hdfs dfs -cat output/*
参考:
1. http://www.cnblogs.com/liqiu/p/4164406.html
2. https://github.com/sequenceiq/hadoop-docker
时间: 2024-12-21 22:01:11