liquidm / ruby-druid

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

roblem accessing /druid/v2/datasources/wikipedia. Reason: HTTP method GET is not supported by this URL #4

Closed rjurney closed 11 years ago

rjurney commented 11 years ago

metrics RuntimeError: Request failed: 405:

Error 405 HTTP method GET is not supported by this URL

HTTP ERROR 405

Problem accessing /druid/v2/datasources/wikipedia. Reason:

    HTTP method GET is not supported by this URL


Powered by Jetty://



















/Users/rjurney/Software/ruby-druid/lib/druid/client.rb:75:in `data_source'
/Users/rjurney/Software/ruby-druid/lib/druid/console.rb:49:in `source'
/Users/rjurney/Software/ruby-druid/lib/druid/console.rb:57:in `metrics'
(ripl):5:in `initialize'
jwroblewski commented 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).

rjurney commented 11 years ago

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?

rjurney commented 11 years ago

My .driplrc looks like so:

options :static_setup => { 'wikipedia' => 'http://localhost:8083/druid/v2/' }

jwroblewski commented 11 years ago

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.

rjurney commented 11 years ago

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.

rjurney commented 11 years ago

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:insend' /Users/rjurney/Software/ruby-druid/lib/druid/console.rb:25:in `format_result'

rjurney commented 11 years ago

Any ideas how I can directly connect to a relatime node?

jwroblewski commented 11 years ago

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/' }
rjurney commented 11 years ago

druid.service=realtime

Thanks, I'll try this.

rjurney commented 11 years ago

Now I get empty queries:

long_sum(:impressions) ++ ++

Is there a way to see the query the ruby client is submitting?

rjurney commented 11 years ago

Nevermind, added a puts