stripe-archive / mosql

MongoDB → PostgreSQL streaming replication
MIT License
1.62k stars 224 forks source link

mosql with Monit #86

Closed Rockyyost closed 9 years ago

Rockyyost commented 9 years ago

I'd like to leave mosql running in production to continue tailing, but, for some reason, after a day or two, it just stops all together. I could use Monit to check on the process and restart it when it needs to.

Has anyone used Monit with mosql? The way I've used Monit before, it requires a pid file. I cannot find mosql's pid file. Does mosql create a pid file?

nelhage commented 9 years ago

Hi,

I strongly recommend running MoSQL with some sort of process management. MoSQL responds to a large variety of transient errors by just exiting, with the assumption that a process manager will restart it. We use daemontools at Stripe, which is unfortunately a slightly unusual choice.

MoSQL doesn't support pid files. In general I recommend a process manager that obviates the need for pidfiles, such as by not daemonizing the child and remaining monitoring it directly.