MongoDB installation process and problem records 1. MongoDB installation Download MongoDB Official address: https://www.mongodb.com/download-center/community You may need to register. I am using Centos7 system, so I chose RHEL7.0 TGZ. You can choose other systems by yourself. If you don't want to register, you can download it here: https://www.mongodb.org/dl/linux Download steps: [root@localhost ~]# curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.6.tgz # Download [root@localhost ~]# tar -zxvf mongodb-linux-x86_64-rhel70-4.2.6.tgz # Unzip [root@localhost ~]# mv mongodb-linux-x86_64-rhel70-4.2.6/ /usr/local/mongodb # Move to /usr/local/mongodb : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : auth=true # Start with permission bind_ip=0.0.0.0 [root@localhost bin]# ./mongod -f ./mongodb.conf # Start MongoDB [root@localhost bin]# ps -ef|grep mongodb # Check the running status root 34125 1 0 09:43 ? 00:00:08 ./mongod -f ./mongodb.conf root 53204 33869 0 10:23 pts/0 00:00:00 grep --color=auto mongodb The running status is as shown in the figure: Visit: 2. MongoDB background startup What we use here is to start MongoDB with the background systemctl First, add MongoDB to the service Write [Unit] Description=redis After=network.target [Service] Type=forking ExecStart=/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/bin/mongodb.conf ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target wq save and exit Then run the following, remember to terminate the previously opened MongoDB process [root@localhost redis-6.0.1]# systemctl enable mongodb.service # Add to boot [root@localhost redis-6.0.1]# systemctl is-enabled mongodb.service # Check whether the boot is successful enabled [root@localhost redis-6.0.1]# systemctl start mongodb # Start mongoDB service [root@localhost redis-6.0.1]# systemctl status mongodb # View mongoDB running status If there is a problem with the startup, you can view the log repair through systemctl status mongodb. As shown in the figure, it has been successfully started. Finally, make a soft connection to facilitate operation [root@localhost bin]# ln -s /usr/local/mongodb/bin/mongo /usr/bin/mongo [root@localhost bin]# mongo MongoDB shell version v4.2.6 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("6924698e-44ae-4d01-a0ab-013210c61330") } MongoDB server version: 4.2.6 > ^C bye The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Native JavaScript to achieve the effect of carousel
>>: Three implementation methods of Mysql copy table and grant analysis
1. Autoflow attribute, if the length and width of...
Replace it with the optimal database connection p...
First, let’s take an example: There is a type fie...
Shell is a program written in C language, which i...
Learning CSS3 is more about getting familiar with...
<br />This section introduces how to impleme...
Table of contents background 1. The query conditi...
I have used the vi editor for several years, but ...
Table of contents Preface 1. Check the file disk ...
Purpose: Under Linux, the server program may be d...
my.cnf is the configuration file loaded when MySQ...
When vue2 converts timestamps, it generally uses ...
A colleague once told me to use a temporary table...
Sometimes it is slow to download large network fi...
Types of joins 1. Inner join: The fields in the t...