How to build MongoDB Database in Centos system
This article mainly introduces the relevant knowledge of "how to build MongoDB database in Centos system". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to build MongoDB database in Centos system" can help you solve the problem.
Deploy docker search mongo in Docker mode # View mongodb available images
Download image docker pull mongo:latest
Check whether the download is successful, and check the dockers image docker images
Run docker container docker run-itd-- name mongo-p 27017 itd 27017 mongo-- auth parameter resolution-- auth # password is required to access the container
Data persistence
Because the container itself does not persist any data, closing is equal to initialization, so the persistent data needs to be mounted to the host
Docker run-itd-- name mongo-v / home/mongodata:/data/db-p 27017name mongo 27017 mongo-- auth's introduction on "how to build MongoDB database in Centos system" ends here. Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.