• 查看开机启动项

ls /etc/systemd/system/multi-user.target.wants/

  • 设置开机启动

systemctl enable mongodb.service