MongoDB installation, simple and quick configuration startup
- Go to the official website to download the MongoDB package (tar)
- Unpack the tar packages
- Go to the data folder and create the data folder and logs folder. Create the DB folder in the data folder and create the mongologs. log file in the logs folder
mkdir data
mkdir logs
cd data
mkdir db
cd ..
cd logs
touch mongoLogs.log
cd ..
Copy the code
- Create a mongodb. Conf file in the current folder and write the configuration.
touch mongodb.conf
vim mongodb.conf
#Configure the contentPort = 27017 dbpath = $storage directory/mongo/data/db logpath = $storage directory/mongo/logs/mongoLogs log logappend = true fork = trueCopy the code
- Start:./bin/mongod –config mongodb