本篇内容主要讲解“ubuntu如何搭建Hadoop集群环境”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“ubuntu如何搭建Hadoop集群环境”吧!
docker安装
1、国际惯例更新下apt软件包的源
sudoapt-getupdate
2、安装软件包以允许apt通过https使用存储库
sudoapt-getinstall\ apt-transport-https\ ca-certificates\ curl\ software-properties-common
3、因为被墙使用教育网镜像:
复制代码代码如下:
curl -fssl https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add
4、同样
sudoadd-apt-repository\ "deb[arch=amd64]https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu\ $(lsb_release-cs)\ stable"
5、更新下我们的软件源
sudoapt-getupdate
6、安装docker
sudoapt-getinstalldocker-ce
7、启动docker服务
sudoservicedockerstart
or
sudosystemctlstartdocker
8、觉得有必要可以设置开机自带启动
sudosystemctlenabledocker
9、关闭自启动
sudosystemctldisabledocker
10、国内访问docker会受限制,可以使用加速服务,阿里云、网易云、daocloud
11、运行docker run hello-world
测试是否安装成功
12、想要安装其他image 可以到docker hub上找
或是直接在github上搜索相应docker
搭建hadoop集群
搭建过程很简单
上步骤说明很详细:
1、pull镜像,速度慢的换国内镜像源
sudodockerpullkiwenlau/hadoop:1.0
200多m不算大,我下过jupyter官方pyspark的docker 5g…
2、克隆项目到本地
gitclonehttps://github.com/kiwenlau/hadoop-cluster-docker
其实只用到里面的 start-container.sh 文件也可以单独下,复制粘贴啥的
3、start-container.sh 需要修改一下 cd 到文件目录
sudo gedit start-container.sh
修改如下
开放9000端口还有创建共享文件夹方便以后使用
4、保存之后,创建docker-hadoop网络
sudodockernetworkcreate--driver=bridgehadoop
5、开启容器
sudo./start-container.sh
6、开启hadoop集群
./start-hadoop.sh
7、测试一下hadoop,在hdfs上创建 test/input 目录
hadoopfs-mkdir-p/test/input hadoopfs-ls/test
8、运行word-count程序
./run-wordcount.sh
结果如下
到此,相信大家对“ubuntu如何搭建Hadoop集群环境”有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
推荐阅读:ubuntu docker怎样搭建Hadoop集群环境
发表评论 取消回复