spark 配置使用

介绍

  • Apache Spark is a fast and general-purpose cluster computing system. It provides high-level APIs in Java, Scala, Python and R, and an optimized engine that supports general execution graphs. It also supports **a rich set of higher-level tools **including Spark SQL for SQL and structured data processing, MLlib for machine learning, GraphX for graph processing, and Spark Streaming.
  • 直接到官网下载代码,
  • 需要安装jdk,java已经设置到系统路径PATH,或者设置JAVA_HOME。

使用

  • 运行例子:
    use bin/run-example [params] in the top-level Spark directory.
    ./bin/run-example SparkPi 10
  • 使用交互探索Spark,不过是scala语言
    ./bin/spark-shell --master local[2]
    使用run Spark shell with the --help option可以查命令参数.
  • Spark also provides a Python API. To run Spark interactively in a Python interpreter, use bin/pyspark:
    ./bin/pyspark --master local[2]
    也可以将这个包导入到python的包文件里,这里提供了方法:
    http://blog.youkuaiyun.com/sinat_26599509/article/details/51895999
  • Example applications are also provided in Python.当然可以自学去看怎么是实现。可以运行:
    ./bin/spark-submit examples/src/main/python/pi.py 10

  • 对于R,也是一样的可以运行交互环境 sparkR。也可以和上面使用spark-submit 运行R文件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值