liquidm / ruby-druid

Ruby utilities for metamx druid
MIT License
43 stars 34 forks source link

dripl doesn't work #12

Closed maxd closed 10 years ago

maxd commented 10 years ago

Hello All,

When I try to run any command in dripl it throw exception:

➜  ruby-druid git:(master) ✗ be bin/dripl
>> metrics
ZK::Exceptions::NoNode: inputs: {:path=>"/discoveryPath", :watcher=>#<Zookeeper::Callbacks::WatcherCallback:0x007fc29b8dde88 @completed=false, @proc=#<Proc:0x007fc29b8dd730@/Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.7/lib/zookeeper/callbacks.rb:24>>}
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/client/base.rb:1068:in `check_rc'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/client/base.rb:1057:in `call_and_check_rc'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/client/threaded.rb:584:in `call_and_check_rc'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/client/base.rb:717:in `block in children'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/event_handler.rb:296:in `block in setup_watcher!'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/event_handler.rb:314:in `block in synchronize'
    /Users/mdobryakov/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/event_handler.rb:314:in `synchronize'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/event_handler.rb:283:in `setup_watcher!'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/client/base.rb:1100:in `setup_watcher!'
    /Users/mdobryakov/Projects/temp/ruby-druid/vendor/bundle/ruby/1.9.1/gems/zk-1.9.2/lib/zk/client/base.rb:716:in `children'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/zoo_handler.rb:34:in `check_services'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/zoo_handler.rb:26:in `init_zookeeper'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/zoo_handler.rb:14:in `initialize'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/client.rb:45:in `new'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/client.rb:45:in `zookeeper_caching_management!'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/client.rb:12:in `initialize'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/console.rb:43:in `new'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/console.rb:43:in `client'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/console.rb:49:in `source'
    /Users/mdobryakov/Projects/temp/ruby-druid/lib/druid/console.rb:57:in `metrics'
    (ripl):1:in `initialize'

Zookeeper has the following log:

2013-11-29 09:24:42,787 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.100.1:51286
2013-11-29 09:24:42,788 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@793] - Connection request from old client /192.168.100.1:51286; will be dropped if server is in r-o mode
2013-11-29 09:24:42,788 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@839] - Client attempting to establish new session at /192.168.100.1:51286
2013-11-29 09:24:42,834 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@595] - Established session 0x142a31a4b64000b with negotiated timeout 20001 for client /192.168.100.1:51286
2013-11-29 09:24:42,837 [myid:] - INFO  [ProcessThread(sid:0 cport:-1)::PrepRequestProcessor@476] - Processed session termination for sessionid: 0x142a31a4b64000b
2013-11-29 09:24:42,840 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /192.168.100.1:51287
2013-11-29 09:24:42,840 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@349] - caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x142a31a4b64000b, likely client has closed socket
    at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
    at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
    at java.lang.Thread.run(Thread.java:744)
2013-11-29 09:24:42,842 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /192.168.100.1:51286 which had sessionid 0x142a31a4b64000b
2013-11-29 09:24:42,843 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@793] - Connection request from old client /192.168.100.1:51287; will be dropped if server is in r-o mode
2013-11-29 09:24:42,844 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@839] - Client attempting to establish new session at /192.168.100.1:51287
2013-11-29 09:24:42,846 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@595] - Established session 0x142a31a4b64000c with negotiated timeout 20001 for client /192.168.100.1:51287

How to fix this problem?


PATH
  remote: .
  specs:
    ruby-druid (0.1.2)
      rest-client
      zk

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (4.0.1)
      i18n (~> 0.6, >= 0.6.4)
      minitest (~> 4.2)
      multi_json (~> 1.3)
      thread_safe (~> 0.1)
      tzinfo (~> 0.3.37)
    addressable (2.3.5)
    atomic (1.1.14)
    awesome_print (1.2.0)
    bond (0.4.3)
    celluloid (0.15.2)
      timers (~> 1.1.0)
    coderay (1.1.0)
    columnize (0.3.6)
    crack (0.4.1)
      safe_yaml (~> 0.9.0)
    debugger (1.6.2)
      columnize (>= 0.3.1)
      debugger-linecache (~> 1.2.0)
      debugger-ruby_core_source (~> 1.2.3)
    debugger-linecache (1.2.0)
    debugger-ruby_core_source (1.2.4)
    diff-lcs (1.2.5)
    ffi (1.9.3)
    formatador (0.2.4)
    guard (2.2.4)
      formatador (>= 0.2.4)
      listen (~> 2.1)
      lumberjack (~> 1.0)
      pry (>= 0.9.12)
      thor (>= 0.18.1)
    guard-bundler (2.0.0)
      bundler (~> 1.0)
      guard (~> 2.2)
    guard-rspec (4.0.4)
      guard (>= 2.1.1)
      rspec (~> 2.14)
    i18n (0.6.5)
    listen (2.2.0)
      celluloid (>= 0.15.2)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    little-plugger (1.1.3)
    logging (1.7.2)
      little-plugger (>= 1.1.3)
    lumberjack (1.0.4)
    method_source (0.8.2)
    mime-types (2.0)
    minitest (4.7.5)
    multi_json (1.8.2)
    pry (0.9.12.4)
      coderay (~> 1.0)
      method_source (~> 0.8)
      slop (~> 3.4)
    rb-fsevent (0.9.3)
    rb-inotify (0.9.2)
      ffi (>= 0.5.0)
    rest-client (1.6.7)
      mime-types (>= 1.16)
    ripl (0.7.0)
      bond (~> 0.4.2)
    rspec (2.14.1)
      rspec-core (~> 2.14.0)
      rspec-expectations (~> 2.14.0)
      rspec-mocks (~> 2.14.0)
    rspec-core (2.14.7)
    rspec-expectations (2.14.4)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.14.4)
    ruby_gntp (0.3.4)
    safe_yaml (0.9.7)
    slop (3.4.7)
    terminal-table (1.4.5)
    thor (0.18.1)
    thread_safe (0.1.3)
      atomic
    timers (1.1.0)
    tzinfo (0.3.38)
    webmock (1.16.0)
      addressable (>= 2.2.7)
      crack (>= 0.3.2)
    zk (1.9.2)
      logging (~> 1.7.2)
      zookeeper (~> 1.4.0)
    zookeeper (1.4.7)

PLATFORMS
  ruby

DEPENDENCIES
  activesupport
  awesome_print
  debugger
  guard
  guard-bundler
  guard-rspec
  rb-fsevent
  ripl
  rspec
  ruby-druid!
  ruby_gntp
  terminal-table
  webmock
sixtus commented 10 years ago

Hi,

which version of Druid are you using? In case it's less than < 0.6, what's the value of druid.zk.paths.discoveryPath in your runtime.properties? If it's anything but /discoveryPath, you have to pass an option to ruby-druid, see

https://github.com/madvertise/ruby-druid/blob/master/lib/druid/zoo_handler.rb#L11

maxd commented 10 years ago

I am using Druid 0.6.24. The druid.zk.paths.discoveryPath property is undefined in mine runtime.property files.

In the Druid code I have found that druid.zk.paths.discoveryPath property was renamed to druid.discovery.curator.path. And default value for it now is /druid/discovery. But I have the same error with new value of discovery_path.

sixtus commented 10 years ago

The question about the druid version was exactly for that, it's renamed in 0.6, but you found it. What's the zookeeper connection string you are passing into ruby-druid?

maxd commented 10 years ago

I have solved the problem. In .driplrc file a property zookeeper had value 192.168.100.99:2181/druid . I have changed it to 192.168.100.99:2181 (i.e. removed /druid) and dripl started work.

Thanks.