因此,我已经在Ubuntu上安装了MongoDB Community Edition,遵循here提供的说明。Ubuntu更改mongoDB的位置导致连接失败(操作不允许)
我成功测试了我的连接,首先启动该服务,然后使用任何客户端进行连接。 (robomongo和umongo)。
现在由于我的工作类型,我将存储GB文件到我的机器。因此我需要改变mongoDB的位置。因此,我采取了以下步骤:(提到here以及):
步骤1: 打开mongod.conf
在\etc
步骤2:
编辑路径deired之一。我的新路径如下
dbPath: /home/shouman/mongodb
步骤3:复制从旧路径到新的路径数据
步骤4:更新新目录权限递归777
现在我似乎无法启动mongoDB之后。我查了日志文件,在/var/log/mongodb/mongod.lod
而且似乎如下面提到
/home/shouman/mongodb/WiredTiger.wt
现在你可以看到从
- MongoDB的几点注意事项现在看到的新位置是一个权限问题。 (这也创造了两个锁文件)
- 我检查的许可此特定的文件,它似乎确定(检查在结尾处的画面)
- 我试图重新启动的MongoDB,但仍同样的问题
这里全日志输出
2017-04-17T18:19:59.466+0300 I CONTROL [main] ***** SERVER RESTARTED *****
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] MongoDB starting : pid=3374 port=27017 dbpath=/home/shouman/mongodb 64-bit host=shouman-Lenovo-IdeaPad-Y500
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] db version v3.4.3
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] git version: f07437fb5a6cca07c10bafa78365456eb1d6d5e1
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] allocator: tcmalloc
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] modules: none
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] build environment:
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] distmod: ubuntu1604
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] distarch: x86_64
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] target_arch: x86_64
2017-04-17T18:19:59.471+0300 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1", port: 27017 }, storage: { dbPath: "/home/shouman/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log", quiet: true } }
2017-04-17T18:19:59.503+0300 I - [initandlisten] Detected data files in /home/shouman/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-04-17T18:19:59.503+0300 I STORAGE [initandlisten]
2017-04-17T18:19:59.503+0300 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-04-17T18:19:59.503+0300 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-04-17T18:19:59.503+0300 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3454M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-04-17T18:19:59.507+0300 E STORAGE [initandlisten] WiredTiger error (1) [1492442399:507878][3374:0x7f5379b49cc0], file:WiredTiger.wt, connection: /home/shouman/mongodb/WiredTiger.wt: handle-open: open: Operation not permitted
2017-04-17T18:19:59.508+0300 I - [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267
2017-04-17T18:19:59.508+0300 I STORAGE [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating
2017-04-17T18:19:59.508+0300 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-04-17T18:19:59.508+0300 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2017-04-17T18:19:59.508+0300 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-04-17T18:19:59.508+0300 I CONTROL [initandlisten] now exiting
2017-04-17T18:19:59.508+0300 I CONTROL [initandlisten] shutting down with code:100