01 2021 档案

摘要:准备:请按照下面的连接安装ck的集群 https://www.cnblogs.com/ywjfx/p/14329605.html # final关键字查询最新数据,不会merge,勉强实现了at least once 保证了数据的一致性 select * from user final ; 建表语句 阅读全文
posted @ 2021-01-27 11:14 小白啊小白,Fighting 阅读(5166) 评论(3) 推荐(0) 编辑
摘要:主要分为两大步骤:1、zookeeper安装;2、ck集群配置 一、zookeeper安装 1、安装包下载 https://www.apache.org/dyn/closer.lua/zookeeper/zookeeper-3.6.1/apache-zookeeper-3.6.1-bin.tar.g 阅读全文
posted @ 2021-01-26 12:02 小白啊小白,Fighting 阅读(2014) 评论(0) 推荐(0) 编辑
摘要:1、视图 a) 普通视图:不会存储数据 b) 物化视图:1、储存数据;2、有引擎,在磁盘存储;3、同步映射表数据 2、表引擎Log系列 4.1 TinyLog 1、最简单的引擎 2、没有索引,没有标记块 3、写是追加写 4、数据以列字段文件存储 5、不允许同时读写 4.2 StripeLog 1、d 阅读全文
posted @ 2021-01-25 13:48 小白啊小白,Fighting 阅读(4543) 评论(0) 推荐(0) 编辑
摘要:1、基本命令 select bar(number,0,4) from numbers(4); select now(); 数据导入:cat t.tsv| clickhouse-client --query "insert into t from tsv" 数据导出:clickhouse-client 阅读全文
posted @ 2021-01-22 18:11 小白啊小白,Fighting 阅读(2255) 评论(0) 推荐(0) 编辑
摘要:方式一 mysql表数据导入: CREATE TABLE ck_chat ENGINE = MergeTree ORDER BY id AS SELECT * FROM mysql('localhost:3306', 'test', 'chat', 'root', 'yang156'); 其中 ck 阅读全文
posted @ 2021-01-22 17:49 小白啊小白,Fighting 阅读(2697) 评论(0) 推荐(0) 编辑
摘要:参考博客: https://vkingnew.blog.csdn.net/article/details/106988324 1、MergeTree:它拥有主键,但是它的主键却没有唯一键的约束,即可以写入重复数据 1.1 场景 MergeTree用于存储全量的明细数据,对外提供实时查询 1.2 特性 阅读全文
posted @ 2021-01-22 17:05 小白啊小白,Fighting 阅读(1953) 评论(0) 推荐(0) 编辑
摘要:注意 1、python脚本一定要注意空格,否则这种报错无法做出判断 2、脚本魔法 请根据自己python的路径填写 1、脚本代码 #! /root/anaconda3/bin/python import pymysql import datetime #参数值插入时间 #连接数据库 db = pym 阅读全文
posted @ 2021-01-21 14:12 小白啊小白,Fighting 阅读(318) 评论(0) 推荐(0) 编辑
摘要:知识点(OLAP特征): OLAP场景的关键特征 : 绝大多数是读请求 数据以相当大的批次(> 1000行)更新,而不是单行更新;或者根本没有更新。 已添加到数据库的数据不能修改。 对于读取,从数据库中提取相当多的行,但只提取列的一小部分。 宽表,即每个表包含着大量的列 查询相对较少(通常每台服务器 阅读全文
posted @ 2021-01-20 22:08 小白啊小白,Fighting 阅读(3122) 评论(0) 推荐(0) 编辑
摘要:环境:Flink0.10.1 scala2.11 如果报一下的错,请把对应的pom.xml文件进行修改。具体的可以看下下面的pom.xml文件的配置 Exception in thread "main" org.apache.flink.table.api.TableException: findA 阅读全文
posted @ 2021-01-20 17:00 小白啊小白,Fighting 阅读(2354) 评论(0) 推荐(0) 编辑
摘要:知识点 1、在大多数情况下,用户定义的函数必须先注册,然后才能在查询中使用。不需要专门为 Scala 的 Table API 注册函数。 2、函数通过调用 registerFunction()方法在 TableEnvironment 中注册。当用户定义的函数 被注册时,它被插入到 TableEnvi 阅读全文
posted @ 2021-01-16 22:46 小白啊小白,Fighting 阅读(2719) 评论(0) 推荐(0) 编辑
摘要:1、时间特性 基于时间的操作(比如 Table API 和 SQL 中窗口操作),需要定义相关的时间语义和时间 数据来源的信息。 所以,Table 可以提供一个逻辑上的时间字段,用于在表处理程序中,指示时间和访问相应的时间戳。 时间属性,可以是每个表 schema 的一部分。一旦定义了时间属性,它就 阅读全文
posted @ 2021-01-14 23:44 小白啊小白,Fighting 阅读(2389) 评论(0) 推荐(0) 编辑
摘要:知识点 表的输出,是通过将数据写入 TableSink 来实现的。TableSink 是一个通用接口,可以 支持不同的文件格式、存储数据库和消息队列。 具体实现,输出表最直接的方法,就是通过 Table.insertInto() 方法将一个 Table 写入 注册过的 TableSink 中。同时表 阅读全文
posted @ 2021-01-14 19:30 小白啊小白,Fighting 阅读(1572) 评论(0) 推荐(0) 编辑
摘要:参考博客:https://www.cnblogs.com/bolingcavalry/p/13993021.html#4800352 注: 对应的sql_lib依赖jar,在参考博客的留言下面有 1、运行f'link sql 1、首先进入flink目录,启动flink:bin/start-clust 阅读全文
posted @ 2021-01-14 12:05 小白啊小白,Fighting 阅读(1072) 评论(0) 推荐(0) 编辑
摘要:知识点 状态一致性分类: https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/connectors/guarantees.html • AT-MOST-ONCE(最多一次):当任务故障时,最简单的做法是什么都不干,既不恢复 阅读全文
posted @ 2021-01-12 23:13 小白啊小白,Fighting 阅读(208) 评论(0) 推荐(0) 编辑
摘要:知识点 FlinkTable步骤: // 1、创建表的执行环境 val tableEnv = ... // 2、创建一张表,用于读取数据 tableEnv.connect(...).createTemporaryTable("inputTable") // 3、1通过 Table API 查询算子, 阅读全文
posted @ 2021-01-12 23:10 小白啊小白,Fighting 阅读(2017) 评论(0) 推荐(0) 编辑
摘要:知识点 Table API 和 SQL 的程序结构,与流式处理的程序结构类似;也可以近似地认为有这么 几步:首先创建执行环境,然后定义 source、transform 和 sink。 1、依赖:Table API 和 SQL 需要引入的依赖 <!-- old planner flink table 阅读全文
posted @ 2021-01-12 23:02 小白啊小白,Fighting 阅读(1915) 评论(0) 推荐(0) 编辑
摘要:1、代码案例 package window import com.yangwj.api.SensorReading import org.apache.flink.streaming.api.TimeCharacteristic import org.apache.flink.streaming.a 阅读全文
posted @ 2021-01-11 23:24 小白啊小白,Fighting 阅读(160) 评论(0) 推荐(0) 编辑
摘要:1、代码案例 package processFunction import com.yangwj.api.SensorReading import org.apache.flink.streaming.api.functions.{ProcessFunction} import org.apache 阅读全文
posted @ 2021-01-11 23:19 小白啊小白,Fighting 阅读(953) 评论(0) 推荐(0) 编辑
摘要:知识点: 1、Flink 提供了 8 个 Process Function: ProcessFunction KeyedProcessFunction CoProcessFunction ProcessJoinFunction BroadcastProcessFunction KeyedBroadc 阅读全文
posted @ 2021-01-11 23:17 小白啊小白,Fighting 阅读(518) 评论(0) 推荐(0) 编辑
摘要:知识点: https://github.com/ververica/flink-cdc-connectors //官网地址https://blog.csdn.net/u012551524/article/details/108985945 1、依赖 <dependency> <groupId>org 阅读全文
posted @ 2021-01-11 18:51 小白啊小白,Fighting 阅读(6096) 评论(2) 推荐(0) 编辑
摘要:1、工具类 package com.hushuo.cdh.phoenix; import org.springframework.stereotype.Component; import java.sql.*; /** * @program: hushuo-cdh * @description: p 阅读全文
posted @ 2021-01-11 17:34 小白啊小白,Fighting 阅读(453) 评论(0) 推荐(0) 编辑
摘要:1、tar命令打包 tar -cvf package.tar.gz --exclude=logs bin/ conf/ lib/ 2、查找目录下所有文件内容包含的字段 find ./ -type f | xargs grep -ri "2181" 3、删除目录下所有文件以.log结尾的文件 find 阅读全文
posted @ 2021-01-11 14:59 小白啊小白,Fighting 阅读(83) 评论(0) 推荐(0) 编辑
摘要:关窗时间 情况1:如果存在lateness延迟关窗设置,则 关窗时间:最后一条数据event_time - watermark时间 - lateness时间 窗口开始计算时间: 当时数据event_time - watermark时间 如:latenes:为10分钟;窗口设置为:10分钟,步长为5; 阅读全文
posted @ 2021-01-09 10:49 小白啊小白,Fighting 阅读(406) 评论(0) 推荐(0) 编辑
摘要:提醒: 1、连接kafka,一定要注意依赖版本,否则即使程序启动没有报错,也不会接受到数据 2、kafka依赖除了Flink和kafka的,建议加上kafka-client的依赖,对应版本也需一致 1、连接es,需要使用flink-connector-elasticsearch6_2.11、elas 阅读全文
posted @ 2021-01-06 23:08 小白啊小白,Fighting 阅读(1297) 评论(0) 推荐(0) 编辑
摘要:1、deployer基本不需要改动,只需要修改你需要同步的数据库的库表,例如: canal.instance.filter.regex=test.user 2、adapter中的application.yml配置 server: port: 8083 #可以自己修改监听端口 spring: jack 阅读全文
posted @ 2021-01-06 12:12 小白啊小白,Fighting 阅读(1246) 评论(2) 推荐(0) 编辑
摘要:1、数据格式 sensor_1,1547718199,35.8 sensor_6,1547718201,15.4 sensor_7,1547718202,6.7 sensor_10,1547718205,38.1 sensor_1,1547718206,32 sensor_1,1547718208, 阅读全文
posted @ 2021-01-05 21:19 小白啊小白,Fighting 阅读(515) 评论(0) 推荐(0) 编辑
摘要:1、数据格式 83.149.9.123 - - 17/05/2020:10:05:03 +0000 GET /presentations/logstash-kafkamonitor-2020/images/kibana-search.png 83.149.9.123 - - 17/05/2020:1 阅读全文
posted @ 2021-01-05 11:49 小白啊小白,Fighting 阅读(247) 评论(0) 推荐(0) 编辑
摘要:1、数据格式 543462,1715,北京,北京,1511658000 662867,2244074,广东,广州,1511658060 561558,3611281,广东,深圳,1511658120 894923,1715,北京,北京,1511658180 834377,2244074,上海,上海, 阅读全文
posted @ 2021-01-05 11:47 小白啊小白,Fighting 阅读(251) 评论(0) 推荐(0) 编辑
摘要:1、数据格式 1021615,4355712,15138396,P,1601688552,913d5742-0fd8-46db-bb26-8cf0d09d90da 2178695,12498888,2595117,P,1601688552,3d29d1e2-d514-4991-bd79-9a866a 阅读全文
posted @ 2021-01-05 11:44 小白啊小白,Fighting 阅读(1412) 评论(0) 推荐(0) 编辑
摘要:1、数据格式 1021615,4355712,15138396,P,1601688552,913d5742-0fd8-46db-bb26-8cf0d09d90da 2178695,12498888,2595117,P,1601688552,3d29d1e2-d514-4991-bd79-9a866a 阅读全文
posted @ 2021-01-05 11:43 小白啊小白,Fighting 阅读(3037) 评论(0) 推荐(0) 编辑
摘要:大数据处理中,用去去重,布隆过滤器十分常见 1、代码 // 定义一个布隆过滤器 class Bloom(size: Long) extends Serializable { //布隆过滤器的默认大小是32M //32 * 1024 * 1024 * 8 //2^5 2^10 2^10 * 2^3 / 阅读全文
posted @ 2021-01-05 11:34 小白啊小白,Fighting 阅读(1316) 评论(0) 推荐(0) 编辑
摘要:1、主类 package towStream /** * @program: demo * @description: ${description} * @author: yang * @create: 2020-12-31 11:39 */ import org.apache.flink.api. 阅读全文
posted @ 2021-01-04 18:54 小白啊小白,Fighting 阅读(174) 评论(0) 推荐(0) 编辑
摘要:1、主类 package towStream /** * @program: demo * @description: ${description} * @author: yang * @create: 2020-12-31 11:39 */ import org.apache.flink.api. 阅读全文
posted @ 2021-01-04 18:52 小白啊小白,Fighting 阅读(152) 评论(0) 推荐(0) 编辑
摘要:1、主类 package towStream /** * @program: demo * @description: ${description} * @author: yang * @create: 2020-12-31 11:39 */ import org.apache.flink.api. 阅读全文
posted @ 2021-01-04 11:50 小白啊小白,Fighting 阅读(446) 评论(0) 推荐(0) 编辑
摘要:知识点: 如果同一批流中有多个相同的id,Flink的双流Join是左连接形式 参考博客: https://blog.csdn.net/dafei1288/article/details/98919202 https://cloud.tencent.com/developer/article/159 阅读全文
posted @ 2021-01-04 11:26 小白啊小白,Fighting 阅读(772) 评论(0) 推荐(0) 编辑
摘要:知识点: 一致性:https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/connectors/guarantees.html env.setStateBackend( new FsStateBackend("hdfs://u 阅读全文
posted @ 2021-01-04 10:48 小白啊小白,Fighting 阅读(976) 评论(0) 推荐(0) 编辑
摘要:知识点: Flink 为算子状态(operator state)提供三种基本数据结构:  列表状态(List state): 将状态表示为一组数据的列表。  联合列表状态(Union list state): 也将状态表示为数据的列表。它与常规列表状态的区别在于,在发生故障时,或者从保 存点(s 阅读全文
posted @ 2021-01-04 10:47 小白啊小白,Fighting 阅读(2112) 评论(0) 推荐(0) 编辑
摘要:1、主类 package com.example.demo.flink; import com.example.demo.flink.impl.CountAverageWithAggregateState; import com.example.demo.flink.impl.CountAverag 阅读全文
posted @ 2021-01-04 10:45 小白啊小白,Fighting 阅读(880) 评论(0) 推荐(0) 编辑
摘要:1、主类 package com.example.demo.flink; import com.example.demo.flink.impl.CountAverageWithMapState; import com.example.demo.flink.impl.CountAverageWithR 阅读全文
posted @ 2021-01-04 10:43 小白啊小白,Fighting 阅读(1022) 评论(0) 推荐(0) 编辑
摘要:1、主类 package com.example.demo.flink; import com.example.demo.flink.impl.CountAverageWithMapState; import com.example.demo.flink.impl.CountAverageWithV 阅读全文
posted @ 2021-01-04 10:41 小白啊小白,Fighting 阅读(6819) 评论(0) 推荐(0) 编辑
摘要:1、主类 package com.example.demo.flink; import com.example.demo.flink.impl.CountAverageWithListState; import com.example.demo.flink.impl.CountAverageWith 阅读全文
posted @ 2021-01-04 10:39 小白啊小白,Fighting 阅读(937) 评论(0) 推荐(0) 编辑
摘要:1、主类 package com.example.demo.flink; import com.example.demo.flink.impl.CountAverageWithValueState; import org.apache.flink.api.common.functions.FlatM 阅读全文
posted @ 2021-01-04 10:38 小白啊小白,Fighting 阅读(324) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示