Non-Running CouchDB Testsuite

Just updated my CouchDB install guide as I discovered a problem with the install. Mostly my own fault for not checking the testsuite immediately after I installed but when I came to do that today, after discovering that none of my views worked, and even a temporary view was causing the CPU load on the VM to shoot up, I found that the testsuite wouldn’t run at all and would just lock up the page with high VM CPU load. I found the solution via serverfault under the title “CouchDB 0.11 on Ubuntu 10.04”

So, the solution is basically to shutdown CouchDB, put you  version of xulrunner-devel on your LD_LIBRARY_PATH as follows:

    $ sudo touch /etc/ld.so.conf.d/couchdb.conf
    $ sudo cat > /etc/ld.so.conf.d/couchdb.conf
    /usr/lib/xulrunner-devel-1.9.2.6 (NB. Check the version that you have installed!)
    <CTRL-D>
    $ sudo ldconfig

Now restart CouchDB and run that darn test suite!

Posted
 

CouchDB from Src How-To

Well this was more effort than it should have been. I have been dabbling with Erlang for

Media_httpwwwstrangea_gvfsh
a while, and after struggling with MySQL, Tomcat and JDBC I was looking for an alternative web-app stack. CouchDB looks to be perfect, although sufficiently new that there is not a lot of documentation, both of the books available right now are OK, but not brilliant. In general I prefer the style of CouchDB: The Definitive Guide but prefer the examples from Beginning CouchDB. My personal preference with programming and software tool books is that they should provide detailed, hand-held, speak-to-me-like-I-am-an-imbecile walk-throughs of the most common basic use cases. Anyhow, CouchApp looks like a great way to develop apps for CouchDB, although documentation is fairly sparse. The main problem I found is that the versions of Erlang and CouchDB available from repositories for both Ubuntu and Debian are way behind the cutting edge to the point that the examples in the books won't run. I found that the best way to set up my CouchApp development environment is to completely avoid the repositories and build from source in a clean Ubuntu server VM using the following steps:

  • $ apt-get update
  • $ apt-get clean
  • $ apt-get upgrade

We are going to be building some software so the following tools are useful:

  • $ sudo apt-get install build-essential subversion git-core openssh-server

Install Erlang

Install CouchDB

  • $ sudo apt-get build-dep couchdb
  • $ sudo apt-get install xulrunner-dev libicu-dev libcurl4-gnutls-dev libtool
  • $ wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/couchdb/1.0.0/apache-couchdb...
  • $ tar zxvf apache-couchdb-1.0.0.tar.gz
  • $ cd apache-couchdb-1.0.0
  • $ ./configure
  • $ ./configure --with-js-lib=/usr/lib/xulrunner-devel-1.9.2.3/lib --with-js-include=/usr/lib/xulrunner-devel-1.9.2.3/include
  • $ make CouchDB
  • $make
  • $sudo make install

Final Setup & Running CouchDB

  • $ adduser --system --home /usr/local/var/lib/couchdb --no-create-home --shell /bin/bash --group --gecos "CouchDB Administrator" couchdb
  • $ sudo chown -R couchdb:couchdb /usr/local/etc/couchdb
  • $ sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
  • $sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
  • $sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
  • $sudo chmod -R 0770 /usr/local/etc/couchdb
  • $sudo chmod -R 0770 /usr/local/var/lib/couchdb
  • $sudo chmod -R 0770 /usr/local/var/log/couchdb
  • $sudo chmod -R 0770 /usr/local/var/run/couchdb
  • $ sudo ln -s /usr/local/etc/init.d/couchdb /etc/init.d/couchdb

Put xulrunner-devel on your LD_LIBRARY_PATH

  • $ sudo touch /etc/ld.so.conf.d/couchdb.conf
  • $ sudo cat > /etc/ld.so.conf.d/couchdb.conf
  • /usr/lib/xulrunner-devel-1.9.2.6 (NB. Check the version that you have installed!)
  • <CTRL-D>
  • $ sudo ldconfig

Running CouchDB Manually

  • $ sudo -i -u couchdb couchdb

Running CouchDB As a Daemon

  • $ sudo /etc/init.d/couchdb start
Posted
 

Beginning CouchDB Errata

Whilst I am on the subject of CouchApps, there is a typo in code listing 10-4 on page 171 of Beginning CouchDB which causes the javascript to not work. Specifically, if you get a message along the following lines in your browser’s error console:

    $.CouchApp is not a function

You can fix this by  making an edit at the bottom of listing 10-4, in the last <script> line it should read:

<script src="vendor/couchapp/jquery.couch.app.js"></script>


instead of:

<script src="vendor/couchapp/jquery.couchapp.js"></script>


Notice the missing period between couch and app? Enough to stump a beginner for hours!

Addendum #1 – A missing $ in listing 10-6 for main.js on page 176 in the parseInt line:

var task_count = parseInt('#task_count span').html(), 10);


should be:

var task_count = parseInt($('#task_count span').html(), 10);

Posted
 

The Conversational Web

Some of my more recent research has been into new, or at least improved, ways to make the web a more conversational place. In one sense it already is, we can link to stuff and we can comment on posts. This isn't always sufficient though. In reverse order, not all sites support commenting and even when they do comment support on websites can still be done better than it is right now as it can be difficult to mine, evaluate and analyse the insightful comments. I feel that a web conversation works better when it is a part of the Web, a strand of conversation that interleaves the various sites spread across the web leading a person, whether a spectator or part of the conversation, to engage in chance discovery. Linking is the primary structure of the web. Hyperlinks enable us to create uni-directional links between one site and another, so that when we wish to refer to another site, for example, when commenting in our own blog upon a claim made in another, we link to that originating source site. These links are only one way however, so I can refer to another site, but they have to respond to me if the conversation is to be reciprocal. This does not however stop any other web users from responding to my post in any way that they see fit. This gives us a very egalitarian system, with minimal structure, in which the web itself supports conversation - it is up to the conversation's participants to engage in it and make it happen. A nice example of this kind of web conversation occurred with the recent discussion between John Gruber of Daring Fireball and Joe Wilcox of Oddly Together. This spat basically boiled down to the suggestion by Joe that Daring Fireball should allow comments on posts because otherwise Joe has to respond to Daring Fireball posts on his own blog and John's response that "you write on your site; I write on mine". I think that that is exactly how it should be and that the web is a better place for it. I think that comments enable an immediacy of response but they don't guarantee that your response will stay in place. The only way to ensure that your response stays online is to post it in a place that you control with a link back to the original. Even better, if those two hadn't disagreed then I wouldn't have discovered this post about "Conversational Journalism" by Doreen Marchionni which to me echoes the argument that Alan Rusbridger made in his Hugh Cudlipp lecture (which I commented upon before). There are also many sites that are primarily designed to support conversation such as the Web 2.0 sites like Twitter but for the most part these lead us into a walled garden, with poor support for conversational threads and, due to the limitations of microblogging, the increased use of link shorteners which, whilst not breaking the links in the web, certainly weaken its structural integrity. From the perspective of the Twitter business this makes sense, the lock-in part anyway, you want to be the only game in town, but from the perspective of the web, this is a systemic weakness because a huge portion of web traffic, much of the web conversation, is occurring on a single site, a single point of failure. This is not to say that I am "against" Twitter, far from it, I like the idea of microblogging and to me it provides the basis, but not a complete solution, for enhanced distributed web conversation. It is just that I prefer open and distributed systems to closed and proprietary ones - mainly because when things break, and things always break, you can't fix them, you have to wait for someone else to do that. The next stages, as I see it, are twofold:

  1. to provide aggregation mechanisms so that we can get different views on the conversations, for example, following it in whichever direction we like, instead of just following the uni-directional links, or exploring a particular sub-thread of the conversation.
  2. to provide new tools to make it easier to engage in the conversation.

The first stage can be accomplished by building upon the Argument Interchange Format, at least in the guise offered by its second version which includes support for dynamic argumentation structures, including dialogues, rather than just static, monological argument. By utilising open, distributed, web-conversation repositories to store meta-information about the relationships between conversational utterances, much like trackbacks and pings enable a form of bi-directional linking, we can start to build new interfaces to engage with and track the web conversation. The second stage will be accomplished by the tool-builders, a process that is partly happening already with the advent of tools to enable Twitter users to tweet from wherever they want and with new and improved blogging and microblogging platforms such as Tumblr and Posterous making it easy to create short posts as a part of the web conversation.

Posted