docker on spark
- 从docker 仓库 pull 镜像
docker pull sequenceiq/spark:1.4.0
构建 docker 镜像
docker build –rm -t sequenceiq/spark:1.4.0 .
-t 选项是你要构建的sequenceiq/spark image的tag,就好比ubuntu:13.10一样 –rm 选项是告诉Docker在构建完毕后删除暂时的Container,Dockerfile的每一行指令都会创建一个暂时的Container,一般你是不须要这些暂时生成的Container的执行镜像
- if using boot2docker make sure your VM has more than 2GB memory
- in your /etc/hosts file add $(boot2docker ip) as host ‘sandbox’ to make it easier to access your sandbox UI
- open yarn UI ports when running container
docker run -it -p 8088:8088 -p 8042:8042 -h sandbox sequenceiq/spark:1.4.0 bash
or
docker run -d -h sandbox sequenceiq/spark:1.4.0 -d
- 假设要进行交互式操作(比如Shell脚本),那我们必须使用-i -t參数同容器进行数据交互。可是当通过管道同容器进行交互时,就不须要使用-t參数
- -h来设定hostname
假设使用-p或者-P,那么容器会开放部分port到主机。仅仅要对方能够连接到主机。就能够连接到容器内部。
当使用-P时,Docker会在主机中随机从49153 和65535之间查找一个未被占用的port绑定到容器。
你能够使用docker port来查找这个随机绑定port。
假设在docker run后面追加-d=true或者-d。那么容器将会执行在后台模式。此时全部I/O数据仅仅能通过网络资源或者共享卷组来进行交互。由于容器不再监听你执行docker run的这个终端命令行窗体。
但你能够通过执行docker attach来又一次附着到该容器的回话中。
须要注意的是。容器执行在后台模式下,是不能使用–rm选项的。
-p 8088:8088 这个port是resourcemanager 或者 集群 ,-p 8042:8042 这个port是 nodemanagerport
版本号
Hadoop 2.6.0 and Apache Spark v1.4.0 on Centos測试
There are two deploy modes that can be used to launch Spark applications on YARN.- YARN-client mode
In yarn-cluster mode, the Spark driver runs inside an application master process which is managed by YARN on the cluster, and the client can go away after initiating the application.
Estimating Pi (yarn-cluster mode):
# execute the the following command which should write the "Pi is roughly 3.1418" into the logs
# note you must specify --files argument in cluster mode to enable metrics
spark-submit \
--class org.apache.spark.examples.SparkPi \
--files $SPARK_HOME/conf/metrics.properties \
--master yarn-cluster \
--driver-memory 1g \
--executor-memory 1g \
--executor-cores 1 \
$SPARK_HOME/lib/spark-examples-1.4.0-hadoop2.6.0.jar
- YARN-cluster mode
# execute the the following command which should print the "Pi is roughly 3.1418" to the screen
spark-submit \
--class org.apache.spark.examples.SparkPi \
--master yarn-client \
--driver-memory 1g \
--executor-memory 1g \
--executor-cores 1 \
$SPARK_HOME/lib/spark-examples-1.4.0-hadoop2.6.0.jar
docker on spark的更多相关文章
- 使用docker打造spark集群
前提条件:安装好了docker,见我的另一篇博客,Docker安装 有两种方式, Spark官方repo里,docker文件夹下的脚本.官方的这个脚本封装很薄,尽可能把必要的信息展示出来. AMPLa ...
- 利用docker搭建spark hadoop workbench
目的 用docker实现所有服务 在spark-notebook中编写Scala代码,实时提交到spark集群中运行 在HDFS中存储数据文件,spark-notebook中直接读取 组件 Spark ...
- Docker 搭建Spark 依赖singularities/spark:2.2镜像
singularities/spark:2.2版本中 Hadoop版本:2.8.2 Spark版本: 2.2.1 Scala版本:2.11.8 Java版本:1.8.0_151 拉取镜像: [root ...
- Docker 搭建Spark 依赖sequenceiq/spark:1.6镜像
使用Docker-Hub中Spark排行最高的sequenceiq/spark:1.6.0. 操作: 拉取镜像: [root@localhost home]# docker pull sequence ...
- docker for spark
项目需求,有一个spark-streaming的程序,读kafka的数据,需要构建一个不使用hadoop的spark 以下建立的镜像参考网络,可以稍加修改就可以使用不同的版本. 可单独启动master ...
- 使用Docker搭建Spark集群(用于实现网站流量实时分析模块)
上一篇使用Docker搭建了Hadoop的完全分布式:使用Docker搭建Hadoop集群(伪分布式与完全分布式),本次记录搭建spark集群,使用两者同时来实现之前一直未完成的项目:网站日志流量分析 ...
- spark docker java kubernetes 获取cpu内核/线程数问题
升级服务从spark2.3.0-hadoop2.8 至 spark2.4.0 hadoop3.0 一日后导致spark streaming kafka消费数据积压 服务不是传统的部署在yarn上,而是 ...
- Docker中提交任务到Spark集群
1. 背景描述和需求 数据分析程序部署在Docker中,有一些分析计算需要使用Spark计算,需要把任务提交到Spark集群计算. 接收程序部署在Docker中,主机不在Hadoop集群上.与Spa ...
- Docker on YARN在Hulu的实现
这篇文章是我来Hulu这一年做的主要工作,结合当下流行的两个开源方案Docker和YARN,提供了一套灵活的编程模型,目前支持DAG编程模型,将会支持长服务编程模型. 基于Voidbox,开发者可以很 ...
随机推荐
- Win 10最大的亮点不是免费而是人工智能
7月27日,日本知名作家Manish Singh发表文章.题为"Eight Reasons Why You Should Upgrade to Windows 10",文中例举下面 ...
- angularjs $http 服务
<!DOCTYPE HTML> <html ng-app="myApp"> <head> <meta http-equiv="C ...
- sklearn.preprocessing OneHotEncoder——仅仅是数值型字段才可以,如果是字符类型字段则不能直接搞定
>>> from sklearn.preprocessing import OneHotEncoder >>> enc = OneHotEncoder() > ...
- python中对单例模式的理解
class Foo(object): instance = None def __init__(self): pass def process(self): ' @classmethod #版本1单例 ...
- 51Nod 1010 只包含因子2 3 5的数(打表+二分)
K的因子中只包含2 3 5.满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15. 所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数. 例如:n = ...
- 2、go Defer
package main import ( "fmt" "os") func main() { f:=createFile("D:\\webfront ...
- Linux常用命令及其英文全称
alias:给命令起别名 awk = "Aho Weiberger and Kernighan" ,三个作者的姓的第一个字母 bash:GNU Bourne-Again She ...
- tf.cast(ndarray,dtype)
转化为指定的类型,一般是将bool类型转化为其他的数据类型,例如:tf.float32
- HDU 4939 Stupid Tower Defense 简单DP
题意: 地图为长为n个单位长度的直线,每通过一个单位长度需要t秒. 有3种塔,红塔可以在当前格子每秒造成x点伤害,绿塔可以在之后格子造成y点伤害,蓝塔可以使通过单位长度的时间增加z秒. 让你安排塔的排 ...
- HDU 2253 Longest Common Subsequence Again
其实这个题我还不会,学长给了一个代码交上去过了,据说用到了一种叫做位压缩的技术,先贴代码吧,以后看懂了再来写 #include <stdio.h> #include <string. ...