和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

算法flink的更多相关文章

  1. (二)基于商品属性的相似商品推荐算法——Flink SQL实时计算实现商品的隐式评分

    系列随笔: (总览)基于商品属性的相似商品推荐算法 (一)基于商品属性的相似商品推荐算法--整体框架及处理流程 (二)基于商品属性的相似商品推荐算法--Flink SQL实时计算实现商品的隐式评分 ( ...

  2. Peeking into Apache Flink's Engine Room

    http://flink.apache.org/news/2015/03/13/peeking-into-Apache-Flinks-Engine-Room.html   Join Processin ...

  3. Apache Flink vs Apache Spark——感觉二者是互相抄袭啊 看谁的好就抄过来 Flink支持在runtime中的有环数据流,这样表示机器学习算法更有效而且更有效率

    Apache Flink是什么 Flink是一款新的大数据处理引擎,目标是统一不同来源的数据处理.这个目标看起来和Spark和类似.没错,Flink也在尝试解决 Spark在解决的问题.这两套系统都在 ...

  4. flink Transitive Closure算法,实现寻找新的可达路径

    flink 使用Transitive Closure算法实现可达路径查找. 1.Transitive Closure是翻译闭包传递?我觉得直译不准确,意译应该是传递特性直至特性关闭,也符合本例中传递路 ...

  5. flink 实现ConnectedComponents 连通分量,增量迭代算法(Delta Iteration)实现详解

    1.连通分量是什么? 首先需要了解什么是连通图.无向连通图.极大连通子图等概念,这些概念都来自数据结构-图,这里简单介绍一下. 下图是连通图和非连通图,都是无向的,这里不扩展有向图: 连通分量(con ...

  6. flink KMeans算法实现

    更正:之前发的有两个错误. 1.K均值聚类算法 百度解释:k均值聚类算法(k-means clustering algorithm)是一种迭代求解的聚类分析算法,其步骤是随机选取K个对象作为初始的聚类 ...

  7. flink 实现三角枚举EnumTriangles算法详解

    1.三角枚举,从所有无向边对中找到相互连接的三角形 /** * @Author: xu.dm * @Date: 2019/7/4 21:31 * @Description: 三角枚举算法 * 三角枚举 ...

  8. flink PageRank详解(批量迭代的页面排名算法的基本实现)

    1.PageRank算法原理   2.基本数据准备 /** * numPages缺省15个测试页面 * * EDGES表示从一个pageId指向相连的另外一个pageId */ public clas ...

  9. Flink 剖析

    1.概述 在如今数据爆炸的时代,企业的数据量与日俱增,大数据产品层出不穷.今天给大家分享一款产品—— Apache Flink,目前,已是 Apache 顶级项目之一.那么,接下来,笔者为大家介绍Fl ...

随机推荐

  1. 03 JavaScript的使用

    01 注册界面的校验 <!-- 作者:offline 时间:2018-09-05 描述:通常在CSS中使用类选择器,在JS中使用id选择器,两者区分开. 在页面跳转时要先把要跳转的页面用浏览器打 ...

  2. java8 time计算时间差

    最近使用Java8编写代码时,需要计算时间差,现整理如下 前言 本次使用了Java8提供的ChronoUnit工具类,它主要提供以下几种时间维度 枚举 枚举 说明 NANOS 毫微秒(毫秒的10000 ...

  3. 查看PublicKeyToken和生成PublicKeyToken

    http://hi.baidu.com/honfei/item/7777500b20d8ff8a02ce1bd2

  4. BZOJ 1706: [usaco2007 Nov]relays 奶牛接力跑 倍增Floyd

    题不难,但是一开始把读入看错了,调了半天qaq~ Code: #include <bits/stdc++.h> #define N 300 #define setIO(s) freopen ...

  5. [SDOI2006]最短距离

    洛谷题目链接 声明: 本篇文章只大概讲思路 原串设为$s1$,目标串设为$s2$,$n1,n2$分别为他们的长度 我们考虑$dp$,设$f[i][j]$表示$s1$中删除到了第$i$个字符,$s2$中 ...

  6. 51 Nod 1070 Bash游戏v4(斐波那契博弈)

    这题的证明看不太懂,日后再重做... 1070 Bash游戏 V4  基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题  收藏  关注 有一堆石子共有N个.A B两个 ...

  7. 7.20T1

    排序(sort) [问题描述] 有 n 个人依次站在小 A 面前.小 A 会依次对这 n 个人进行 m 次操作. 每次操作选择一个位置 k,将这 n 个人中的所有身高小于等于当前 k 位置的 人的身高 ...

  8. Codeforces 1051 D.Bicolorings(DP)

    Codeforces 1051 D.Bicolorings 题意:一个2×n的方格纸,用黑白给格子涂色,要求分出k个连通块,求方案数. 思路:用0,1表示黑白,则第i列可以涂00,01,10,11,( ...

  9. HDU 3394 Railway —— (点双联通,记录块信息)

    这题是比较模板的找点双联通并记录的题目. 题意大概是:一个公园有n个景点,1.所有游客都是绕环旅游的,找出所有不在环内的路的条数:2.如果两个环中有重复的边,那么这些边是冲突的,问冲突的边的总数. 分 ...

  10. sklearn——train_test_split 随机划分训练集和测试集

    sklearn——train_test_split 随机划分训练集和测试集 sklearn.model_selection.train_test_split随机划分训练集和测试集 官网文档:http: ...