spark 学习

The --master option specifies the master URL for a distributed cluster, or local to run locally with one thread, or local[N] to run locally with N threads.

查看hdfs

$ ./bin/hadoop fs -ls hdfs:/user/xunw/


spark 读取hdfs

spark-submit --master spark://192.168.1.24:7077 examples/src/main/python/wordcount.py hdfs://zj:9000/user/xunw/input2/hello.txt

注意192.168.1.24 不能写成zj


 WARN AppClient$ClientActor: Could not connect to akka.tcp://sparkMaster@192.168.1.24:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@192.168.1.24:7077]


集群没有启动  start-all.sh

800M.txt 16min:

Final centers: [array([-4.94759899, -5.10103885]), array([ 4.86596504,  5.03759974])]

Internally, a DStream is represented as a sequence ofRDDs.

作用于RDD上的Operation分为transformantion和action。 经Transformation处理之后,数据集中的内容会发生更改,由数据集A转换成为数据集B;而经Action处理之后,数据集中的内容会被归约为一个具体的数值。

只有当RDD上有action时,该RDD及其父RDD上的所有operation才会被提交到cluster中真正的被执行。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值