国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

How can the Mongodb database service on the server be always enabled by default?
漂亮男人
漂亮男人 2017-05-02 09:23:54
0
2
822

After connecting to the server remotely, start the mongodb service on the server. How to keep the service running after disconnecting the remote connection

漂亮男人
漂亮男人

reply all(2)
大家講道理

Use mongod -f to add the configuration file, set fork=true in it and run it in the background.
My mongo configuration file is in /data/mongo/27017.conf

port=27017 #端口號(hào)                                                                                                                                                                                       
  fork=true #以守護(hù)進(jìn)程的方式運(yùn)行,創(chuàng)建服務(wù)器進(jìn)程
  master=true #單主從配置時(shí)設(shè)為主服務(wù)器
  #salve=true ##單主從配置時(shí)設(shè)為從服務(wù)器
  logpath=/data/mongo/27017/mongo.log #日志輸出文件路徑
  logappend=true #日志輸出方式
  dbpath=/data/mongo/27017 #數(shù)據(jù)庫(kù)路徑
  #replSet=testrs #設(shè)置富本集的名字
  #shardsvr=true #設(shè)置是否分片
  auth=true#是否開(kāi)啟授權(quán)

Run the command mongod -f /data/mongo/27017.conf and it’s done

阿神

Thanks.

If I understand your question correctly, you use ssh to remotely log in to the server and start mongodb; then close the ssh connection and the service stops running.

It is recommended that when starting mongodb, let it run as a daemon process.

mongod adds --fork startup option.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template