docker toolbox
https://www.docker.com/products/docker-toolbox
spark
https://hub.docker.com/r/singularities/spark/~/dockerfile/
# start-hadoop-namenode
# hadoop fs -mkdir /user
# hadoop fs -mkdir /user/root/
# hadoop fs -put ./README.md /user/root
# start-spark
# start-spark worker [master]
# spark-shell
# spark-shell --master spark://a60b8c8f9653:7077
scala> val lines = sc.textFile("file:///usr/local/spark-2.1.0/README.md")
scala> val lines = sc.textFile("hdfs:///usr/local/spark-2.1.0/README.md")
lines: org.apache.spark.rdd.RDD[String] = file:///usr/local/spark-2.1.0/README.md MapPartitionsRDD[1] at textFile at <console>:24
scala> lines.count()
res0: Long = 104
scala> lines.saveAsTextFile("hdfs:///user/root/README2.md") // 保存到hdfs
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。