Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win10下部署报错:Operation not permitted, terminating #7

Closed
reuwi opened this issue Jun 1, 2018 · 4 comments
Closed

win10下部署报错:Operation not permitted, terminating #7

reuwi opened this issue Jun 1, 2018 · 4 comments

Comments

@reuwi
Copy link

reuwi commented Jun 1, 2018

2018-06-01T09:01:02.494+0000 I -        [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 277

easy-mock-docker_mongodb_1 exited with code 100
@DuanPengfei
Copy link
Collaborator

DuanPengfei commented Jun 11, 2018

提供下

  • 系统版本
  • Docker 版本
  • 使用子系统还是直接 Windows 版本 Docker
  • easy-mock 镜像版本

我们看看是否可以复现。

@reuwi
Copy link
Author

reuwi commented Jun 12, 2018

@DuanPengfei 使用的Windows 版本 Docker,貌似是因为Mongodb 不支持直接映射,只能使用具名volume

The default Docker setup on Windows and OS X uses a VirtualBox VM to host the Docker daemon. Unfortunately, the mechanism VirtualBox uses to share folders between the host system and the Docker container is not compatible with the memory mapped files used by MongoDB (see vbox bug, docs.mongodb.org and related jira.mongodb.org bug). This means that it is not possible to run a MongoDB container with the data directory mapped to the host.

@CoinXu
Copy link

CoinXu commented Jun 22, 2018

windows下只能使用volume,不能直接bind磁盘。

  1. 创建volume
docker volume create mongodata
docker volume create redisdata
docker volume create logsdata
  1. docker-compose.yml修改如下
version: "3.3"
services:
  mongodb:
    image: mongo:3.4
    volumes:
      - type: volume
        source: mongodata
        target: /data/db
  redis:
    image: redis:4.0.6
    command: redis-server --appendonly yes
    volumes:
      - type: volume
        source: redisdata
        target: /data
  web:
    image: easymock/easymock:1.5.1
    command: /bin/bash -c "npm start"
    links:
      - mongodb:mongodb
    ports:
      - 7300:7300
    volumes:
      - type: volume
        source: logsdata # 日志地址,根据需要修改为本地地址
        target: /home/easy-mock/easy-mock/logs
      - type: bind
        source: ./production.json # 配置地址,请使用本地配置地址替换
        target: /home/easy-mock/easy-mock/config/production.json

# 一定要声明volumes
volumes:
  mongodata:
    external:
      name: mongodata
  redisdata:
    external:
      name: redisdata
  logsdata:
    external:
      name: logsdata
  1. 删除production.js中的db配置
  2. 运行docker-compose up -d

@DuanPengfei
Copy link
Collaborator

@CoinXu 感觉可以提个 PR 直接升级下原项目的 docker-compose 了,这样就可以尽最大可能兼容各种场景,让大家真正做到开箱即用😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants