Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MongoDB4.0 installation

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. Environment

Operating system installation package installation Ubuntu18.04mongodb4.0apt installation Ubuntu18.04mongodb4.0docker installation

II. Apt installation

Sudo apt-key adv-keyserver hkp://keyserver.ubuntu.com:80-recv 9DA31620334BD75D9DCB49F368818C72E52529D4echo "deb [arch=amd64] http://mirrors.aliyun.com/mongodb/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee / etc/apt/sources.list.d/mongodb-org-4.0.listsudo apt-get updatedeb [arch=amd64] http://mirrors.aliyun.com/mongodb/apt/ubuntu bionic/mongodb-org/4.0 multiversesudo service mongod startps aux | grep mongod

III. Docker installation

Docker pull mongo:4docker run-p 27017 mongo:4 27017-v $PWD/db1:/data/db-d mongo:4

Use-p to map port 27017 of the container to port 27017 of the host

Use-v to mount the db folder of the current path of the host to the container and persist the data to the host.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report