• mongoDB安装报错:exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /data/db, terminating


    错误信息如下:

    2018-07-06T23:28:54.978+0800 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten] MongoDB starting : pid=14447 port=27017 dbpath=/data/db 64-bit host=wangmengxideMacBook-Pro.local

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten] db version v4.0.0

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten] git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten] allocator: system

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten] modules: none

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten] build environment:

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten]     distarch: x86_64

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten]     target_arch: x86_64

    2018-07-06T23:28:55.092+0800 I CONTROL  [initandlisten] options: {}

    2018-07-06T23:28:55.107+0800 I STORAGE  [initandlisten] exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /data/db, terminating

    2018-07-06T23:28:55.115+0800 I CONTROL  [initandlisten] now exiting

    2018-07-06T23:28:55.115+0800 I CONTROL  [initandlisten] shutting down with code:100

     

    原因是:

    对于文件夹 /data/db 没有操作权限,目前这个文件夹只有只读权限

     

    解决办法

    确保/data/db目录在bin文件夹下,如果不在的话,可以cd到bin文件夹,再修改文件夹权限

    bin xxx$ sudo chomd -R /data/db

  • 相关阅读:
    HDU5794 A Simple Chess 容斥+lucas
    HDU5790 Prefix 字典树+主席树
    HDU5787 K-wolf Number 数位dp
    HDU5758 Explorer Bo 树形dp
    HDU5764 After a Sleepless Night 树形乱搞题
    HDU5780 gcd (BestCoder Round #85 E) 欧拉函数预处理——分块优化
    HDU5779 Tower Defence (BestCoder Round #85 D) 计数dp
    HDU 5778 abs (BestCoder Round #85 C)素数筛+暴力
    HDU5777 domino (BestCoder Round #85 B) 思路题+排序
    poj 1185 状态压缩
  • 原文地址:https://www.cnblogs.com/x1mercy/p/9276340.html
Copyright © 2020-2023  润新知