{"id":314,"date":"2016-04-15T00:35:54","date_gmt":"2016-04-14T22:35:54","guid":{"rendered":"https:\/\/blog.unetresgrossebite.com\/?p=314"},"modified":"2016-04-15T00:43:39","modified_gmt":"2016-04-14T22:43:39","slug":"riakcs","status":"publish","type":"post","link":"https:\/\/blog.unetresgrossebite.com\/?p=314","title":{"rendered":"RiakCS"},"content":{"rendered":"<p>In the last few months, I&#8217;ve been working with some application using Riak as its main database.<br \/>\n<a href=\"http:\/\/basho.com\/products\/riak-kv\/\">Riak<\/a> (being renamed as RiakKV) is a Key\/Value NoSGBD, running on Debian Wheezy, Ubuntu Trusty,\u00a0CentOS 7, FreeBSD 10, Solaris 10, SmartOS 13.1 and Fedora 17. Probably not the most famous of them,\u00a0yet pretty powerful\u00a0and pretty\u00a0easy to manage and scale.<\/p>\n<p>The main culprits I have to mention here, is that the opensource version is limited in terms of features, and won&#8217;t allow you to setup replication across several clusters. An\u00a0other one is that data sharding is <a href=\"http:\/\/basho.com\/posts\/technical\/why-your-riak-cluster-should-have-at-least-five-nodes\/\">not necessarily guaranteed<\/a>. You should also note that there&#8217;s some poor SEO on their documentation, which ends up in\u00a0google searches pointing\u00a0to broken links half of the time. Finally: lack of packaging for recent distributions, and according to their pro support: Jessie and Xenial package won&#8217;t show up before their <em>2.3<\/em>, which is probably not for this year. Sure, it looks bad, and yet, it does the job.<\/p>\n<p>Recommended\u00a0setup involves 5 instances,\u00a0according to Basho.\u00a0Using default settings, you will always keep <a href=\"http:\/\/docs.basho.com\/riak\/kv\/2.1.4\/developing\/api\/http\/set-bucket-props\/\">3 copies of each data<\/a>. You may theoretically lose two instances, before meeting\u00a0with inconsistencies &#8211; which should resolve themselves, recovering your nodes. Consider that depending on <a href=\"https:\/\/aphyr.com\/posts\/285-jepsen-riak\">the way you&#8217;ll use Riak<\/a>, you could either end up with good or catastrophic consistency.<\/p>\n<p>Anyway, that&#8217;s not our topic today. Now that we introduced Riak, I recently discovered that I could build some s3 capable service on top of it.<br \/>\nBuilding a cluster, you will install\u00a0RiakKV to all your nodes. Your blobs will be stored in there.<br \/>\nRiakCS will also be installed to all your nodes. These are your s3 gateways. All your storage node are\u00a0also gateways. You should consider setting up some haproxy forwarding http or https traffic to your RiakCS daemon.<br \/>\nFinally, you will install\u00a0<a href=\"https:\/\/github.com\/basho\/stanchion\/blob\/master\/README.org\">Stanchion<\/a> (manager ensuring uniqueness of entities) to a single instance. Actually, you could install it to several instances, although you should have all your RiakCS services coordinating with a single Stanchion at a time.<br \/>\nOptionally, you could also install <a href=\"http:\/\/docs.basho.com\/riak\/cs\/2.1.1\/references\/appendices\/riak-cs-control\/\">RiakCS Control<\/a>, a user management interface.<br \/>\nAll of these are OpenSource. You could still use a RiakKV license, synchronizing your dataset to a remote location, although this may not be necessary.<br \/>\nBasho documentation tells about RiakCS differences with <a href=\"http:\/\/docs.basho.com\/riak\/cs\/2.1.1\/theory\/comparisons\/\">Swift and Atmos<\/a>, although you could also compare it to Sheepdog, Ceph used with Rados Gateways, or just AWS&#8217;s s3.\u00a0On top of architectural specifics, you should also consider that each of these solution have its\u00a0own limited implementation of the s3 API.<\/p>\n<p>Having run a Ceph (infernalis) +Rados-gw cluster alongside a RiakCS cluster as EC2&#8217;s autoscale groups, I noted that Ceph OSD tend to crash.\u00a0Running from an ASG, they get\u00a0replaced by a new instance, previous one is destroyed, I haven&#8217;t investigated much on the specifics &#8211; running\u00a0Ceph on virtual systems is not recommended anyway. Whereas RiakCS never troubled me.<\/p>\n<p>Short parenthesis regarding s3 implementations: running Ceph, I wasn&#8217;t able to create a bucket using s3cmd. I ended up writing a python script, using boto. Whereas running RiakCS, I couldn&#8217;t run anything until I\u00a0updated\u00a0my <em>.s3cfg<\/em> to explicitly enable <em>v2_signature<\/em>: AWS now uses v4, which is not implemented by RiakCS (and not documented anywhere).<\/p>\n<p>I would probably still recommend Ceph to most users\u00a0running on physical hardware. Although for anyone less likely to succeed in building and running his Ceph cluster, I would definitely recommend RiakCS, where\u00a0adding, removing or\u00a0replacing nodes\u00a0is ridiculously easy, while recoveries are relatively well documented &#8211; and rarely required\u00a0anyway.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last few months, I&#8217;ve been working with some application using Riak as its main database. Riak (being renamed as RiakKV) is a Key\/Value NoSGBD, running on Debian Wheezy, Ubuntu Trusty,\u00a0CentOS 7, FreeBSD 10, Solaris 10, SmartOS 13.1 and Fedora 17. Probably not the most famous of them,\u00a0yet pretty powerful\u00a0and pretty\u00a0easy to manage and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,10],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/314"}],"collection":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=314"}],"version-history":[{"count":6,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/314\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/314\/revisions\/318"}],"wp:attachment":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}