1
votes

Erreur: impossible de se connecter au serveur 127.0.0.1:27017 même si j'exécute mongod

2020-05-02T19:00:34.303-0500 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten] MongoDB starting : pid=3964 port=27017 dbpath=/data/db 64-bit host=Mateos-MBP.attlocal.net
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten] db version v4.2.3
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten] allocator: system
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten] modules: none
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten] build environment:
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten]     distarch: x86_64
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten]     target_arch: x86_64
2020-05-02T19:00:34.309-0500 I  CONTROL  [initandlisten] options: {}
2020-05-02T19:00:34.310-0500 I  STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2020-05-02T19:00:34.310-0500 I  NETWORK  [initandlisten] shutdown: going to close listening sockets...
2020-05-02T19:00:34.313-0500 I  -        [initandlisten] Stopping further Flow Control ticket acquisitions.
2020-05-02T19:00:34.313-0500 I  CONTROL  [initandlisten] now exiting
2020-05-02T19:00:34.313-0500 I  CONTROL  [initandlisten] shutting down with code:100

1 commentaires

La ligne options: {} dans le journal indique que mongod n'a obtenu aucune configuration.


4 Réponses :


0
votes

Il est évident que le démarrage de MongoDB a échoué.

2020-05-02T19: 00: 34.310-0500 I Exception STORAGE [initandlisten] dans initAndListen: NonExistentPath: répertoire de données / data / db introuvable., Arrêt

C'est pourquoi vous ne pouvez pas le connecter. Parce que ce n'est jamais un démarrage. Vous pouvez essayer de résoudre le problème de démarrage de MongoDB, puis essayez de vous connecter via CMD pour vous assurer que tout va bien.


0 commentaires

3
votes

Créez un répertoire / data / db et donnez l'autorisation à l'utilisateur MongoDB pour que MongoDB puisse y accéder. Pour créer le répertoire:

sudo chown -R $USER /data/db

Pour changer de propriétaire:

sudo mkdir -p /data/db


1 commentaires

Ce que j'ai fini par utiliser, c'est que les services de brassage commencent mongodb-community@4.2 qui a bien fonctionné Je ne sais pas pourquoi mongod ne fonctionnait pas ici est le forum MongoDB où j'ai trouvé la réponse developer.mongodb.com/community/forums/t/... mais merci une tonne de toute façon.



2
votes

J'ai suivi ces étapes simples

Open your task manager if on windows 
go to services -> go to MongoDB on services list provided
left click to highlight then down below click
->open services
on the list provided find MongoDB server
left click to highlight
click on the green play button to start the mongoDbServer
wait for a while
run your command again it will work


0 commentaires

0
votes

Ouvrez votre gestionnaire de tâches> services> MongoDB> "clic droit et démarrez le serveur"


0 commentaires