pyr / riemann-kafka

kafka producer and consumer support in riemann
Other
41 stars 14 forks source link

the given example config doesn't work #15

Open naweeng opened 7 years ago

naweeng commented 7 years ago

I have a working setup of riemann and I wanted to add kafka integration but when I try out the example config in the readme riemann doesn't start. I get the following error in the log:

INFO [2017-01-10 06:35:14,634] main - riemann.plugin - walking classpath to find plugins INFO [2017-01-10 06:35:14,969] main - riemann.plugin - loading plugin: kafka ERROR [2017-01-10 06:35:17,350] main - riemann.bin - Couldn't start clojure.lang.Compiler$CompilerException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory, compiling:(/etc/riemann/riemann.config:24:1)

The following is the contents of my config file(I have port numbers as per my installation):

; -*- mode: clojure; -*-
; vim: filetype=clojure

(logging/init {:file "/var/log/riemann/riemann.log"})

; Listen on the local interface over TCP (5555), UDP (5555), and websockets
; (5556)
(let [host "127.0.0.1"]
  (tcp-server {:host host})
  (udp-server {:host host})
  (ws-server  {:host host}))

; Expire old events from the index every 5 seconds.
(periodically-expire 5)
(load-plugins)

(kafka/kafka-consumer {:topic "events"
                       :zookeeper.connect "localhost:2181"
                       :group.id "riemann.consumer"
                       :auto.offset.reset "smallest"
                       :auto.commit.enable "false"})

(let [producer (kafka/kafka-producer
                 {:topic "expired"
                  :metadata.broker.list "localhost:9092"})]
  (streams
    prn
    (expired producer)))
liuweichu commented 7 years ago

Please check https://github.com/pyr/riemann-kafka/issues/13