Ubuntu18 tgz 包 安装 mongodb

安装参考教程

https://www.jianshu.com/p/8d9ad75524f9

异常

缺少依赖库

关键信息:No such file or directory

bei@bei-pc:/usr/local/lib/mongodb/mongodb/bin$ mongod
mongod: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory

安装 libcurl4-openssl-dev

sudo apt-get install libcurl4-openssl-dev

权限问题

异常描述:执行 mongod 出现如下提示。

关键信息:exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /data/db

bei@bei-pc:/usr/local/lib/mongodb/mongodb/bin$ mongod
2019-09-22T23:12:48.708+0800 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-09-22T23:12:48.712+0800 I  CONTROL  [initandlisten] MongoDB starting : pid=4791 port=27017 dbpath=/data/db 64-bit host=bei-pc
2019-09-22T23:12:48.712+0800 I  CONTROL  [initandlisten] db version v4.2.0
2019-09-22T23:12:48.712+0800 I  CONTROL  [initandlisten] git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
2019-09-22T23:12:48.712+0800 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten] allocator: tcmalloc
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten] modules: none
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten] build environment:
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten]     distmod: ubuntu1804
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten]     distarch: x86_64
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten]     target_arch: x86_64
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten] options: {}
2019-09-22T23:12:48.713+0800 I  STORAGE  [initandlisten] exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /data/db, terminating
2019-09-22T23:12:48.713+0800 I  NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-09-22T23:12:48.713+0800 I  NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-09-22T23:12:48.713+0800 I  -        [initandlisten] Stopping further Flow Control ticket acquisitions.
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten] now exiting
2019-09-22T23:12:48.713+0800 I  CONTROL  [initandlisten] shutting down with code:100
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容