1.  为什么要用Livy
  • Have long running SparkContexts that can be used for multiple Spark jobs, by multiple clients
  • Share cached RDDs or Dataframes across multiple jobs and clients
  • Multiple SparkContexts can be managed simultaneously, and they run on the cluster (YARN/Mesos) instead of the Livy Server for good fault tolerance and concurrency
  • Jobs can be submitted as precompiled jars, snippets of code, or via Java/Scala client API
  • Ensure security via secure authenticated communication
  • Apache License, 100% open source
2.Livy的运行模式(local和Yarn模式)
Then we upload the Spark example jar /usr/lib/spark/lib/spark-examples.jar on HDFS and point to it. If you are using Livy in local mode and not YARN mode, just keep the local path /usr/lib/spark/lib/spark-examples.jar.
(如果是Cluster模式的话,Livy会读取HDFS上的文件此时应该把依赖jar上传到HDFS上)
It is strongly recommended to configure Spark to submit applications in YARN cluster mode. That makes sure that user sessions have their resources properly accounted for in the YARN cluster, and that the host running the Livy server doesn't become overloaded when multiple user sessions are running.(当有多个session的时候为了减少Livy server的压力,建议部署成yarn的模式)
3.restful 接口
1.提交一个sparkjob
curl -X POST --data '{"file": "/opt/jars/testLivy.jar", "className": "com.testLivy.TestLivyJob"}' -H "Content-Type: application/json" localhost:8998/batches
2.查看状态( 有not_started starting idle running busy shutting_down error dead success 等状态)
localhost:8998/batches/3  结果:"id": 3,  "state": "dead"
4.livy 参数修改
(1) which can be changed with the livy.server.port config option  默认端口为8998,在livy.conf中可修改参数
(2) livy.yarn.jar : this config has been replaced by separate configs listing specific archives for different Livy features. Refer to the default  livy.conf  file shipped with Livy for instructions.
//默认使用hiveContext
livy.repl.enableHiveContext = true
//开启用户代理
livy.impersonation.enabled = true
//设置session空闲过期时间
livy.server.session.timeout = 1h
{"name":"test",
"args":["2016-10-10 22:00:00"],
"proxyUser":"shilong",
"className":"com.test.livyJob",
"file":"/opt/jars/etl-livy.jar",
"jars":["/opt/jars/jar/ficus_2.10-1.0.1.jar","/opt/jars/jar/mysql-connector-java-5.1.39.jar"],//livy hdfs上面的的依赖jar 问题
"conf":{"driverMemory":"1g","driverCores":1,"executorCores":2,"executorMemory":"3g","numExecutors":2}
}
Livy 提供的关键字参数

(16 known properties: "executorCores", "className", "conf", "driverMemory", "name", "driverCores", "pyFiles", "archives", "queue", "executorMemory", "files", "jars", "proxyUser", "numExecutors", "file" [truncated]]

 

Livy 安装使用说明相关推荐

  1. 2021Eclipse 的安装使用说明

    Eclipse 的安装使用说明 1. 下载 2. 安装 3. Eclipse 的一些基本设置 4. Eclipse 常见的问题 1. 下载 Eclipse 下载地址(官网) 1 . 点击上面链接直接进 ...

  2. DPU-PYNQ Ultra96v2安装使用说明

    由于不能直接上传word文档,本文档中大量的图片我没有时间上传,待有空时再补图片,请谅解! DPU-PYNQ Ultra96v2安装使用说明 目 录 预备知识 3 Execution Model 3 ...

  3. 川崎机器人总线通信_川崎机器人 | EtherNet/IP安装使用说明

    川崎机器人 | EtherNet/IP安装使用说明 注:本文章文字.图片部分来自网络 版权归原作者,侵删. 您是否对将工业自动化集成到您的设施中感兴趣?如果是这样,那么您应该致电工业自动化和集成领域的 ...

  4. 智慧灯杆的单灯控制器安装使用说明

    在智慧路灯杆的功能中,单灯控制器实施方便,实用性强,应用灵活,在各种智慧路灯杆应用中被广泛采纳.本文简述智慧灯杆的单灯控制器安装使用说明. 本款单灯控制器主要应用于智慧灯杆.智慧路灯杆.多功能杆或者客 ...

  5. pdo sqlite_ sqlite2 pdo_mysql_PHP数据库连接篇,PDO连接sqlite数据库,Sqlite安装使用说明!(PHP+Sqlite2和PHP+Sqlite3)...

    PHP+Sqlite2和PHP+Sqlite3 PHP数据库连接篇,PDO连接sqlite数据库,Sqlite安装使用说明! SQLite是一种轻量级的关系型数据库,可以内嵌在我们的应用程序中一起发布 ...

  6. snmp-exporter安装使用说明

    snmp-exporter安装使用说明 前置环境 安装go 安装snmp_exporter generate 安装mibs库 使用方法 测试运行 前置环境 yum install gcc gcc-g+ ...

  7. Homebrew 安装使用说明

    Homebrew 安装使用说明 前言 安装 macOS安装要求 安装脚本 更新homebrew 源地址管理 前言 什么是 Homebrew,它能做什么? 官网给出的答案是 The Missing Pa ...

  8. 沉浸式翻译安装使用说明

    沉浸式翻译安装使用说明 简介 智能识别网页主内容区进行翻译,与同类插件翻译整个网页不同,降低对原网页的"侵入性",提升阅读体验,因此得名"沉浸式翻译". 双语显 ...

  9. Jupyter安装使用说明

    文章目录 Jupyter安装使用说明 1.安装与启动Jupyter Notebook 2.内核创建和配置 2.1创建新环境 2.2jupyter切换python内核 3基本操作 3.1设置Jupyte ...

最新文章

  1. python采用Basemap绘制完美中国地图(包括绘制边界框,随机点等)
  2. 东北师大计算机考研报名人数,东北师范大学考研难吗?一般要什么水平才可以进入?...
  3. css-阴影和超链接伪类
  4. 关于EFCore线程内唯一
  5. 从页面底部向上弹出dialog,消失时逐渐向下(转)
  6. 人工智能目标检测模型总结(二)——目标检测two-stage模型汇总
  7. 导出无法正常启动的VMware虚拟机中的文件
  8. 如何使用 AirPlay 在 Mac 上使用 HomePod?
  9. shell脚本如何显示所执行的每一条命令
  10. LINUX创建桌面运行快捷方式
  11. winform窗体在桌面右下角显示(任务栏上方)
  12. 印刷文字的字体与字号规定
  13. word文档中英文行间距不一样怎么解决
  14. 批量添加时id使用mybatisplus的id生成策略
  15. mysql pdo教程_(唯一合适) PDO 教程
  16. 广义表的概念及其存储结构
  17. 捣鼓PlantUML(一、环境)
  18. 爬虫四步曲大神一步一步来教你,使用python抓取网页数据并储存
  19. p2p技术分类与发展方向
  20. Vultr 怎么修改 Root 账户密码

热门文章

  1. 用力和应变片计算弹性模量_材料弹性模量及泊松比测试实验教案.
  2. 最好的五款骨传导耳机推荐,双十一必入骨传导蓝牙耳机
  3. 使用github-profile-readme-generator美化你的README
  4. SVD分解的推导,理解SVD分解及矩阵奇异值的几何意义
  5. 电销行业竞争与日俱增,西安外呼系统如何改善?
  6. 《图解TCP/IP》阅读笔记(第九章)—— 网络安全相关
  7. js给label赋值功能
  8. 【剑指 Offer_15】二进制中1的个数_PythonJava_逐位相与解法
  9. vim 显示和隐藏行号
  10. python pyplot的plot( )函数