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
This article example shares the specific code of ...
In order to solve the problem mentioned last time...
The :not pseudo-class selector can filter element...
1. Cause: The effect after the subbox is set to f...
I always thought that Docker had no IP address. I...
What is HTTP? When we want to browse a website, w...
<br />Original text: http://andymao.com/andy...
1. Background The following two problems are enco...
Tomcat is widely known as a web container. It has...
This is because the database server is set to aut...
I have nothing to do recently, so I tinker with C...
1. Introduction In the past, if you wanted to emp...
Preface Every good habit is a treasure. This arti...
ps: The environment is as the title Install possi...
Table of contents Prerequisites RN passes value t...