Autor Tópico: Falha - mongod.service: Failed with result 'exit-code'  (Lida 3343 vezes)

Offline williamphone10

  • Usuário Ubuntu
  • *
  • Mensagens: 26
    • Ver perfil
Falha - mongod.service: Failed with result 'exit-code'
« Online: 13 de Janeiro de 2023, 17:53 »
Boa tarde, gostaria de pedir ajuda com esse problema.
Estou tentando instalar o mongodb no meu servidor ubuntu 20.04, mas ele está apresentando falha - mongod.service: Failed with result 'exit-code'. - segui a instalação do site do mongo mas não deu certo.
Ele fica mostrando que esta na versão - db version v3.6.8 - mas minha instalação e chave é mais recente, não estou conseguindo fazer ele atualizar, quando tento ele ignora o mongo
tentei - sudo systemctl unmask mongod - sem sucesso
tentei - sudo systemctl daemon-reload - sem sucesso
já desinstalei e instalei novamente - sem sucesso

Agora não sei mais o que tentar.

sudo apt-get update -y
Hit:1 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease 
Ign:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Hit:5 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 Release
Get:6 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]

sudo service mongod start
Failed to start mongod.service: Unit mongod.service not found.

sudo service mongod status
● mongod.service
     Loaded: not-found (Reason: Unit mongod.service not found.)
     Active: failed (Result: exit-code) since Fri 2023-01-13 20:12:33 UTC; 16min ago
   Main PID: 13528 (code=exited, status=14)

Jan 13 20:12:31 ubuntu systemd[1]: Started MongoDB Database Server.
Jan 13 20:12:33 ubuntu systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
Jan 13 20:12:33 ubuntu systemd[1]: mongod.service: Failed with result 'exit-code'.

mongod --repair
2023-01-13T20:21:26.472+0000 I CONTROL  [initandlisten] MongoDB starting : pid=14257 port=27017 dbpath=/data/db 64-bit host=ubuntu
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] db version v3.6.8
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] git version: 8e540c0b6db93ce994cc548f000900bdc740f80a
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] modules: none
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] build environment:
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten]     distarch: aarch64
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten]     target_arch: aarch64
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] options: { repair: true }
2023-01-13T20:21:26.473+0000 I STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] now exiting
2023-01-13T20:21:26.473+0000 I CONTROL  [initandlisten] shutting down with code:100