简体   繁体   English

风暴雷迪斯喷口元组无一例外丢失

[英]storm redis spout tuples lost with no exception

I've storm topology (1 worker) setup in which spout(in java) dequeues (using blpop) events from redis and transfers to bolts. 我已经建立了风暴拓扑(1个工作程序),其中spout(在Java中)使redis的事件从Redis出队(使用blpop)并转移到螺栓。 but one observation is some events not received to bolt(in clojure, 6-spout threads, 50-bolt threads) when there is a queue of over 2 million and no warning/exceptions found in storm nimbus/supervisor/zookeeper/worker logs. 但是一个观察结果是,当队列超过200万且在风暴灵气/主管/动物园管理员/工人日志中未发现任何警告/异常时,螺栓上没有发生某些事件(clojure,6喷口螺纹,50螺栓螺纹)。

Locally this scenario is not replicating with dummy data. 在本地,此方案不复制虚拟数据。 There is no network lag/packet loss is seen in cluster. 在群集中没有看到网络延迟/数据包丢失。 avg processing latency is 100ms. 平均处理延迟为100毫秒。 How to find cause to fix it on production. 如何找到将其修复的原因。

(ns event-processor
  (:import [backtype.storm StormSubmitter LocalCluster]
           java.util.UUID
           storm_jedis.RedisQueueSpout
           )
  (:use [backtype.storm clojure config])
  (:require [clojure.tools.logging :as log])
  (:require [clj-redis.client :as redis])
  (:import (redis.clients.jedis Jedis JedisPool JedisPoolConfig))
  (:gen-class))

(defmacro process-event [tuple]
    (log/info "processing event")
    )

(defbolt execute-ls-closure ["word"] {:prepare true}
  [conf context collector]
  (let [counts (atom {})]

    (bolt
     (execute [tuple]
       (let [
        timestart (. System currentTimeMillis)
        tuple-message (.get (get tuple "message") 0)
        string-to-emit (process-event tuple)
        ]
        (emit-bolt! collector [string-to-emit] :anchor tuple)
        (ack! collector tuple)
        )))))

(defn mk-topology []

  (topology
   ;{"1" (spout-spec sentence-spout)
   {"1" (spout-spec redis-spout :p 6)
                     }
   {"3" (bolt-spec {"1" :shuffle }
                   execute-ls-closure
                   :p 50)
                   }))

(defn run-local! []
  (let [cluster (LocalCluster.)]
    (.submitTopology cluster "word-count" {TOPOLOGY-DEBUG true} (mk-topology))
    (Thread/sleep 10000)
    (.shutdown cluster)
    ))

(defn submit-topology! [name]
  (StormSubmitter/submitTopology
   name
   {TOPOLOGY-DEBUG true
    TOPOLOGY-WORKERS 1}
   (mk-topology)))

(defn -main
  ([]
   (run-local!))
  ([name]
   (submit-topology! name)))

If it doesn't slow down your topology too much, you can enable debug logging with Config.setDebug(true) https://github.com/apache/storm/blob/f2ced23fa4e3f699558663baef4ee582ee148fa2/storm-client/src/jvm/org/apache/storm/Config.java#L1763 . 如果它不会使您的拓扑速度减慢太多,则可以使用Config.setDebug(true) https://github.com/apache/storm/blob/f2ced23fa4e3f699558663baef4ee582ee148fa2/storm-client/src/jvm/org/ apache / storm / Config.java#L1763

Otherwise, I'd try adding some debug logging to your bolts, and enabling logging for your Redis spout, to figure out if the tuples are getting lost by Storm or by the Redis integration. 否则,我会尝试向您的螺栓添加一些调试日志记录,并为Redis spout启用日志记录,以判断元组是否由于Storm或Redis集成而丢失。

Also I note that you're using an old Storm version. 我还注意到您使用的是旧版Storm。 You could try upgrading. 您可以尝试升级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM