启动PySpark

export IPYTHON= # PySpark也可使用IPython shell
pyspark --master yarn --num-executors

发生如下错误:

/opt/cloudera/parcels/CDH-5.3.-.cdh5.3.3.p0./bin/../lib/spark/bin/pyspark: line : exec: ipython: not found

原因是没有按照ipython,在google所有一下安装的方法,到网站http://continuum.io/downloads#all上下载Linux-64位的Anaconda版本,

wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86_64.sh

下载完成之后,运行如下命令进行安装:

bash Anaconda-2.3.-Linux-x86_64.sh

上述命令会进入一个类似shell的交互式环境,安装过程中都选择yes即可。安装完成之后,在安装ipython,Anaconda在交换式环境中输入:

pip install ipython

这时候会安装一大堆的包。安装完成之后会提示是否修改环境变量,输入yes,安装脚本自动将如下脚本写入~/.bashrc中的尾部

export PATH=/root/anaconda/bin:$PATH

运行source ~/.bashrc使新环境变量生效。

source ~/.bashrc

再次运行pyspark命令即可,如下:

pyspark --master yarn --num-executors 

得到如下输出:

Type "copyright", "credits" or "license" for more information.

IPython 3.2. -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
// :: INFO SecurityManager: Changing view acls to: root
// :: INFO SecurityManager: Changing modify acls to: root
// :: INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); users with modify permissions: Set(root)
// :: INFO Slf4jLogger: Slf4jLogger started
// :: INFO Remoting: Starting remoting
// :: INFO Remoting: Remoting started; listening on addresses :[akka.tcp://sparkDriver@ip-172-31-25-243.us-west-2.compute.internal:50324]
// :: INFO Remoting: Remoting now listens on addresses: [akka.tcp://sparkDriver@ip-172-31-25-243.us-west-2.compute.internal:50324]
// :: INFO Utils: Successfully started service 'sparkDriver' on port .
// :: INFO SparkEnv: Registering MapOutputTracker
// :: INFO SparkEnv: Registering BlockManagerMaster
// :: INFO DiskBlockManager: Created local directory at /tmp/spark-local--7afc
// :: INFO MemoryStore: MemoryStore started with capacity 265.4 MB
// :: INFO HttpFileServer: HTTP File server directory is /tmp/spark-e2f4c4e3-dc9b-4db0-8fd4-1dcbb8819b05
// :: INFO HttpServer: Starting HTTP Server
// :: INFO Utils: Successfully started service 'HTTP file server' on port .
// :: INFO Utils: Successfully started service 'SparkUI' on port .
// :: INFO SparkUI: Started SparkUI at http://ip-172-31-25-243.us-west-2.compute.internal:4040
// :: INFO RMProxy: Connecting to ResourceManager at ip----.us-west-.compute.internal/172.31.25.243:
// :: INFO Client: Requesting a new application from cluster with NodeManagers
// :: INFO Client: Verifying our application has not requested more than the maximum memory capability of the cluster ( MB per container)
// :: INFO Client: Will allocate AM container, with MB memory including MB overhead
// :: INFO Client: Setting up container launch context for our AM
// :: INFO Client: Preparing resources for our AM container
// :: INFO Client: Setting up the launch environment for our AM container
// :: INFO SecurityManager: Changing view acls to: root
// :: INFO SecurityManager: Changing modify acls to: root
// :: INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); users with modify permissions: Set(root)
// :: INFO Client: Submitting application to ResourceManager
// :: INFO YarnClientImpl: Submitted application application_1436008024626_0001
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client:
client token: N/A
diagnostics: N/A
ApplicationMaster host: N/A
ApplicationMaster RPC port: -
queue: root.root
start time:
final status: UNDEFINED
tracking URL: http://ip-172-31-25-243.us-west-2.compute.internal:8088/proxy/application_1436008024626_0001/
user: root
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO Client: Application report for application_1436008024626_0001 (state: ACCEPTED)
// :: INFO YarnClientSchedulerBackend: ApplicationMaster registered as Actor[akka.tcp://sparkYarnAM@ip-172-31-25-246.us-west-2.compute.internal:45245/user/YarnAM#-1546613765]
// :: INFO YarnClientSchedulerBackend: Add WebUI Filter. org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter, Map(PROXY_HOSTS -> ip----.us-west-.compute.internal, PROXY_URI_BASES -> http://ip-172-31-25-243.us-west-2.compute.internal:8088/proxy/application_1436008024626_0001), /proxy/application_1436008024626_0001
// :: INFO JettyUtils: Adding filter: org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter
// :: INFO Client: Application report for application_1436008024626_0001 (state: RUNNING)
// :: INFO Client:
client token: N/A
diagnostics: N/A
ApplicationMaster host: ip----.us-west-.compute.internal
ApplicationMaster RPC port:
queue: root.root
start time:
final status: UNDEFINED
tracking URL: http://ip-172-31-25-243.us-west-2.compute.internal:8088/proxy/application_1436008024626_0001/
user: root
// :: INFO YarnClientSchedulerBackend: Application application_1436008024626_0001 has started running.
// :: INFO NettyBlockTransferService: Server created on
// :: INFO BlockManagerMaster: Trying to register BlockManager
// :: INFO BlockManagerMasterActor: Registering block manager ip----.us-west-.compute.internal: with 265.4 MB RAM, BlockManagerId(<driver>, ip----.us-west-.compute.internal, )
// :: INFO BlockManagerMaster: Registered BlockManager
// :: INFO EventLoggingListener: Logging events to hdfs://ns-ha/user/spark/applicationHistory/application_1436008024626_0001
// :: INFO YarnClientSchedulerBackend: Registered executor: Actor[akka.tcp://sparkExecutor@ip-172-31-25-245.us-west-2.compute.internal:43360/user/Executor#1565208330] with ID 1
// :: INFO RackResolver: Resolved ip----.us-west-.compute.internal to /default
// :: INFO YarnClientSchedulerBackend: Registered executor: Actor[akka.tcp://sparkExecutor@ip-172-31-25-244.us-west-2.compute.internal:39613/user/Executor#-786460899] with ID 2
// :: INFO RackResolver: Resolved ip----.us-west-.compute.internal to /default
// :: INFO BlockManagerMasterActor: Registering block manager ip----.us-west-.compute.internal: with 530.3 MB RAM, BlockManagerId(, ip----.us-west-.compute.internal, )
// :: INFO BlockManagerMasterActor: Registering block manager ip----.us-west-.compute.internal: with 530.3 MB RAM, BlockManagerId(, ip----.us-west-.compute.internal, )
// :: INFO YarnClientSchedulerBackend: SchedulerBackend is ready for scheduling beginning after waiting maxRegisteredResourcesWaitingTime: (ms)
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/__ / .__/\_,_/_/ /_/\_\ version 1.2.-SNAPSHOT
/_/ Using Python version 2.7. (default, May ::)
SparkContext available as sc. In []:

AAS代码运行-第11章-1的更多相关文章

  1. AAS代码运行-第11章-2

    hdfs dfs -ls /user/littlesuccess/AdvancedAnalysisWithSparkhdfs dfs -mkdir /user/littlesuccess/Advanc ...

  2. AAS代码运行-第4章

    [root@node1 aas]# ls ch02 ch03 spark--bin-hadoop2. spark--bin-hadoop2..tgz [root@node1 aas]# cd spar ...

  3. 第11章 Windows线程池(1)_传统的Windows线程池

    第11章 Windows线程池 11.1 传统的Windows线程池及API (1)线程池中的几种底层线程 ①可变数量的长任务线程:WT_EXECUTELONGFUNCTION ②Timer线程:调用 ...

  4. 高性能Linux服务器 第11章 构建高可用的LVS负载均衡集群

    高性能Linux服务器 第11章 构建高可用的LVS负载均衡集群 libnet软件包<-依赖-heartbeat(包含ldirectord插件(需要perl-MailTools的rpm包)) l ...

  5. Linux就这个范儿 第11章 独霸网络的蜘蛛神功

    Linux就这个范儿 第11章  独霸网络的蜘蛛神功  第11章 应用层 (Application):网络服务与最终用户的一个接口.协议有:HTTP FTP TFTP SMTP SNMP DNS表示层 ...

  6. 第11章 享元模式(Flyweight Pattern)

    原文 第11章 享元模式(Flyweight Pattern) 概述:   面向对象的思想很好地解决了抽象性的问题,一般也不会出现性能上的问题.但是在某些情况下,对象的数量可能会太多,从而导致了运行时 ...

  7. 翻译连载 | 第 11 章:融会贯通 -《JavaScript轻量级函数式编程》 |《你不知道的JS》姊妹篇

    原文地址:Functional-Light-JS 原文作者:Kyle Simpson-<You-Dont-Know-JS>作者 关于译者:这是一个流淌着沪江血液的纯粹工程:认真,是 HTM ...

  8. 【STM32H7教程】第11章 STM32H7移植SEGGER的硬件异常分析

    完整教程下载地址:http://forum.armfly.com/forum.php?mod=viewthread&tid=86980 第11章       STM32H7移植SEGGER的硬 ...

  9. Java核心技术卷一基础知识-第11章-异常、断言、日志和调试-读书笔记

    第11章 异常.断言.日志和调试 本章内容: * 处理错误 * 捕获异常 * 使用异常机制的技巧 * 使用断言 * 日志 * 调试技巧 * GUI程序排错技巧 * 使用调试器 11.1 处理错误 如果 ...

随机推荐

  1. [SAP ABAP开发技术总结]ABAP调优——Open SQL优化

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  2. 移动端web开发基础概念

    最近在了解移动端web开发的相关知识,有些概念总是模糊不清,这次花费了一些时间整体的梳理了一遍. 分辨率 分辨率可以从显示分辨率与图像分辨率两个方向来分类.显示分辨率(屏幕分辨率)是屏幕图像的精密度, ...

  3. 学习PHP 逛的几个网站。

    PHP 第一社区 http://www.php1.cn/ 51cto php开发 http://developer.51cto.com/col/1441/ phphub https://phphub. ...

  4. (十二)select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET

    select函数用于在非阻塞中,当一个套接字或一组套接字有信号时通知你,系统提供select函数来实现多路复用输入/输出模型,原型:int select(int maxfd,fd_set *rdset ...

  5. java面向对象的语言

    对象:真实存在唯一的事物. 类: 实际就是对某种类型事物的共性属性与行为的抽取. 抽象的概念.... 车 我们从小的时候就不断的接触很多的对象,我们的大脑就会把 这些具备相同属性与行为的事物进行分类. ...

  6. 获取openid 的步骤

    1.引导客户打开 https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid &redirect_uri=https://w ...

  7. python3 实现简单的信用卡还款,取款转账功能V2

    仅实现还款,取款,转账,信息查询功能 程序结构: atm(函数主执行程序): #Author by Andy #_*_ coding:utf-8 _*_ import os,sys Father_pa ...

  8. Java中Sting类型对象内容不可改变

    String拥有一个特殊点叫:String对象的内容不可改变!   在调用诸如String对象的replace()等方法时,不是在原Sting对象的基础上改变对象内容,而是创建了一个新的String对 ...

  9. spring使用Email邮件系统

    1.提供邮件信息发送接收,附件绑定功能. 1.配置spring-email.xml文件 <context:property-placeholder location="classpat ...

  10. 比CMD更强大的命令行WMIC

    先决条件:a. 启动Windows Management Instrumentation服务,开放TCP135端口.b. 本地安全策略的“网络访问: 本地帐户的共享和安全模式”应设为“经典-本地用户以 ...