1、綜合技術論壇專場翟佳StreamNative,2021 年 8 1 本期議題:Apache Pulsar-云原的分布式統消息平臺我介紹開源項愛好者:Apache Pulsar PMC成員Apache BookKeeper PMC成員EMC-StreamNative華中科-中科院計算所 架構:Pulsar 的堅實基礎 Apache Pulsar 簡介 Pulsar 的態和社區Apache Pulsar 簡介Apache Pulsar 是什么Apache Pulsar 要解決的問題企業需求和數據規模集群/多租戶-百萬Topics-低延時-持久化-跨地域復制解除存儲計算耦合運維痛點:替換機器、服務擴
2、容、數據 rebalance減少件系統依賴性能難保障:持久化(fsync)、致性(ack:all)、多TopicIO不隔離:消費者讀Backlog的時候會影響其他產者和消費者 架構:Pulsar 的堅實基礎 Apache Pulsar 簡介 Pulsar 的態和社區 架構:Pulsar 的堅實基礎 Apache Pulsar 簡介 Pulsar 的云原架構 企業級流存儲:BookKeeper 基礎之上Pulsar:云原的架構 分層+分 存儲和計算分離節點對等獨擴展靈活擴容快速容錯瞬時存儲擴容應感知數據均勻分布re-balancePulsar:云原的架構優勢 https:/jack- 架構:Pu
3、lsar 的堅實基礎 Apache Pulsar 簡介 Pulsar 的云原架構 企業級流存儲:BookKeeper 基礎之上Apache BookKeeper:企業級流存儲層分布式志/流存儲低延時、吞吐、持久化強致可I/O隔離Apache BookKeeper:誕場景企業級流存儲層(BK):節點對等的架構openLedger(組內節點數,數據備份數,等待刷盤節點數)openLedger(5,3,2)企業級流存儲層(BK):讀寫可性(容錯)企業級流存儲層:穩定的 IO 質量性能、強致性、讀寫隔離、靈活SLA 架構:Pulsar 的堅實基礎 Apache Pulsar 簡介 Pulsar 的云原
4、架構 企業級流存儲:BookKeeper 基礎之上基礎 上層基礎之上:企業級特性:集群、多租戶基礎之上:BookKeeper 對關鍵數據的存儲ProducerTopic1 2 3 4 5 6 7Subscription2Consumer1 2 3 4 5 6 7readEntriesAck/N-AckBrokerBookKeeper1 2 3 4 5 6 7Ledger stores DataA B C D ELedger stores Cursor changesCursorSubscription1Write AckManagedLedger+-/+基礎之上:統消費模型基礎之上:統的消息存
5、儲Apache PulsarPulsar Protocol HandlerPulsar Clients(queue+stream)Kafka Protocol HandlerAMQP Protocol HandlerMQTT Protocol HandlerKafka ClientsAMQP ClientsMQTT ClientsRocketMQ Protocol HandlerRocketMQ Clientshttps:/ Segmented StreamSegment0Segment1Segment2Segment3ProducerConsumerTimeSegment 5Segment4
6、Segment ReadersSegmentedStream基礎決定上層:Cloud-NativeStateless BrokerScale(Broker+Bookie-Storage)https:/ 架構:Pulsar 的堅實基礎 Apache Pulsar 簡介 Pulsar 的態和社區Pulsar 和周邊態Pulsar 簡介:社區性能+強致性云原架構:存儲計算分離分層+分 持統的 Queue 和 Stream 的接。豐富的企業級特性多租戶隔離 百萬Topics 跨地域復制 鑒權認證30 committers,400+contributors,2.1K forks9 K+starshttp
7、s:/star-history.t9t.io/#apache/pulsarhttps:/ 統:RabbitMQ+Kafka0 數據丟失50+NameSpaces60億 消息/天3TB Storage/天20+核應智聯招聘 騰訊計費平臺 致性要求:條不能丟可要求:異常情況動修復海量存儲需求:海量堆積能快速響應要求:平滑響應時間騰訊計費平臺 多環境隔離部署,統管控;經受住王者榮耀、和平精英等頭部業務流量洪峰考驗;助騰訊計費系統穩定運;https:/ 解決 Kafka 的問題,替代 Kafka 存儲計算綁定:集群擴縮容/分區均衡 需要量拷數據,造成集群性能下降數據丟失:當分區副本不處于 ISR(同步
8、)狀態時,旦有 broker 發故障,造成數據丟失 或 分區法提供讀寫服務當 Kafka broker 磁盤故障/使率過時,需要進預集群跨區域復制:使 KMM(Kafka Mirror Maker),性能和穩定性難以達到預期讀數據性能低:容易出現 PageCache 污染,造成讀寫爭搶性能下降IO 不隔離,難以持萬級topic數量:磁盤讀寫性能會隨著 topic partition 數量的增加降低。集群管理復雜:在 BIGO,擴容臺機器到 Kafka 集群并進分區均衡,需要 0.5/天;縮容臺機器需要 1/天https:/ Asia Adoption 2020Benchmark:帶寬Maxim
9、um steady state throughput using the Open Messaging Benchmark on a 3-nodes cluster.Full details available athttps:/streamnative.io/blog/tech/2020-11-09-benchmark-pulsar-kafka-performanceBenchmark:穩定、低延遲Latency benchmark with 200 MB/s publish throughput using the Open Messaging Benchmark on a 3-nodes
10、 cluster.Full details available athttps:/streamnative.io/blog/tech/2020-11-09-benchmark-pulsar-kafka-performancePulsar 簡介:社區性能+強致性云原架構:存儲計算分離分層+分 持統的 Queue 和 Stream 的接。豐富的企業級特性多租戶隔離 百萬Topics 跨地域復制 鑒權認證30 committers,400+contributors,2.1K forks9 K+starshttps:/star-history.t9t.io/#apache/pulsarhttps:/
11、簡介 Founded by the original developers of Apache PulsarBoth Apache Pulsar and Apache BookKeeper PMC Chair5 Apache Pulsar PMC member;3 Apache BookKeeper PMC member The leader of the Apache Pulsar community Pulsar Summit North America(June 2020)35 speakers,600+attendees,Pulsar Summit Asia(Nov 2020)45 speakers,1,000+attendees Lead Apache Pulsar Big features,releases and Roadmaps.Status January 2019:Founded August 2020:StreamNative Cloud Launches Customers:30+StreamNative Cloud