1.默认启动方式并设置相应的参数:
sudo mongod --path yourDBpath --httpinterface ......
2.通过设置文件启动:
先设置启动文件:/etc/mongod.conf:
sudo vi /etc/mongod.conf
下面是我的设置内容,共参考:
warrior@warrior:~$ cat /etc/mongod.conf
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /usr/local/mongodb/data/db
journal:
enabled: true
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /usr/local/mongodb/mongod.log
# network interfaces
net:
port: 27017
bindIp: 202.206.212.151
#processManagement:
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
配置好文件内容后,启动:
sudo mongod --config /etc/mongod.conf
mongodb数据库备份好删除:http://www.linuxdiyf.com/linux/16362.html
在Ubuntu中安装MongoDB:http://www.linuxdiyf.com/linux/15917.html
fedora 22 MariaDB:http://www.linuxdiyf.com/linux/15398.html
在Linux中怎样将MySQL迁移到MariaDB上:http://www.linuxdiyf.com/linux/14127.html
15个有用的MySQL/MariaDB性能调整和优化技巧:http://www.linuxdiyf.com/linux/12780.html