We're currently using Ripple for modeling our objects in Riak. Since we are test first, we needed some matchers to help make specifying our Ripple::Documents easier.
(As a side note, we are also developing a gem to wrap RiakSearch functionality. The gem is called Ripplr and has been pushed to ruby gems.)
These matchers were created by extracting specifications from within Ripple's test suite.
**Note: Matchers updated on 10-17-2012 to support embedded docs and added failure messages
Matt Snyder is Software Craftsman in Northeast Ohio working to further himself and those around him as better craftsmen. This blog is about his thoughts on technology, craftsmanship and whatever else is worth burning brain cells on.
Monday, October 1, 2012
Why Nginx kept Riak's secondary indexes(2i) from working
Unfortunately when we deployed to our staging environment any feature that leveraged 2i failed to work. We spent a good amount of time reviewing our specs and feature implementation, but everything checked out fine so we moved on to our Riak app.config, comparing line for line the staging and development configuration. This did not produce any answers either.
Eventually we landed at our load balancer, Nginx. When we bypassed Nginx 2i worked perfectly! We could add an index to an object and then find the object by searching for the indexed value. We were able to determine that Nginx was removing the index header information from our request.
Not sure why Nginx was squashing a seemingly innocent 2i header and not other Riak specific headers, we ran across this post ... How to get non standard http headers on Nginx. Nginx by default removes header that use underscores.
That same post generously linked to Nginx: underscores in headers which shows you how to modify your Nginx config and allow underscores in headers. Once we made that change, all of our Riak 2i features worked flawlessly!
Hopefully if you have this problem you find this blog post in less time than it took us to troubleshoot!
Labels:
2i,
load balancing,
nginx,
Rails,
riak,
ripple,
Ruby,
secondary index
Subscribe to:
Posts (Atom)