MongoDB is cross-platform and can be installed on both Windows and Linux. Here we focus on the installation of MongoDB under Linux. ** 1.MongoDB provides 64-bit installation packages for various Linux distributions. You can download the installation package from the official website. curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.12.tgz It took me 27 minutes to download. . . . 2. The default download path is to the Downloads directory under the user directory, unzip it tar -zxvf mongodb-linux-x86_64-3.2.12.tgz 3. Move the unzipped folder to the mongodb directory in /usr/local/ mv mongodb-linux-x86_64-3.2.12 /usr/local/mongodb 4. Configure system profile sudo vi /etc/profile Insert the following: export MONGODB_HOME=/usr/local/mongodb export PATH=$PATH:$MONGODB_HOME/bin Note: vi is the input command. When you see the page below, press the "i" arrow on the keyboard to enter the input mode, and then copy the above command. Then press esc to switch to command mode and enter: wq to save and exit Note that you need to restart the system configuration after saving: 5. Create a folder for storing data and log files, and modify its permissions to add read and write permissions cd /usr/local/mongodbsudo mkdir -p data/dbsudo chmod -r 777 data/dbsudo mkdir logscd logstouch mongodb.log 6. Mongodb startup configuration Go to the bin directory and add a configuration file: cd /usr/local/mongodb/bin sudo vi mongodb.conf As mentioned above, the vi command is to write content. Enter i to enter the write mode. After writing, press esc to enter the command mode and enter :wq to save and exit. dbpath = /usr/local/mongodb/data/db #Data file storage directory logpath = /usr/local/mongodb/logs/mongodb.log #Log file storage directory port = 27017 #Port fork = true #Enable as a daemon, i.e. run in the background nohttpinterface = true 7. Start the mongod database service and start it with the configuration file cd /usr/local/mongodb/bin./mongod -f mongodb.conf 8. Connect to mongodb database Summarize The above is the tutorial on installing mongodb under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: An article to quickly understand Angular and Ionic life cycle and hook functions
>>: MySQL 5.7.19 winx64 free installation version configuration tutorial
Preface: Due to my work, I am involved in the fie...
Table of contents 1. Installation 2. Use Echarts ...
1. Introduction MySQL comes with a replication so...
Look at the code first #/bin/sh datename=$(date +...
Here are the types of data that can be verified l...
Table of contents 1. Animated Christmas Tree Made...
Before officially using Docker, let's first f...
As a Vue user, it's time to expand React. Fro...
The idea of using token for login verification ...
Note: Since .NET FrameWork cannot be run in core ...
one. Remote deployment using tomcat 1.1 Problems ...
You can have the best visual design skills in the...
Sometimes you need to use links, but you don't...
Docker Learning https://www.cnblogs.com/poloyy/p/...
MySql 8.0 corresponding driver package matching A...