Index ¦ Archives ¦ RSS

Deploying a Thrift Server with Capistrano

At the time of writing, I couldn't find an existing Capistrano recipe for deploying thrift servers. So here is an example that works with ubuntu.

Before you use the recipe, don't forget to update the configuration options to match your server setup. At the very least, you will need to update the following:

  • :application
  • :repository
  • :user
  • :super_user
  • :app_port
  • role :app

Note that the recipe assumes a system-wide rvm install. :user does not need to be a sudoer, but :super_user must be. This is arranged as such for security purposes, since the server process will be owned by :user. The super user is used to create the Upstart job.

Finally, execute

$ cap deploy:setup
$ cap deploy

to setup and deploy your thrift server.

Upstart

During cap deploy:setup, the recipe creates an Upstart job using the template at config/thrift_app.conf. This allows Upstart to launch and monitor your thrift server. You can use other monitoring tools if you like. Just update the deploy:setup task appropriately.

Thor

To play with the Thrift server, launch it as follows:

$ bundle exec bin/my-application server

Then create a new client as follows:

$ bundle exec bin/my-application client
> ping
pong!

© James Lim. Built using Pelican. Theme by Giulio Fidente on github.