“Docker mongo”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
 
(未显示同一用户的7个中间版本)
第1行: 第1行:
 +
Note 还不够完善哦
 +
=install  =
 +
<pre>
 +
#Sep 23 2021
 +
vi  docker-compose.yml
 +
 +
version: "3.1"
 +
services:
 +
 +
  mongodb:
 +
    image: mongo:4.2
 +
    container_name: mongodb4.2
 +
    ports:
 +
      - "27018:27017"
 +
      #- "27017-27019:27017-27019"
 +
    volumes:
 +
      #- /Users/Pie/docker-lnmp/conf/mongodb/:/etc/mongo/:rw
 +
      - ./mongodb/config/:/etc/mongo/
 +
      #- ./mongodb/config/mongod.conf:/etc/mongo/mongod.conf
 +
      - /data/db_data/mongodb/:/data/db/:rw
 +
      #- /data/db_data/mongodb/:/var/lib/mongo/:rw
 +
      - /data/log/mongodb/:/var/log/mongodb/:rw
 +
    environment:
 +
      #设置后台登录用户和密码,没设置默认为:guest/guest
 +
      MONGO_INITDB_ROOT_USERNAME: "root"
 +
      MONGO_INITDB_ROOT_PASSWORD: example36
 +
      TZ: "Asia/Shanghai"
 +
    restart: always
 +
    command: --config /etc/mongo/mongod.conf
 +
    networks:
 +
      - default
 +
 +
 +
 +
 +
err
 +
mongodb4.2 | 2021-09-23T10:33:04.391+0800 F  CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/var/log/mongodb/mongod.log"
 +
 +
chmod  -R 0777  /data/log/mongodb/
 +
 +
 +
 +
 +
 +
 +
  
<pre>
 
  
 
cat  docker-compose.yml  
 
cat  docker-compose.yml  
第26行: 第71行:
 
</pre>
 
</pre>
  
 +
[https://juejin.cn/post/6981423847819968543  使用 Docker Compose 安装 MongoDB ]
  
 +
[https://linuxhint.com/docker_compose_mongodb/ Docker-Compose MongoDB]
 +
 +
[https://www.jianshu.com/p/e48cbdd22d0e docker-compose安装mongodb说明]
 +
 +
[https://www.jianshu.com/p/e48f0ec7a322 docker-compose 安装mongo]
  
  
第51行: 第102行:
 
[http://www.runoob.com/docker/docker-install-mongodb.html Docker 安装 MongoDB]
 
[http://www.runoob.com/docker/docker-install-mongodb.html Docker 安装 MongoDB]
  
 +
[https://www.cxyzjd.com/article/qq_35868811/106398578 docker-compose 搭建 mongo+mongo-express]
 +
 +
=see also=
 +
 +
[https://blog.csdn.net/shenchen8274/article/details/119759866  docker-compose部署mongodb集群]
 +
 +
[https://www.toimc.com/use-docker-install-common-database/ 使用docker&docker-compose创建常见的数据库(MySQL/Postgres/MongoDB) ]
  
 
=on pi3=
 
=on pi3=
第60行: 第118行:
  
 
[http://sillycat.iteye.com/blog/2320436 MongoDB Docker and Raspberry Pi]
 
[http://sillycat.iteye.com/blog/2320436 MongoDB Docker and Raspberry Pi]
 +
 +
[[category:nosql]] [[category:devops]]

2021年9月29日 (三) 08:16的最新版本

Note 还不够完善哦

install

#Sep 23 2021
vi  docker-compose.yml 

version: "3.1"
services:

  mongodb:
    image: mongo:4.2
    container_name: mongodb4.2
    ports:
      - "27018:27017"
      #- "27017-27019:27017-27019"
    volumes:
      #- /Users/Pie/docker-lnmp/conf/mongodb/:/etc/mongo/:rw
      - ./mongodb/config/:/etc/mongo/
      #- ./mongodb/config/mongod.conf:/etc/mongo/mongod.conf
      - /data/db_data/mongodb/:/data/db/:rw
      #- /data/db_data/mongodb/:/var/lib/mongo/:rw
      - /data/log/mongodb/:/var/log/mongodb/:rw
    environment:
      #设置后台登录用户和密码,没设置默认为:guest/guest
      MONGO_INITDB_ROOT_USERNAME: "root"
      MONGO_INITDB_ROOT_PASSWORD: example36
      TZ: "Asia/Shanghai"
    restart: always
    command: --config /etc/mongo/mongod.conf
    networks:
      - default




err 
mongodb4.2 | 2021-09-23T10:33:04.391+0800 F  CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/var/log/mongodb/mongod.log"

chmod  -R 0777  /data/log/mongodb/









cat  docker-compose.yml 
version: "3"
services:
  mongodb:
    image: mongo:4.2
    container_name: mongodb4.2
    ports:
      - "27017-27019:27017-27019"
    volumes:
    #  - /Users/Pie/docker-lnmp/conf/mongodb/:/etc/mongo/:rw
      - /data/db_data/mongodb/:/data/db/:rw
      - /data/log/mongodb/:/var/log/mongodb/:rw
    environment:
      #设置后台登录用户和密码,没设置默认为:guest/guest
      MONGO_INITDB_ROOT_USERNAME: "root"
      MONGO_INITDB_ROOT_PASSWORD: example36
      TZ: "Asia/Shanghai"
    restart: always
    networks:
      - default


使用 Docker Compose 安装 MongoDB

Docker-Compose MongoDB

docker-compose安装mongodb说明

docker-compose 安装mongo


Docker版MongoDB的安装

基于Docker的MongoDB实现授权访问

利用 Docker 运行 MongoDB

MongoDB在Docker中的部署

MongoDB

MongoDB基本使用

MongoDB 教程

MongoDB教程

安装和使用MongoDB

手把手教你 MongoDB 的安装与详细使用

Docker 安装 MongoDB

docker-compose 搭建 mongo+mongo-express

see also

docker-compose部署mongodb集群

使用docker&docker-compose创建常见的数据库(MySQL/Postgres/MongoDB)

on pi3

https://github.com/matteoredaelli/docker-mongodb-rpi

树莓派3B 使用 Docker 安装 MongoDB

MongoDB Docker and Raspberry Pi