Closed rjurney closed 11 years ago
The datasources collection is provided by runtime druid nodes. Most likely your druid client is not connecting to this kind of node. Please check what type of druid node your config points to (I assume you're not using zookeeper for druid lookup).
What version of Druid does this client work with? I am connecting to a standalone realtime node, so no zookeeper. The Standalone API has no GETs, only the Broker does, so I am confused?
My .driplrc looks like so:
options :static_setup => { 'wikipedia' => 'http://localhost:8083/druid/v2/' }
What an ugly typo that was in my last comment... Of course it is not runtime, but broker which provides the datasources. So, to query datasources, you need to point your driplrc to a broker. Metrics-based queries should work fine with runtime, though.
Thanks, this is helpful, and makes clear why the client expects a zookeeper quorum. In my case, I am extending the examples of the project's documentation to explain how to build applications using ruby-druid, so I am using the RealtimeStandalone server against wikipedia data.
My realtime.spec looks like this:
[{ "schema" : { "dataSource":"druidtest", "aggregators":[ {"type":"count", "name":"impressions"}, {"type":"doubleSum","name":"wp","fieldName":"wp"}], "indexGranularity":"minute", "shardSpec" : { "type": "none" } }, "config" : { "maxRowsInMemory" : 500000, "intermediatePersistPeriod" : "PT10m" }, "firehose" : { "type" : "kafka-0.7.2", "consumerProps" : { "zk.connect" : "localhost:2181", "zk.connectiontimeout.ms" : "15000", "zk.sessiontimeout.ms" : "15000", "zk.synctime.ms" : "5000", "groupid" : "topic-pixel-local", "fetch.size" : "1048586", "autooffset.reset" : "largest", "autocommit.enable" : "false" }, "feed" : "druidtest", "parser" : { "timestampSpec" : { "column" : "utcdt", "format" : "iso" }, "data" : { "format" : "json" }, "dimensionExclusions" : ["wp"] } }, "plumber" : { "type" : "realtime", "windowPeriod" : "PT10m", "segmentGranularity":"hour", "basePersistDirectory" : "/tmp/realtime/basePersist", "rejectionPolicy": {"type": "messageTime"} }
}]
My .driplrc looks like this:
options :static_setup => { 'druidtest' => 'http://localhost:8083/druid/v2/' }
How do I issue queries at this schema in dripl? This fails:
long_sum(:impressions) ripl: Error while printing result: RuntimeError: data source druidtest/druidtest (currently) not available /Users/rjurney/Software/ruby-druid/lib/druid/client.rb:17:in
send' /Users/rjurney/Software/ruby-druid/lib/druid/query.rb:28:in
send' /Users/rjurney/Software/ruby-druid/lib/druid/console.rb:25:in `format_result'
Any ideas how I can directly connect to a relatime node?
What's the name of your druid runtime service ('druid.service' attribute in /etc/druid/runtime.properties)? In case it's different than druidtest, try the following .driplrc:
options :static_setup => { '<DRUID SERVICE>/druidtest' => 'http://localhost:8083/druid/v2/' }
druid.service=realtime
Thanks, I'll try this.
Now I get empty queries:
long_sum(:impressions) ++ ++
Is there a way to see the query the ruby client is submitting?
Nevermind, added a puts
metrics RuntimeError: Request failed: 405:
HTTP ERROR 405
Problem accessing /druid/v2/datasources/wikipedia. Reason:
Powered by Jetty://