Mongod restart on system reboot Linux 18

Hello,

Like we did load service auto start in rc.local file. What is the best way for autostart all the services at system reboot in Linux 18.

I have multiple mongod services running at one Linux Node.

HI @Aayushi_Mangal,

Please provide more details on your environment:

  • What specific Linux distro and version are you referring to as Linux 18?

  • What service manager are you using?

Most modern Linux distros use systemd for service management and init scripts, with the older SysV-style init (/etc/rc.local) only existing for backwards compatibility. Configuring and managing services isn’t specific to MongoDB, so tutorials for managing other services for your O/S should be applicable.

Note: running multiple MongoDB services on a single host without any sort of containers or resource management (lxc, cgroups, Docker, etc) generally isn’t recommended as all processes will be competing for the same resources.

Regards,
Stennie

Hi @Stennie_X,

Thank you so much for your refrence.

we are using this:
18.04.4 LTS (Bionic Beaver)

I have started my service as:
/usr/bin/numactl --interleave=all mongod --config

I am not getting where to place this so it will start automatically, like we did earlier in rc.local file.
As we have multiple mongo services, how to define all those with this NUMA enabled.

This is resolved:

Created service file and define in that that is working on reboot. inside this parameter: ExecStart