<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kristian Lunde &#187; NoSQL</title>
	<atom:link href="http://www.klunde.net/category/nosql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.klunde.net</link>
	<description>www.klunde.net</description>
	<lastBuildDate>Sun, 18 Jul 2010 21:00:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Great article on Super Columns and Cassandra</title>
		<link>http://www.klunde.net/2009/11/21/great-article-on-super-columns-and-cassandra/</link>
		<comments>http://www.klunde.net/2009/11/21/great-article-on-super-columns-and-cassandra/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 16:37:17 +0000</pubDate>
		<dc:creator>Kristian Lunde</dc:creator>
				<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Cassandra]]></category>

		<guid isPermaLink="false">http://www.klunde.net/?p=445</guid>
		<description><![CDATA[
			
				
			
		
This is a great article describing super columns and the general structure of cassandra. A must read for NoSQL newbies. 
http://arin.me/code/wtf-is-a-supercolumn-cassandra-data-model
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.klunde.net%2F2009%2F11%2F21%2Fgreat-article-on-super-columns-and-cassandra%2F" onclick="urchinTracker('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.klunde.net_2F2009_2F11_2F21_2Fgreat-article-on-super-columns-and-cassandra_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.klunde.net%2F2009%2F11%2F21%2Fgreat-article-on-super-columns-and-cassandra%2F&amp;source=kristianlunde&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>This is a great article describing super columns and the general structure of cassandra. A must read for NoSQL newbies. </p>
<p><a href="http://arin.me/code/wtf-is-a-supercolumn-cassandra-data-model" onclick="urchinTracker('/outgoing/arin.me/code/wtf-is-a-supercolumn-cassandra-data-model?referer=');">http://arin.me/code/wtf-is-a-supercolumn-cassandra-data-model</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.klunde.net/2009/11/21/great-article-on-super-columns-and-cassandra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Cassandra and Thrift on OSX</title>
		<link>http://www.klunde.net/2009/11/20/installing-cassandra-and-thrift-on-osx/</link>
		<comments>http://www.klunde.net/2009/11/20/installing-cassandra-and-thrift-on-osx/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 21:39:14 +0000</pubDate>
		<dc:creator>Kristian Lunde</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Cassandra]]></category>

		<guid isPermaLink="false">http://www.klunde.net/?p=410</guid>
		<description><![CDATA[
			
				
			
		
Cassandra is a NoSQL distributed database developed by Facebook, it is built to handle huge amounts of data and to perform CRUD operations quickly. The Cassandra site&#8217;s strap line says:
&#8220;The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together  Dynamo&#8217;s fully distributed design and Bigtable&#8217;s ColumnFamily-based data model. 
Thrift is also [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.klunde.net%2F2009%2F11%2F20%2Finstalling-cassandra-and-thrift-on-osx%2F" onclick="urchinTracker('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.klunde.net_2F2009_2F11_2F20_2Finstalling-cassandra-and-thrift-on-osx_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.klunde.net%2F2009%2F11%2F20%2Finstalling-cassandra-and-thrift-on-osx%2F&amp;source=kristianlunde&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://incubator.apache.org/cassandra/" onclick="urchinTracker('/outgoing/incubator.apache.org/cassandra/?referer=');">Cassandra</a> is a <a href="http://en.wikipedia.org/wiki/NoSQL" onclick="urchinTracker('/outgoing/en.wikipedia.org/wiki/NoSQL?referer=');">NoSQL</a> distributed database developed by <a href="http://www.facebook.com" onclick="urchinTracker('/outgoing/www.facebook.com?referer=');">Facebook</a>, it is built to handle huge amounts of data and to perform <a href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete" onclick="urchinTracker('/outgoing/en.wikipedia.org/wiki/Create_read_update_and_delete?referer=');">CRUD</a> operations quickly. The Cassandra site&#8217;s strap line says:</p>
<p><i>&#8220;The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together  Dynamo&#8217;s fully distributed design and Bigtable&#8217;s ColumnFamily-based data model. </i></p>
<p><a href="http://incubator.apache.org/thrift/" onclick="urchinTracker('/outgoing/incubator.apache.org/thrift/?referer=');">Thrift</a> is also developed by <a href="http://www.facebook.com" onclick="urchinTracker('/outgoing/www.facebook.com?referer=');">Facebook</a> and is a software framework for service development and is used as an interface to Cassandra. The Thrift page site says:</p>
<p><i>&#8220;Thrift is a software framework for scalable cross-language services development. It combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and OCaml.&#8221;</i></p>
<p>Both <a href="http://incubator.apache.org/cassandra/" onclick="urchinTracker('/outgoing/incubator.apache.org/cassandra/?referer=');">Cassandra</a> and <a href="http://incubator.apache.org/thrift/" onclick="urchinTracker('/outgoing/incubator.apache.org/thrift/?referer=');">Thrift</a> are apache incubator projects.</p>
<h2>Installing Cassandra</h2>
<h3>1. Download cassandra</h3>
<p>Download from: <a href="http://incubator.apache.org/cassandra/" onclick="urchinTracker('/outgoing/incubator.apache.org/cassandra/?referer=');">http://incubator.apache.org/cassandra/</a>.</p>
<h3>2. Create and set the correct paths in the storage-conf.xml</h3>
<p>You can find the storage-conf.xml file in your cassandra root directory /conf</p>
<p>My configuration file settings in storage-conf.xml:</p>
<div class="geshi no xml">
<ol>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;CommitLogDirectory<span class="re2">&gt;</span></span></span>/Users/kristianlunde/tmp/cassandra-log/commitlog<span class="sc3"><span class="re1">&lt;/CommitLogDirectory<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;DataFileDirectories<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;DataFileDirectory<span class="re2">&gt;</span></span></span>/Users/kristianlunde/workspaces/mysapient/cassandra/data<span class="sc3"><span class="re1">&lt;/DataFileDirectory<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;/DataFileDirectories<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;CalloutLocation<span class="re2">&gt;</span></span></span>/Users/kristianlunde/workspaces/mysapient/cassandra/callouts<span class="sc3"><span class="re1">&lt;/CalloutLocation<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;BootstrapFileDirectory<span class="re2">&gt;</span></span></span>/Users/kristianlunde/workspaces/mysapient/cassandra/bootstrap<span class="sc3"><span class="re1">&lt;/BootstrapFileDirectory<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;StagingFileDirectory<span class="re2">&gt;</span></span></span>/Users/kristianlunde/workspaces/mysapient/cassandra/staging<span class="sc3"><span class="re1">&lt;/StagingFileDirectory<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p><strong>Notice:</strong> You have to create all these directories for cassandra to run properly.</p>
<h3>3. Set a log directory in the log4j.properties file</h3>
<p>This file is found in the same directory as the storage-conf.xml</p>
<h3>4. Check that you are running java 6 as default</h3>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">&nbsp;java -version</div>
</li>
</ol>
</div>
<p>If you are running an earlier version of java you will have to change your version. Java 6 should already be installed on your mac if you keep your os in sync with the automatic updates from apple. You can change your java version by using the <a href="http://www.apple.com/macosx/what-is-macosx/apps-and-utilities.html#java" onclick="urchinTracker('/outgoing/www.apple.com/macosx/what-is-macosx/apps-and-utilities.html_java?referer=');">&#8220;Java Settings&#8221;</a> application located in your <em>/Application/Utilities</em> directory.</p>
<h3>5. Starting Cassandra</h3>
<p>You should be ready to go now, navigate to the root directory of your cassandra installation and start cassandra by typing:</p>
<div class="geshi no pre">
<ol>
<li class="li1">
<div class="de1">bin/cassandra -f</div>
</li>
</ol>
</div>
<p>If you dont see any error messages cassandra is probably running as it should, so it is time to test it out.</p>
<p>Cassandra comes with a CLI interface which allowes you to do simple queries to the database. Notice that the CLI interface is not not as powerful as the thrift interface. You can for instance not execute get queries in <a href="http://arin.me/code/wtf-is-a-supercolumn-cassandra-data-model" onclick="urchinTracker('/outgoing/arin.me/code/wtf-is-a-supercolumn-cassandra-data-model?referer=');">Super Columns</a>, those queries will create a java exception.</p>
<p>To test the CLI interface, run the following command from the cassandra root directory:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">.<span class="sy0">/</span>bin<span class="sy0">/</span>cassandra-cli &#8211;host localhost &#8211;port <span class="nu0">9160</span></div>
</li>
</ol>
</div>
<p>Inserting values to the keyspace:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">&nbsp;cassandra<span class="sy0">&gt;</span> <span class="kw1">set</span> Keyspace1.Standard1<span class="br0">&#91;</span><span class="st0">&#39;blog-post&#39;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#39;name&#39;</span><span class="br0">&#93;</span> = <span class="st0">&#39;Installing Cassandra and Thrift OSX&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;Value inserted.</div>
</li>
<li class="li1">
<div class="de1">&nbsp;cassandra<span class="sy0">&gt;</span> <span class="kw1">set</span> Keyspace1.Standard1<span class="br0">&#91;</span><span class="st0">&#39;blog-post&#39;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#39;author&#39;</span><span class="br0">&#93;</span> = <span class="st0">&#39;Kristian Lunde&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;Value inserted.</div>
</li>
</ol>
</div>
<p>	Retrieving data from the keyspace:</p>
<div class="geshi no bash">
<div class="head">cassandra> get Keyspace1.Standard1[&#39;blog-post&#39;]</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#40;</span><span class="re2">column=</span>name, <span class="re2">value=</span>Installing Cassandra and Thrift OSX; <span class="re2">timestamp=</span><span class="nu0">1258748376097</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#40;</span><span class="re2">column=</span>author, <span class="re2">value=</span>Kristian Lunde; <span class="re2">timestamp=</span><span class="nu0">1258748405486</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;Returned <span class="nu0">2</span> rows.</div>
</li>
<li class="li1">
<div class="de1">&nbsp;cassandra<span class="sy0">&gt;</span></div>
</li>
</ol>
</div>
<h2>Installing Thrift</h2>
<p><strong>Update:</strong> I found this manual after I had installed thrift: <a href="http://wiki.apache.org/thrift/ThriftInstallationMacOSX" onclick="urchinTracker('/outgoing/wiki.apache.org/thrift/ThriftInstallationMacOSX?referer=');">http://wiki.apache.org/thrift/ThriftInstallationMacOSX</a>, using this install guide will probably fix the issues I had with compiling thrift.</p>
<h3>1. Download Thrift</h3>
<p>Download from <a href="http://incubator.apache.org/thrift/download/" onclick="urchinTracker('/outgoing/incubator.apache.org/thrift/download/?referer=');">http://incubator.apache.org/thrift/download/</a> and extract it.</p>
<h3>2. Check that you have installed the following:</h3>
<ul>
<li>g++ 3.3.5+</li>
<li>Runtime libraries for lex and yacc might be needed for the compiler.</li>
<li>boost 1.33.1+ (1.34.0 for building all tests) <a href="http://www.boost.org/" onclick="urchinTracker('/outgoing/www.boost.org/?referer=');">http://www.boost.org/</a>.</li>
</ul>
<p>I had to install boost manually:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">sudo</span> port <span class="kw2">install</span> boost</div>
</li>
</ol>
</div>
<p><strong>Notice:</strong> the boost installation might take a while, It took about 5 &#8211; 10 minutes on my Macbook PRO (2.53GHz).</p>
<p>You can see the full requirements for thrift at <a href="http://wiki.apache.org/thrift/ThriftRequirements" onclick="urchinTracker('/outgoing/wiki.apache.org/thrift/ThriftRequirements?referer=');">http://wiki.apache.org/thrift/ThriftRequirements</a>.</p>
<h3>3. Start the installation</h3>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">&nbsp;kristian-lundes-macbook-pro:thrift kristianlunde$ .<span class="sy0">/</span>bootstrap.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;configure.ac:<span class="nu0">26</span>: installing `.<span class="sy0">/</span>missing<span class="st0">&#39;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0"> configure.ac:26: installing `./install-sh&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;compiler<span class="sy0">/</span><span class="kw2">cpp</span><span class="sy0">/</span>Makefile.am: installing `.<span class="sy0">/</span>depcomp<span class="st0">&#39;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0"> configure.ac: installing `./ylwrap&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;kristian-lundes-macbook-pro:thrift</div>
</li>
</ol>
</div>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">.<span class="sy0">/</span>configure</div>
</li>
</ol>
</div>
<p>This ended up in an error message for me:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">&nbsp;.<span class="sy0">/</span>configure: line <span class="nu0">20722</span>: syntax error near unexpected token `MONO,<span class="st0">&#39;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0"> ./configure: line 20722: ` &nbsp;PKG_CHECK_MODULES(MONO, mono &gt;= 2.0.0, net_3_5=yes, net_3_5=no)&#39;</span></div>
</li>
</ol>
</div>
<p>To fix this I had to copy my pkg.m4 file from /opt/local/share/aclocal/pkg.m4 to my thrift/aclocal directory.</p>
<p>Navigate to your thrift root directory:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">&nbsp;<span class="kw2">cp</span> <span class="sy0">/</span>opt<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>share<span class="sy0">/</span><span class="kw2">aclocal</span><span class="sy0">/</span>pkg.<span class="kw2">m4</span> <span class="kw2">aclocal</span></div>
</li>
</ol>
</div>
<p>Thanks to <a href="http://aaronspotlatch.appspot.com/archive/Jul-2008" onclick="urchinTracker('/outgoing/aaronspotlatch.appspot.com/archive/Jul-2008?referer=');">http://aaronspotlatch.appspot.com/archive/Jul-2008</a> and<br />
<a href="http://qslack.com/post/thrift-macosx-104" onclick="urchinTracker('/outgoing/qslack.com/post/thrift-macosx-104?referer=');">http://qslack.com/post/thrift-macosx-104</a> for pointing me in the right direction.</p>
<p>You should now be ready to run make</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">make</span></div>
</li>
</ol>
</div>
<p>and</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
</li>
</ol>
</div>
<p>You should now be able to run thrift on your mac.</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">thrift</div>
</li>
</ol>
</div>
<p>You should now be ready to build your amazing application with Cassandra if both your installation of Cassandra and Thrift were successful.</p>
<p>I will try to post another blog post shortly on using Cassandra, Thrift and PHP. Stay tuned. </p>
<h3>Resources</h3>
<ul>
<li><a href="http://incubator.apache.org/cassandra/" onclick="urchinTracker('/outgoing/incubator.apache.org/cassandra/?referer=');">The Cassandra Project</a></li>
<li><a href="http://wiki.apache.org/cassandra/FrontPage" onclick="urchinTracker('/outgoing/wiki.apache.org/cassandra/FrontPage?referer=');">The Cassandra Wiki</a></li>
<li><a href="http://wiki.apache.org/thrift/FrontPage" onclick="urchinTracker('/outgoing/wiki.apache.org/thrift/FrontPage?referer=');">The Thrift Wiki</a></li>
<li><a href="http://jetfar.com/installing-cassandra-and-thrift-on-snow-leopard-a-quick-start-guide/" onclick="urchinTracker('/outgoing/jetfar.com/installing-cassandra-and-thrift-on-snow-leopard-a-quick-start-guide/?referer=');">http://jetfar.com/installing-cassandra-and-thrift-on-snow-leopard-a-quick-start-guide/</a></li>
<li><a href="http://posulliv.com/?p=149" onclick="urchinTracker('/outgoing/posulliv.com/?p=149&amp;referer=');">Setting up a Cassandra cluster</a></li>
<li><a href="http://www.onemanclapping.org/2009/11/building-cassandra-thrift-bindings-on.html" onclick="urchinTracker('/outgoing/www.onemanclapping.org/2009/11/building-cassandra-thrift-bindings-on.html?referer=');">http://www.onemanclapping.org/2009/11/building-cassandra-thrift-bindings-on.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.klunde.net/2009/11/20/installing-cassandra-and-thrift-on-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
