INIT scripts missing with 3.4 RHEL 7 distribution

45 views
Skip to first unread message

Antony Raj Chinnappan

unread,
Mar 13, 2017, 10:47:33 PM3/13/17
to mongodb-user
Hi 

I have recently downloaded MongoDB 3.4 tarball and installed on a three node replica set. I do not find mongod init scripts with this distribution.
Has anyone encountered the same issue?
I am running 3.4 on RHEL 7

Thanks

Stephen Steneker

unread,
Mar 15, 2017, 2:37:40 AM3/15/17
to mongodb-user

Hi Antony,

Tarball distributions currently only include binary files and license notices. Service definitions and initial config files are are part of the packaged installs (eg. RPMs for RHEL).

I would recommend installing MongoDB with RPM packages rather than tarballs to make it easier to update in future with yum: Install MongoDB Community Edition on Red Hat Enterprise or CentOS Linux.

However, if you prefer to manually download configuration files you can find service definitions and an example mongod.conf file in the GitHub rpm directory: https://github.com/mongodb/mongo/tree/master/rpm.

Regards,Stennie

Rodrigo Nascimento

unread,
Mar 15, 2017, 10:51:14 PM3/15/17
to mongodb-user
Hi Antony,

You can create your own systemctl service files. Here is an example:

[root@devbox ~]# cat /usr/lib/systemd/system/mongodb.service 

[Unit]

Description=MongoDB s1

After=network.target

Documentation=https://docs.mongodb.org/manual


[Service]

User=mongod

Group=mongod

Environment="OPTIONS=--quiet -f /mongodb/replset01/s1/conf/mongod.conf"

ExecStart=/usr/bin/mongod $OPTIONS run

PermissionsStartOnly=true

PIDFile=/mongodb/replset01/s1/run/mongod.pid

# file size

LimitFSIZE=infinity

# cpu time

LimitCPU=infinity

# virtual memory size

LimitAS=infinity

# open files

LimitNOFILE=64000

# processes/threads

LimitNPROC=64000

# total threads (user+kernel)

TasksMax=infinity

TasksAccounting=false

# Recommended limits for for mongod as specified in

# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings


All the best,

Logwriter
Reply all
Reply to author
Forward
0 new messages