当前位置:网站首页>Flink 1.15 implements SQL script to recover data from savepointh
Flink 1.15 implements SQL script to recover data from savepointh
2022-07-27 00:55:00 【One day long -- xuanbin】
flinksql Interface creation table , And write the data to , Reference resources :Flink 1.15 Local cluster deployment Standalone Pattern ( Independent cluster mode )_ One day long -- Hyun Bin's blog -CSDN Blog


After creating the table, execute the following command to automatically create flink job:
INSERT INTO `all_users_sink`(id,user_name,address,phone_number,email,ct_date)
SELECT id,user_name,address,phone_number,email,ct_date FROM user_source;
see job Task list :
./flink-1.15.0/bin/flink list

preservation savepoint
./bin/flink savepoint :jobId [:targetDirectory] -- jobid and savepoint Keep the file directory
./bin/flink savepoint c8fa5a96073d064b0a717590a7029c0d file:///usr/local/flink-1.15.0/flink-savepoints
from savepoint/checkPoint recovery
RESET execution.savepoint.path; -- Reset point Save the path
SET execution.savepoint.path = 'file:///usr/local/flink-1.15.0/flink-savepoints/savepoint-c8fa5a-1161f2626294'; -- Set recovery path

Execute the following command to recover ( Must and create job At the time of the sql Command consistent )
INSERT INTO `all_users_sink`(id,user_name,address,phone_number,email,ct_date)
SELECT id,user_name,address,phone_number,email,ct_date FROM user_source;
If there are any errors reported below ( You can use the following command to ignore the error ):

set 'execution.savepoint.ignore-unclaimed-state' = 'true'; -- Allow skipping savepoint states that cannot be restored
After success, the interface displays :

Cancel the task :
./flink-1.15.0/bin/flink cancel $JOB_ID
./flink-1.15.0/bin/flink cancel c8fa5a96073d064b0a717590a7029c0d
Delete savepoint :
./bin/flink savepoint --dispose Hold point directory $JOB_ID
./bin/flink savepoint --dispose /usr/local/flink-1.15.0/flink-savepoints/savepoint-c8fa5a-1161f2626294 c8fa5a96073d064b0a717590a7029c0d
Stop the job gracefully and create a savepoint :
./bin/flink stop --savepointPath /tmp/flink-savepoints $JOB_ID
./bin/flink stop --savepointPath /usr/local/flink-1.15.0/flink-savepoints 74e0eddfa18eb39c403617f1d573cfdd
flink sql Refer to official documents for commands :SQL Client | Apache Flink
flink adopt jar The job created by the package is restored , Start the job from the savepoint :
Refer to official documentation :Checkpoints | Apache Flink
./bin/flink run --detached --fromSavepoint /usr/local/flink-1.15.0/flink-savepoints/savepoint-74e0ed-e3e4e431bd5d ./examples/streaming/StateMachineExample.jar
边栏推荐
猜你喜欢

Flink1.11 intervalJoin watermark生成,状态清理机制源码理解&Demo分析
![[CISCN2019 华北赛区 Day1 Web5]CyberPunk](/img/84/b186adc8becfc9b3def7dfd8e4cd41.png)
[CISCN2019 华北赛区 Day1 Web5]CyberPunk

Flink的容错机制(checkpoint)

Flink 1.15本地集群部署Standalone模式(独立集群模式)
![[HITCON 2017]SSRFme](/img/ed/4b396e5685bfe025eb96e34a8bd6a3.png)
[HITCON 2017]SSRFme

Use csrftester to automatically detect CSRF vulnerabilities

基于Flink实时计算Demo:用户行为分析(四:在一段时间内到底有多少不同的用户访问了网站(UV))

Flink Interval Join源码理解
![[By Pass] WAF 的绕过方式](/img/dd/7204b2401a9f18c02c8b9897258905.png)
[By Pass] WAF 的绕过方式
![[hongminggu CTF 2021] write_ shell](/img/f5/c3a771ab7b40311e37a056defcbd78.png)
[hongminggu CTF 2021] write_ shell
随机推荐
基于Flink实时项目:用户行为分析(三:网站总浏览量统计(PV))
JSCORE day_03(7.4)
Golang implements AES with five encryption mode functions, encrypt encryption and decryption string output
2022.7.13
Learn json.stringify again
flinksql 窗口提前触发
[HFCTF2020]EasyLogin
6_ Gradient descent method
分区的使用及案例
基于Flink实时计算Demo—关于用户行为的数据分析
[NCTF2019]SQLi
2022.7.9DAY601
Ansible MySQL installation case record
Two methods of automated testing XSS vulnerabilities using burpsuite
[interview: concurrent Article 16: multithreading: detailed explanation of wait/notify] principle and wrong usage (false wake-up, etc.)
Essay - I say you are so cute
[By Pass] WAF 的绕过方式
[CTF 真题] 2018-网鼎杯-Web-Unfinish
数据库表连接的简单解释
Canal 安装