Skip to content

restarting beanstalk

icydee edited this page Dec 29, 2012 · 3 revisions

Installing Beanstalk

Beanstalk is easy to set up from source. (as root)

$ cd /data/Lacuna-Server
$ git clone git://github.com/kr/beanstalkd.git
$ cd beanstalkd
$ make
$ make install

Beanstalk should be started thus

$ beanstalkd >>/tmp/beanstalkd.log 2>>/tmp/beanstalkd.log </dev/null & disown

This will create a detached process. To stop it you need to search the process list, obtain the pid and kill it.

You need to add the following into your etc/lacuna.conf file

  "beanstalk" : {
      "debug" :         0,
      "server" :        "localhost",
      "ttr" :           120,
      "max_timeouts" :  10,
      "max_reserves" :  10
  },

(this can be next to a similar setup for memcache)

the server specifies the server on which the beanstalk process is running. If all your TLE is on one server then this can just be 'localhost'.

You also need to start up the schedule_daemon as follows.

$ cd /data/Lacuna-Server/bin
$ perl schedule_daemon.pl --noquiet >>/tmp/schedule_daemon.log 2>>/tmp/schedule_daemon.log

This may take a few minutes to start. When it starts it deletes all old schedule entries in the database, cleans out the beanstalk job queue then recreates it from all of the building tasks.

You can stop the schedule_daemon (it should always be stopped then restarted when you do a code update) as follows.

$ kill -INT `cat /data/Lacuna-Server/bin/schedule_daemon.pid