简体   繁体   中英

Mongodb server Start after MongoServer.Shutdown()

What is the opposite function to MongoServer.Shutdown()? Unlike Disconnect, Shutdown actually shuts down the server. I want to programmatically boot up the server after I shut it down. MongoServer.Create() seems to only create an instance of a connection to the server. It doesn't actually boot up the server if it's been shut down.

Any ideas?

The shutdown command connects to the server and tells it to shutdown. If there is no running server, you can't connect to it to tell it to start!

To start the server from your C# program, you could just start the mongod process, by using the System.Diagnostics.Process class for example.

在Windows机器和作为服务安装的mysql上,您可以尝试启动服务器。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM