From cece4eae36f72767fe107b5ce1e015d9ac9548dd Mon Sep 17 00:00:00 2001 From: Matt Schallert Date: Fri, 28 Sep 2018 14:29:46 -0400 Subject: [PATCH] [integrations] systemd: add systemd unit example (#970) Users will likely have to change this to reflect where their binaries are located, but provides a base example. Fixes #959. --- docs/how_to/cluster_hard_way.md | 2 ++ integrations/systemd/m3dbnode.service | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 integrations/systemd/m3dbnode.service diff --git a/docs/how_to/cluster_hard_way.md b/docs/how_to/cluster_hard_way.md index 56b1d59cab..ff78bdfc9e 100644 --- a/docs/how_to/cluster_hard_way.md +++ b/docs/how_to/cluster_hard_way.md @@ -61,6 +61,8 @@ your_m3db_user hard nofile 500000 your_m3db_user soft nofile 500000 ``` +Alternatively, if you wish to have `m3dbnode` run under `systemd` you can use our [service example](https://github.com/m3db/m3/tree/master/integrations/systemd/m3dbnode.service) which will set sane defaults. + Before running the process make sure the limits are set, if running manually you can raise the limit for the current user with `ulimit -n 500000`. ## Config files diff --git a/integrations/systemd/m3dbnode.service b/integrations/systemd/m3dbnode.service new file mode 100644 index 0000000000..d20966ad8d --- /dev/null +++ b/integrations/systemd/m3dbnode.service @@ -0,0 +1,15 @@ +[Unit] +Description="M3DB Timeseries Database" +Documentation=http://m3db.github.io/m3/ +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/m3dbnode +Restart=on-failure +RestartSecs=10s +SuccessExitStatus=0 +LimitNOFILE=500000 + +[Install] +WantedBy=multi-user.target