和Yarn-Cluster模式不同,Session模式的资源在启动Yarn-Session时候就已经启动了,后续提交的作业全都在已申请的资源空间内运行,比较适合小而多的作业

# 启动yarn-session模式,不用启动flink集群

cm:

http://152.32.141.11:7180/cmf/login

登陆manager节点:

sudo su hdfs

yarn application -list

#查flink session的application id

#打开flink的web管理

http://manager.algorithm.opayride.com:8088/proxy/application_1572516566413_0919/#/job

#算法启动session:
/data/flink/bin/yarn-session.sh -n 20 -m 4 -qu flink -jm 1024 -tm 8192 -s 2 -d

-n 多少个容器
tm 每个容器的内存
-s 每个任务用多少slot

#在session上run job
cd /var/lib/hadoop-hdfs/src/oride-research/flink/flink-ufile
flink run -p 4 -c com.opay.research.hadoop.UfileJob target/flink-ufile-1.0.jar --prod

重启session:
1/ 在web管理界面上退出:
点running jobs,点运行的session job进去,把它cancel掉

2/ 用yarn kill application xxx把flink作业kill
3/ 重新启动seesion
/data/flink/bin/yarn-session.sh -n 20 -m 4 -qu flink -jm 1024 -tm 8192 -s 2 -d

参数:

bin/yarn-session.sh –help

Usage:
Required
-n,--container <arg> Number of YARN container to allocate (=Number of Task Managers)
Optional
-D <property=value> use value for given property
-d,--detached If present, runs the job in detached mode
-h,--help Help for the Yarn session CLI.
-id,--applicationId <arg> Attach to running YARN session
-j,--jar <arg> Path to Flink jar file
-jm,--jobManagerMemory <arg> Memory for JobManager Container with optional unit (default: MB)
-m,--jobmanager <arg> Address of the JobManager (master) to which to connect. Use this flag to connect to a different JobManager than the one specified in the configuration.
-n,--container <arg> Number of YARN container to allocate (=Number of Task Managers)
-nl,--nodeLabel <arg> Specify YARN node label for the YARN application
-nm,--name <arg> Set a custom name for the application on YARN
-q,--query Display available YARN resources (memory, cores)
-qu,--queue <arg> Specify YARN queue.
-s,--slots <arg> Number of slots per TaskManager
-sae,--shutdownOnAttachedExit If the job is submitted in attached mode, perform a best-effort cluster shutdown when the CLI is terminated abruptly, e.g., in response to a user interrupt, such
as typing Ctrl + C.
-st,--streaming Start Flink in streaming mode
-t,--ship <arg> Ship files in the specified directory (t for transfer)
-tm,--taskManagerMemory <arg> Memory per TaskManager Container with optional unit (default: MB)
-yd,--yarndetached If present, runs the job in detached mode (deprecated; use non-YARN specific option instead)
-z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode

也可在启动时得到它的web地址

# 启动yarn-session模式,不用启动flink集群
[root@oldboy-node101 conf]# yarn-session.sh
2019-08-03 21:57:59,585 WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Flink JobManager is now running on oldboy-node103:35244 with leader id 00000000-0000-0000-0000-000000000000.
JobManager Web Interface: http://oldboy-node103:35244

最新文章

  1. Android开发学习之路-Android Studio开发小技巧
  2. html年月日下拉联动菜单 年月日三下拉框联动
  3. phpstorm laravel单元测试 配置
  4. Oracle Report : REP-1219
  5. 安卓问题http://blog.csdn.net/xb12369/article/details/50510302
  6. 第十五章(附)分布式缓存-Memcached
  7. 微信小程序在开发中遇到的问题与解决方法
  8. xBIM 基本的模型操作
  9. oracle中新建用户和赋予权限
  10. MyBatis + MySQL返回插入成功后的主键id
  11. Bomb 数位dp
  12. 【算法随记】Canny边缘检测算法实现和优化分析。
  13. HashMap原理分析(JDK1.7.x之前)
  14. QT读文件夹内所有文件名
  15. OpenID 配置步骤
  16. 【设计模式】学习笔记15:代理模式(Proxy Pattern)
  17. day08&lt;面向对象+&gt;
  18. Ext学习系列(1)初识Ext
  19. canvas小球 时间demo
  20. Oracle优化-SQL_TRACE

热门文章

  1. mac使用brew安装mysql报RROR 2002 (HY000): Can&#39;t connect to local MySQL server through socket &#39;/tmp/mysql.sock&#39; (2)
  2. DataTable转List,DataTable转为Model对象帮助类
  3. Win10 + CLion + 树莓派 + QT 远程开发调用Python
  4. Codeforces 55D. Beautiful numbers(数位DP,离散化)
  5. Java基础__Java中自定义集合类
  6. 修改checkbox样式-1
  7. 【平台中间件】为什么用etcd而不用ZooKeeper?从应用场景到实现原理的全方位解读
  8. 巨丑vue
  9. Ubuntu使用PBIS认证
  10. antd源码分析之——标签页(tabs 1.组件结构)