---
title: "mongodb自启动"
author: "zlr"
date: "2018-10-31T09:42:19Z"
tags: []
categories: ["数据库"]
slug: "mongodb"
draft: false
lastmod: "2018-10-31T09:42:19Z"
id: 2433011
url: "https://zlr.iteye.com/blog/2433011"
---

https://blog.csdn.net/i_vic/article/details/53466348


http://www.zhimengzhe.com/shujuku/other/158372.html


常用命令：

启动开机服务之前，必须要先启动mongodb服务。确认mongodb服务是否开机启动，需要输入systemctl is-enabled mongodb.service的值是否enabled.

#systemctl start mongodb #启动mongodb服务

#systemctl enable mongodb.service #设置开机启动mongodb服务

#systemctl is-enabled mongodb.service #查看mongodb服务是否设置开机启动
#systemctl disable mongodb.service#停止mongodb服务开机启动