如何在Ubuntu 16.10中设置featureCompatibilityVersion而无法访问Mongo shell?

时间:2017-02-10 05:10:16

标签: mongodb shell ubuntu

我尝试在本地计算机上安装MongoDB 3.2,运行Ubuntu 16.10。

在安装过程中,没有错误;然后,当我运行mongod时,我收到以下错误:

Cannot start mongod when the featureCompatibilityVersion is higher than 3.2. See http://dochub.mongodb.org/core/3.4-feature-compatibility.

Fatal Assertion 40352

但是,当我在MongoDB的文档中找到该链接时,设置功能兼容性的唯一方法是通过mongo shell。然而,正如我之前提到的那样,我甚至无法访问它,并在下面的终端输出中显示。

我以前安装了MongoDB 3.4,但我需要3.2,因为这是与mLab兼容的最新版本,我将在转向生产时使用。

所以首先我尝试降级它,我遇到了同样的问题。然后我尝试完全卸载3.4(按照卸载说明)并安装3.2。然后我得到了同样的错误。

这是完整的终端输出:

2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] MongoDB starting : pid=3465 port=27017 dbpath=/data/db 64-bit host=fluidlan
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] db version v3.2.12
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] git version: ef3e1bc78e997f0d9f22f45aeb1d8e3b6ac14a14
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] allocator: tcmalloc
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] modules: none
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] build environment:
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten]     distmod: ubuntu1604
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten]     distarch: x86_64
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten]     target_arch: x86_64
2017-02-10T09:42:10.134+0530 I CONTROL  [initandlisten] options: {}
2017-02-10T09:42:10.160+0530 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-02-10T09:42:10.160+0530 W -        [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
2017-02-10T09:42:10.160+0530 W STORAGE  [initandlisten] Recovering data from the last clean checkpoint.
2017-02-10T09:42:10.160+0530 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3G,session_max=20000,eviction=(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-02-10T09:42:10.955+0530 I CONTROL  [initandlisten] 
2017-02-10T09:42:10.955+0530 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-02-10T09:42:10.955+0530 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-02-10T09:42:10.955+0530 I CONTROL  [initandlisten] 
2017-02-10T09:42:10.958+0530 F INDEX    [initandlisten] Cannot start mongod when the featureCompatibilityVersion is higher than 3.2. See http://dochub.mongodb.org/core/3.4-feature-compatibility.
2017-02-10T09:42:10.958+0530 I -        [initandlisten] Fatal Assertion 40352
2017-02-10T09:42:10.959+0530 I -        [initandlisten] 

***aborting after fassert() failure

也许在卸载过程中我还没有完全删除的文件?我做了以下卸载(根据他们的安装指南):

sudo apt-get purge mongodb-org*

sudo rm -r /var/log/mongodb

sudo rm -r /var/lib/mongodb

但也许这并没有完全清除一切?

在任何方面,如何在不访问mongo shell的情况下设置功能兼容性?

谢谢。

P.S。我一直在遵循Ubuntu 16.04的说明,因为16.10还没有。这可能是问题的根源吗?

1 个答案:

答案 0 :(得分:6)

您正尝试从/var/lib/mongodb删除文件,但根据您的日志文件,数据文件位于/data/db

尝试从/data/db/删除文件以解决问题: sudo rm -rf /data/db*