创建SSH密钥后,Ubuntu vps上的MongoDB / Mongod错误``连接被拒绝''

时间:2019-12-08 17:19:54

标签: mongodb ubuntu ubuntu-19.04

我今天为我的vps创建了一个ssh密钥。然后,当我重新启动vps并尝试运行“ mongo”或“ mongod”时,我收到了以下错误消息:

对于mongo:

2019-12-08T18:09:50.619+0100 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 
1.0 specify --sslDisabledProtocols 'none'
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] MongoDB starting : pid=1169 port=27017 
dbpath=/data/db 64-bit host=1cc0f81c.cus9089.kvm.st-srv.eu
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] db version v4.2.1
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] git version: 
edf6d45851c0b9ee15548f0f847df141764a317e
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1b  26 Feb 2019
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] allocator: tcmalloc
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] modules: none
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] build environment:
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten]     distmod: ubuntu1804
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten]     distarch: x86_64
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten]     target_arch: x86_64
2019-12-08T18:09:50.623+0100 I  CONTROL  [initandlisten] options: {}
2019-12-08T18:09:50.623+0100 I  STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: 
Data directory /data/db not found., terminating
2019-12-08T18:09:50.623+0100 I  NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-12-08T18:09:50.623+0100 I  NETWORK  [initandlisten] removing socket file: /tmp/mongodb- 
27017.sock
2019-12-08T18:09:50.623+0100 I  -        [initandlisten] Stopping further Flow Control ticket 
acquisitions.
2019-12-08T18:09:50.624+0100 I  CONTROL  [initandlisten] now exiting
2019-12-08T18:09:50.624+0100 I  CONTROL  [initandlisten] shutting down with code:100

对于Mongod:

# Note that I'm pretty explicit here. This would work as well as the line after:
# Get-ChildItem -Recurse C:\windows\System32\*.txt
$fileList = Get-ChildItem -Recurse -Path C:\windows\System32 -Include *.txt
foreach ($textfile in $fileList) {
    # This includes the filename ;)
    $filePath = $textfile.fullname
    # You can replace the next line with whatever you want to.
    Write-Output $filePath
}

系统信息:Ubuntu 19.04

我该怎么做才能解决此问题并使它再次运行而又不会丢失数据?

1 个答案:

答案 0 :(得分:0)

我通过再次遍历安装步骤来解决它:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

这以某种方式解决了它,现在可以正常工作了