从mongodb 3.6升级到4.0后如何在没有退出代码的情况下重新启动服务器

时间:2019-05-30 23:20:27

标签: mongodb ubuntu

从3.6升级时,我已关闭该服务,运行清除,进行了密钥服务器的升级,这就是已安装的版本:

  • MongoDB Shell版本v4.0.10 git版本: c389e7f69f637f7a1ac3cc9fae843b635f20b766 OpenSSL版本:OpenSSL 1.0.2g 2016年3月1日分配器:tcmalloc模块:无构建环境:    distmod:ubuntu1604    distarch:x86_64    target_arch:x86_64 位置:/ usr / bin / mongo

  • db版本v4.0.10 git版本: c389e7f69f637f7a1ac3cc9fae843b635f20b766 OpenSSL版本:OpenSSL 1.0.2g 2016年3月1日分配器:tcmalloc模块:无构建环境:    distmod:ubuntu1604    distarch:x86_64    target_arch:x86_64 位置:/ usr / bin / mongod

当我使用未注释掉的dbPath行时,出现退出状态62。 当我使用dbPath:/ data / db(一个新创建的文件夹)时,我得到退出状态2。 两者都不起作用,我也不知道如何解决。我不想删除数据库目录,因为这是一个实时站点。有人可以帮我吗?

如您所见,我已经尝试过更改dbPath,多次重新启动服务器后,服务器却无法正常工作。

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
#   dbPath: /data/db
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1

# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:
#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

当我检查状态时,这就是我得到的: root @ pottstownrumble:〜#sudo服务mongodb状态 ●mongodb.service-高性能,无模式的面向文档的数据库    已加载:已加载(/etc/systemd/system/mongodb.service;已启用;供应商预设:已启用)    活动时间:自2019年5月30日(星期四)以来失败(结果:退出代码); 8分钟前   进程:8927 ExecStart = / usr / bin / mongod --quiet --config /etc/mongod.conf(代码=已退出,状态= 62)  主PID:8927(代码=已退出,状态= 62)

5月30日18:57:22 pottstownrumble systemd [1]:启动了高性能,无模式的面向文档的数据库。 5月30日18:57:24 pottstownrumble systemd [1]:mongodb.service:主进程已退出,代码=已退出,状态= 62 / n / a 5月30日18:57:24 pottstownrumble systemd [1]:mongodb.service:设备进入失败状态。 5月30日18:57:24 pottstownrumble systemd [1]:mongodb.service:失败,返回结果为“退出代码”。

/var/log/mongodb/mongod.log的最后几行:

2019-05-30T18:57:23.707-0400 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2019-05-30T18:57:23.736-0400 I CONTROL  [initandlisten] 
2019-05-30T18:57:23.736-0400 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-05-30T18:57:23.736-0400 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2019-05-30T18:57:23.736-0400 I CONTROL  [initandlisten] 
2019-05-30T18:57:23.806-0400 F CONTROL  [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.6 before attempting an upgrade to 4.0; see http://dochub.mongodb.org/core/4.0-upgrade-fcv for more details.
2019-05-30T18:57:23.807-0400 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-05-30T18:57:23.807-0400 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-05-30T18:57:23.807-0400 I STORAGE  [initandlisten] WiredTigerKVEngine shutting down
2019-05-30T18:57:23.807-0400 I STORAGE  [initandlisten] Shutting down session sweeper thread
2019-05-30T18:57:23.807-0400 I STORAGE  [initandlisten] Finished shutting down session sweeper thread
2019-05-30T18:57:23.819-0400 I STORAGE  [initandlisten] Downgrading WiredTiger datafiles.
2019-05-30T18:57:23.970-0400 I STORAGE  [initandlisten] WiredTiger message [1559257043:970434][8927:0x7f305c248a80], txn-recover: Main recovery loop: starting at 29/3712 to 30/256
2019-05-30T18:57:24.073-0400 I STORAGE  [initandlisten] WiredTiger message [1559257044:73520][8927:0x7f305c248a80], txn-recover: Recovering log 29 through 30
2019-05-30T18:57:24.134-0400 I STORAGE  [initandlisten] WiredTiger message [1559257044:134293][8927:0x7f305c248a80], txn-recover: Recovering log 30 through 30
2019-05-30T18:57:24.185-0400 I STORAGE  [initandlisten] WiredTiger message [1559257044:185924][8927:0x7f305c248a80], txn-recover: Set global recovery timestamp: 0
2019-05-30T18:57:24.283-0400 I STORAGE  [initandlisten] shutdown: removing fs lock...
2019-05-30T18:57:24.283-0400 I CONTROL  [initandlisten] now exiting
2019-05-30T18:57:24.283-0400 I CONTROL  [initandlisten] shutting down with code:62
root@pottstownrumble:~# mongo
MongoDB shell version v4.0.10
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
2019-05-30T19:53:30.160-0400 E QUERY    [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:344:17
@(connect):2:6
exception: connect failed

0 个答案:

没有答案