本地启动spark-shell

由于spark-1.3作为一个里程碑式的发布, 加入众多的功能特性,所以,有必要好好的研究一把,spark-1.3需要scala-2.10.x的版本支持,而系统上默认的scala的版本为2.9,需要进行升级, 可以参考ubuntu 安装 2.10.x版本的scala. 配置好scala的环境后,下载spark的cdh版本, 点我下载.

下载好后,直接解压,然后在bin目录直接运行./spark-shell 即可:

日志如下:

[email protected]:~/spark-evn/spark-1.3.0-bin-cdh4/bin$ ./spark-shell
Spark assembly has been built with Hive, including Datanucleus jars on classpath
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Using Spark‘s default log4j profile: org/apache/spark/log4j-defaults.properties
15/04/14 00:03:30 INFO SecurityManager: Changing view acls to: zhangchao3
15/04/14 00:03:30 INFO SecurityManager: Changing modify acls to: zhangchao3
15/04/14 00:03:30 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(zhangchao3); users with modify permissions: Set(zhangchao3)
15/04/14 00:03:30 INFO HttpServer: Starting HTTP Server
15/04/14 00:03:30 INFO Server: jetty-8.y.z-SNAPSHOT
15/04/14 00:03:30 INFO AbstractConnector: Started [email protected]0.0.0.0:45918
15/04/14 00:03:30 INFO Utils: Successfully started service ‘HTTP class server‘ on port 45918.
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  ‘_/
   /___/ .__/\_,_/_/ /_/\_\   version 1.3.0
      /_/

Using Scala version 2.10.4 (OpenJDK 64-Bit Server VM, Java 1.7.0_75)
Type in expressions to have them evaluated.
Type :help for more information.
15/04/14 00:03:33 WARN Utils: Your hostname, hadoop01 resolves to a loopback address: 127.0.1.1; using 172.18.147.71 instead (on interface em1)
15/04/14 00:03:33 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address
15/04/14 00:03:33 INFO SparkContext: Running Spark version 1.3.0
15/04/14 00:03:33 INFO SecurityManager: Changing view acls to: zhangchao3
15/04/14 00:03:33 INFO SecurityManager: Changing modify acls to: zhangchao3
15/04/14 00:03:33 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(zhangchao3); users with modify permissions: Set(zhangchao3)
15/04/14 00:03:33 INFO Slf4jLogger: Slf4jLogger started
15/04/14 00:03:33 INFO Remoting: Starting remoting
15/04/14 00:03:33 INFO Remoting: Remoting started; listening on addresses :[akka.tcp://[email protected]:51629]
15/04/14 00:03:33 INFO Utils: Successfully started service ‘sparkDriver‘ on port 51629.
15/04/14 00:03:33 INFO SparkEnv: Registering MapOutputTracker
15/04/14 00:03:33 INFO SparkEnv: Registering BlockManagerMaster
15/04/14 00:03:33 INFO DiskBlockManager: Created local directory at /tmp/spark-d398c8f3-6345-41f9-a712-36cad4a45e67/blockmgr-255070a6-19a9-49a5-a117-e4e8733c250a
15/04/14 00:03:33 INFO MemoryStore: MemoryStore started with capacity 265.4 MB
15/04/14 00:03:33 INFO HttpFileServer: HTTP File server directory is /tmp/spark-296eb142-92fc-46e9-bea8-f6065aa8f49d/httpd-4d6e4295-dd96-48bc-84b8-c26815a9364f
15/04/14 00:03:33 INFO HttpServer: Starting HTTP Server
15/04/14 00:03:33 INFO Server: jetty-8.y.z-SNAPSHOT
15/04/14 00:03:33 INFO AbstractConnector: Started [email protected]0.0.0.0:56529
15/04/14 00:03:33 INFO Utils: Successfully started service ‘HTTP file server‘ on port 56529.
15/04/14 00:03:33 INFO SparkEnv: Registering OutputCommitCoordinator
15/04/14 00:03:33 INFO Server: jetty-8.y.z-SNAPSHOT
15/04/14 00:03:33 INFO AbstractConnector: Started [email protected]0.0.0.0:4040
15/04/14 00:03:33 INFO Utils: Successfully started service ‘SparkUI‘ on port 4040.
15/04/14 00:03:33 INFO SparkUI: Started SparkUI at http://172.18.147.71:4040
15/04/14 00:03:33 INFO Executor: Starting executor ID <driver> on host localhost
15/04/14 00:03:33 INFO Executor: Using REPL class URI: http://172.18.147.71:45918
15/04/14 00:03:33 INFO AkkaUtils: Connecting to HeartbeatReceiver: akka.tcp://[email protected]:51629/user/HeartbeatReceiver
15/04/14 00:03:33 INFO NettyBlockTransferService: Server created on 55429
15/04/14 00:03:33 INFO BlockManagerMaster: Trying to register BlockManager
15/04/14 00:03:33 INFO BlockManagerMasterActor: Registering block manager localhost:55429 with 265.4 MB RAM, BlockManagerId(<driver>, localhost, 55429)
15/04/14 00:03:33 INFO BlockManagerMaster: Registered BlockManager
15/04/14 00:03:34 INFO SparkILoop: Created spark context..
Spark context available as sc.
15/04/14 00:03:34 INFO SparkILoop: Created sql context (with Hive support)..
SQL context available as sqlContext.

scala>

http://172.18.147.71:4040/jobs/ ,可以看到spark运行情况:

时间: 2024-10-14 22:30:37

本地启动spark-shell的相关文章

Spark Standalone Mode 单机启动Spark -- 分布式计算系统spark学习(一)

spark是个啥? Spark是一个通用的并行计算框架,由UCBerkeley的AMP实验室开发. Spark和Hadoop有什么不同呢? Spark是基于map reduce算法实现的分布式计算,拥有Hadoop MapReduce所具有的优点;但不同于MapReduce的是Job中间输出和结果可以保存在内存中,从而不再需要读写HDFS,因此Spark能更好地适用于数据挖掘与机器学习等需要迭代的map reduce的算法. Spark的适用场景 Spark是基于内存的迭代计算框架,适用于需要多

配置并启动spark的thriftserver网关

1.保证spark-sql已经使用mysql作为metadata存储介质 2.启动thrift网关 $SPARK_HOME/sbin/start-thriftserver.sh --driver-class-path /usr/local/spark/spark-1.3.0-bin-hadoop2.3/lib/mysql-connector-java-5.1.6-bin.jar --master spark://hd1:7077 --executor-memory 2g --total-exec

【原创 Hadoop&amp;Spark 动手实践 5】Spark 基础入门,集群搭建以及Spark Shell

Spark 基础入门,集群搭建以及Spark Shell 主要借助Spark基础的PPT,再加上实际的动手操作来加强概念的理解和实践. Spark 安装部署 理论已经了解的差不多了,接下来是实际动手实验: 练习1 利用Spark Shell(本机模式) 完成WordCount spark-shell 进行Spark-shell本机模式 第一步:通过文件方式导入数据 scala> val rdd1 = sc.textFile("file:///tmp/wordcount.txt")

本地启动mongo

第一步,data下启动mongod 第二部 二进制文件下启动mongo 第三部 设置 本地变量 本地启动mongo,布布扣,bubuko.com

第一次看到Spark崩溃:Spark Shell内存OOM的现象!

第一次看到Spark崩溃 Spark Shell内存OOM的现象 要搞Spark图计算,所以用了Google的web-Google.txt,大小71.8MB. 以命令: val graph = GraphLoader.edgeListFile(sc,"hdfs://192.168.0.10:9000/input/graph/web-Google.txt") 建立图的时候,运算了半天后直接退回了控制台. 界面xian scala> val graph = GraphLoader.e

利用Maven管理工程项目本地启动报错及解决方案

目前利用Maven工具来构建自己的项目已比较常见.今天主要不是介绍Maven工具,而是当你本地启动这样的服务时,如果遇到报错,该如何解决?下面只是参考的解决方案,具体的解法还是得看自己本地的工程配置. 1.log提示: SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListenerjava.lang.ClassNotFoundExceptio

windows调试本地启动的tomcat

我们一般都通过Eclipse进行tomcat的本地调试,但有些特殊情况下需要直接本地启动tomcat(进入tomcat的bin目录下执行startup.bat),此时我们可以利用类似远程调试模式的方式来进行debug. 首先需要在bin/catalina.bat里加入远程调试的环境变量设置,这里我们把调试端口号设为18080 set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:

启动bash shell的三种方式下,检查的启动文件

启动bash shell的三种方式 1.登录时当做默认登录shell 2.作为非登录shell的交互式shell 3.作为运行脚本的非交互shell 一.登录shell 登录Linux系统时,bash shell会作为登录shell启动,登录shell会从4个不同的启动文件里读取命令,下面是bash shell处理这些文件的次序: 1./etc/profile 2.$HOME/.bash_profile 3.$HOME/.bash_login 4.$HOME/.profile 其中/etc/pr

启动spark集群

启动Spark集群 [email protected] $ ./sbin/start-all.sh 也可以一台一台启动,先启动 master [email protected] $ ./sbin/start-master.sh 启动两台 slave, [email protected] $ ./sbin/start-slave.sh 1 spark://master:7077 [email protected] $ ./sbin/start-slave.sh 2 spark://master:7

Hbase启动hbase shell运行命令报Class path contains multiple SLF4J bindings.错误

1:Hbase启动hbase shell运行命令报Class path contains multiple SLF4J bindings.错误,是因为jar包冲突了,所以对于和hadoop的jar包冲突的,可以将其他jar包删除,如果你不确定是否删除正确,可以将其他的jar包复制备份或者修改名称,确保操作以后失败了,还可以找回. SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:fil