Thursday, March 22, 2012

Linux Shell Output Redirect

If you like to run a program in total silence and write every output to a file of your choice use:
YOURCOMMAND &> YOURFILE
This will redirect everything to the specified file.
Helps for cronjobs or huge output generators like Hadoop.

Tuesday, March 13, 2012

CouchDB Lucene: Connection refused

Yesterday a got the following exception from my couchdb:
Traceback (most recent call last):
  File "/opt/couchdb-lucene-0.7-SNAPSHOT/tools/couchdb-external-hook.py", line 40, in main
    resp = respond(res, req, opts.key)
  File "/opt/couchdb-lucene-0.7-SNAPSHOT/tools/couchdb-external-hook.py", line 81, in respond
    res.request(method, path, headers=req_headers)
  File "/usr/lib/python2.6/httplib.py", line 914, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 951, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 908, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 780, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 739, in send
    self.connect()
  File "/usr/lib/python2.6/httplib.py", line 720, in connect
    self.timeout)
  File "/usr/lib/python2.6/socket.py", line 561, in create_connection
    raise error, msg
error: [Errno 111] Connection refused
Because it worked like a charme for six month until now, I got pretty depressed. To solve the issue a begun to randomly search the web for this stack trace of my lucene view. But I could not find anything useful until now. After reading the third tutorial about how to setup lucene with couchdb, I figured out that the couchdb-lucence is not running anymore. Therefore after restarting the couchdb-lucene daemon everything works fine again.

Just execute this to start your couchdb-lucene again

    nohup /opt/couchdb-lucene-0.7-SNAPSHOT/bin/run &