記一次kafka數據丟失問題的排查

2019獨角獸企業重金招聘Python工程師標準>>> hot3.png

數據丟失為大事,針對數據丟失的問題我們排查結果如下。
第一:是否存在數據丟失的問題?
??? 存在,且已重現。

第二:是在什么地方丟失的數據,是否是YDB的問題?
??? 數據丟失是在導入階段,數據并沒有寫入到Kafka里面,所以YDB也就不會從Kafka里面消費到缺失的數據,數據丟失與延云YDB無關。

第三:是如何發現有數據丟失?
??? 1.測試數據會一共創建365個分區,每個分區均是9億數據,如果最終每個分區還是9億(多一條少一條均不行),則數據完整。
??? 2.測試開始第二天,開始有丟失數據的現象,且丟失的數據越來越多。

第四:如何定位到是寫入端丟失數據的,而不是YDB消費丟失數據的?
??? kafka支持數據的重新回放的功能(換個消費group),我們清空了ydb的所有數據,重新用kafka回放了原先的數據。
??? 如果是在ydb消費端丟失數據,那么第二遍回放數據的結果,跟第一次消費的數據在條數上肯定會有區別,完全一模一樣的幾率很低。
??? 數據回放結果為:與第一次回放結果完全一樣,可以確認為寫入段丟失。

第五:寫入kafka數據為什么會丟失?
??? 導入數據我們采用的為kafka給的官方的默認示例,官方默認并沒有處理網絡負載很高或者磁盤很忙寫入失敗的情況(網上遇到同類問題的也很多)
?? ?一旦網絡中斷或者磁盤負載很高導致的寫入失敗,并沒有自動重試重發消息。
??? 而我們之前的測試,
??? 第1次測試是在共享集群環境上做的測試,由于有其他任務的影響,網絡與負載很不穩定,就會導致數據丟失。
??? 第2次測試是在獨立集群,并沒有其他任務干預,但是我們導入程序與kafka不在一臺機器上,而我們又沒有做限速處理(每小時導入5億條數據)
??? 千兆網卡的流量常態在600~800M左右,如果此時突然又索引合并,瞬間的網絡跑滿是很正常的,丟包也是很正常的。
??? 延云之前持續壓了20多天,確實一條數據沒有丟失,究其原因是導入程序與kafka在同一個機器上,且啟用了限速。

第六:這個問題如何解決?
??? 官方給出的默認示例并不可靠,并沒有考慮到網絡繁忙的情況,并不適合生產。
?? ?故kafka一定要配置上消息重試的機制,并且重試的時間間隔一定要長一些,默認1秒鐘并不符合生產環境(網絡中斷時間有可能超過1秒)。
?? ?延云認為,增加如下參數會較大幅度的減少kafka寫入數據照成的數據丟失,在公司實測,目前還沒遇到數據丟失的情況。
?? ??? ? props.put("compression.type", "gzip");
?? ??? ? props.put("linger.ms", "50");
?? ??? ? props.put("acks", "all");
?? ??? ? props.put("retries ", 30);
?? ??? ? props.put("reconnect.backoff.ms ", 20000);
?? ??? ? props.put("retry.backoff.ms", 20000);

轉載于:https://my.oschina.net/ifraincoat/blog/1617787

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278471.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278471.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278471.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Maximum upload size exceede上傳文件大小超出解決

在這里記錄三種方法, 努力提高自己的姿勢水平 application.yml配置spring:servlet:multipart:enabled: truemax-file-size: 10MB #單個文件最大大小max-request-size: 1024MB #上傳數據總大小 application.properties配置spring.servlet.multipart.max-file-size10Mb #單個文件…

ipad iphone開發_如何在iPhone或iPad上更改應用程序的語言

ipad iphone開發BigTunaOnline/Shutterstock.comBigTunaOnline / Shutterstock.comApple’s iOS 13 makes the iPhone and iPad multilingual. Now, you can change the language of an individual app without changing your primary system language. Each app can have its …

Docker最全教程——從理論到實戰(七)

Docker最全教程——從理論到實戰(七) 原文:Docker最全教程——從理論到實戰(七)在本系列教程中,筆者希望將必要的知識點圍繞理論、流程(工作流程)、方法、實踐來進行講解,而不是單純…

Bash Cookbook 學習筆記 【中級】

Read Me 本文是以英文版<bash cookbook> 為基礎整理的筆記&#xff0c;力求脫水2018.01.21 更新完【中級】。內容包括工具、函數、中斷及時間處理等進階主題。本系列其他兩篇&#xff0c;與之互為參考 【基礎】內容涵蓋bash語法等知識點。傳送門【高級】內容涉及腳本安全…

設置Windows 10時如何創建本地帳戶

Windows 10 tries its hardest to make you use a Microsoft account. The option was already hidden, but now it’s not even offered on Windows 10 Home while you’re connected to the internet. Here’s how to create a local account anyway. Windows 10盡最大努力使…

HSQL

Hive的數據存儲  1、Hive中所有的數據都存儲在 HDFS 中&#xff0c;沒有專門的數據存儲格式&#xff08;可支持Text&#xff0c;SequenceFile&#xff0c;ParquetFile&#xff0c;RCFILE等&#xff09;  2、只需要在創建表的時候告訴 Hive 數據中的列分隔符和行分隔符&…

在PowerPoint 2010中將鼠標用作激光筆

Have you ever wished you had a laser pointer to focus attention on a key point in a PowerPoint slideshow? Today, we’ll take a look at how can use use your mouse as a laser pointer in PowerPoint 2010. 您是否曾經希望激光指示器能將注意力集中在PowerPoint幻燈…

Java 8 并發: 原子變量和 ConcurrentMap

原文地址: Java 8 Concurrency Tutorial: Atomic Variables and ConcurrentMap AtomicInteger java.concurrent.atomic 包下有很多原子操作的類。 在有些情況下&#xff0c;原子操作可以在不使用 synchronized 關鍵字和鎖的情況下解決多線程安全問題。 在內部&#xff0c;原子類…

this表示當前對象簡單實例

直接上代碼 class Message { private Channel channel ; // 保存消息發送通道 private String title ; // 消息標題 private String content ; // 消息內容 // 4、調用此構造實例化&#xff0c;此時的channel 主類ch public Message(Channel channel,String title,String cont…

twitter推文不收錄_如何使用Twitter書簽保存推文供以后使用

twitter推文不收錄Khamosh PathakKhamosh PathakTwitter has a new Bookmarks feature that lets you privately save tweets for later. If you’ve been using the Like feature as a workaround for saving tweets, here’s why you should start bookmarking. Twitter具有一…

if的作用域問題 *輸出1~6的隨機數*

1 //測試if語句2 public class TestIf {3 public static void main(String[] args){4 double d Math.random();//0~1之間的小數5 int e (int)(d*5); //[0,4]6 //int f 1(int)(d*6); //[1,6] 擲色子7 System.out.println(e);8 …

為您的Blogger博客設計一個美麗的新主題

Would you like to give your Blogger blog a fresh coat of paint with a new theme? Here’s how you can use the new Template Designer to make your Blogger site stand out from the crowd and look great. 您想給Blogger博客一個新的主題嗎&#xff1f; 您可以通過以…

Lab 6-4

In this lab, we’ll analyze the malware found in the file Lab06-04.exe. Questions and Short Answers What is the difference between the calls made from the main method in Labs 6-3 and 6-4? A: The function at 0x401000 is the check Internet connection method…

步入三十歲前的總結:看似經歷很多得到很多,但,實際卻一無所得

本文算是一篇審視自己的文章吧&#xff0c;感覺跟我類似經歷的人應該很多&#xff0c;認同感應該也大一些。我是12年網絡專業很普通的一所大專院校畢業&#xff0c;到現在為止工作已經超過五年。這五年里&#xff0c;做過運維工程師&#xff0c;也在小車床工作間里做了一下技工…

vue---day03

1. Vue的生命周期 - 創建和銷毀的時候可以做一些我們自己的事情 - beforeCreated - created - beforeMount - mounted - beforeUpdate - updated - activated - deactivated - beforeDestroy - destroyed 1.1 知識點回顧 1.1.1 be…

U Sparkle 開發者計劃招募中!

向我們投稿吧 在此之前&#xff0c;我們有收到過幾篇民間高手的投稿&#xff0c;如&#xff1a; USequencer 初識&#xff08;作者&#xff1a;焱燚(七火)&#xff09; Unity游戲界面解決方案: PSD For UGUI&#xff08;作者&#xff1a;張俊欽&#xff09; UGUI 降低填充率技巧…

階乘和 大整數

///大整數階乘的和 #include<bits/stdc.h> using namespace std; int main() {int n;while(cin>>n){int a[2000] {1},b[2000] {0}; //存放結果的數組a。int c; //b用于存放每位存放的結果。int r0; //r用來表示進位的數。int h1,hb1; //h用來表示運算過程中 結果a…

如何添加引文標_如何在Google文檔中查找和添加引文

如何添加引文標When writing papers, you need to generate a detailed and accurate list of all the sources you’ve cited in your paper. With Google Docs, you can easily find and then add citations to all of your research papers. 撰寫論文時&#xff0c;您需要生…

mongo ttl索引

db.log_events.find() # 查找log_events里的所有數據db.log_events.createIndex( { "LogDT": 1 }, { expireAfterSeconds: 3600 } ) #設置log_events里的TTL過期索引清理時間為3600秒db.runComman…

Linux Centos下SQL Server 2017安裝和配置

Linux Centos下SQL Server 2017安裝和配置 原文:Linux Centos下SQL Server 2017安裝和配置我們知道在Linux下安裝服務有很多方式&#xff0c;最為簡單的也就是yum安裝&#xff0c;但是很多服務通過yum是無法安裝的&#xff0c;如果想使用yum安裝&#xff0c;需要指定yum安裝倉庫…