风暴雷迪斯喷口元组也毫无例外地丢失了

问题描述 投票:1回答:1

我有风暴拓扑(1工人)设置,其中spout(在java中)从redis出列(使用blpop)事件并转移到螺栓。但是有一个观察结果是当一个队列超过200万并且在风暴雨云/主管/动物园管理员/工人日志中没有发现警告/异常时,一些事件没有收到螺栓(在clojure,6-spout螺纹,50螺栓螺纹)。

本地方案不会使用虚拟数据进行复制。群集中没有网络延迟/丢包。平均处理延迟为100毫秒。如何找到解决生产问题的原因。

(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)))
java clojure redis apache-storm
1个回答
2
投票

如果它不会使拓扑结构太慢,则可以使用Config.setDebug(true) https://github.com/apache/storm/blob/f2ced23fa4e3f699558663baef4ee582ee148fa2/storm-client/src/jvm/org/apache/storm/Config.java#L1763启用调试日志记录。

否则,我会尝试将一些调试日志记录添加到您的螺栓中,并启用Redis spout的日志记录,以确定是否由Storm或Redis集成丢失了元组。

另外我注意到你使用的是旧的Storm版本。你可以尝试升级。

© www.soinside.com 2019 - 2024. All rights reserved.