{"id":794,"date":"2010-06-06T09:28:59","date_gmt":"2010-06-06T17:28:59","guid":{"rendered":"http:\/\/www.codebelay.com\/blog\/?p=794"},"modified":"2010-06-06T23:16:21","modified_gmt":"2010-06-07T07:16:21","slug":"installing-snowflake","status":"publish","type":"post","link":"https:\/\/www.codebelay.com\/blog\/2010\/06\/06\/installing-snowflake\/","title":{"rendered":"Installing Snowflake"},"content":{"rendered":"<p>I <a href=\"http:\/\/github.com\/barce\/snowflake\">forked the code<\/a> that <a href=\"http:\/\/theryanking.com\/\">Ryan King<\/a> wrote for Twitter called <a href=\"http:\/\/github.com\/twitter\/snowflake\">snowflake<\/a>.<\/p>\n<p>Snowflake works by guaranteeing a unique user id based on a few simple guarantees: time, machine id and sequence number.<\/p>\n<p>My fork has a fix for the ruby client allowing you to query multiple servers.<\/p>\n<p>Here are the prerequisites:<\/p>\n<ul>\n<li>Java 6 (1.6)<\/li>\n<li>sbt (simple-build-tool) &#8211; <a href=\"http:\/\/code.google.com\/p\/simple-build-tool\/\">http:\/\/code.google.com\/p\/simple-build-tool\/<\/a><\/li>\n<li>thrift &#8211; <a href=\"http:\/\/incubator.apache.org\/thrift\/\">http:\/\/incubator.apache.org\/thrift\/<\/a><\/li>\n<\/ul>\n<p>The install process is fairly straightforward:<\/p>\n<div style=\"color: #fff; background: #000; padding: 5px 5px 5px 5px;\">\n<ol>\n<li>Clone the repo: git clone http:\/\/github.com\/twitter\/snowflake.git\n<li>Edit project\/build.properties to use sbt.version=0.7.4\n<li>sbt update\n<li>sbt compile\n<li>sbt test\n<li>Copy one of the configs into \/etc: cp config\/development2.conf \/etc\/unknown.conf  Or you can also just use &#8216;sbt run -f config\/development2.conf&#8217;.\n<li>Edit the conf and add a unique worker ID: worker_id = 1\n<li>In the conf: skip_sanity_checks = false\n<li>sbt run\n<\/ol>\n<\/div>\n<p>When you run the client like so:<\/p>\n<div style=\"color: #fff; background: #000; padding: 5px 5px 5px 5px;\">\nRUBYLIB=.\/target\/gen-rb .\/src\/scripts\/client_test.rb 1 &#8220;192.168.0.103:7610,192.168.0.109:7610&#8221; test-on\n<\/div>\n<p>You should get something like this:<\/p>\n<div style=\"color: #fff; background: #000; padding: 5px 5px 5px 5px;\">\n557299556602089472 test-on 1\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I forked the code that Ryan King wrote for Twitter called snowflake. Snowflake works by guaranteeing a unique user id based on a few simple guarantees: time, machine id and sequence number. My fork has a fix for the ruby client allowing you to query multiple servers. Here are the prerequisites: Java 6 (1.6) sbt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-794","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/comments?post=794"}],"version-history":[{"count":0,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/794\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/media?parent=794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/categories?post=794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/tags?post=794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}