ProblèmeMongod Démarrer le service quitte avec le code 100
Mon service mongo ne démarre pas plus:
[email protected] ~ # service mongod start
[email protected] ~ # service mongod status
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-08-15 12:03:51 CEST; 2s ago
Docs: https://docs.mongodb.org/manual
Process: 26942 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
Main PID: 26942 (code=exited, status=100)
Aug 15 12:03:50 machine systemd[1]: Started High-performance, schema-free document-oriented database.
Aug 15 12:03:51 machine systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
Aug 15 12:03:51 machine systemd[1]: mongod.service: Unit entered failed state.
Aug 15 12:03:51 machine systemd[1]: mongod.service: Failed with result 'exit-code'.
Lorsque le code de sortie 100 est floue définie comme:
Returned by mongod when the process throws an uncaught exception.
Qu'est-ce que J'ai fait
D'abord, j'ai installé mon mongodb (3.4.7) sur Ubuntu 16.04.2 LTS via the official guide.
Le démarrage et l'arrêt du service ont bien fonctionné. J'ai donc continué à activer l'authentification (à nouveau via the official guide).
Puis j'ai ajouté le service pour pouvoir to run on server startup.
[email protected] ~ # systemctl enable mongod.service
mongod.conf
J'ai aussi édité mon fichier de configuration, qui est passé un linter YAML:
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
# engine: mmapv1
# 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
#processManagement:
security:
authorization: enabled
La propriété du fichier est
[email protected] ~ # ls -la /etc/ | grep mongo
-rw-r--r-- 1 root root 599 Aug 15 11:42 mongod.conf
DbPath
Je sais qu'il ya des problèmes avec le dbpath donc ce que /var/lib/mongodb
a en termes de propriété:
[email protected] machine ~ # ls -la /var/lib/ | grep mongo
drwxr-xr-x 4 mongodb mongodb 4096 Aug 15 11:54 mongodb
Liste des services
Lorsque la liste de tous les services via service --status-all
il n'y a pas d'entrée pour tout service lié à Mongo.
Quelqu'un a une idée de ce qui pourrait causer le problème?
MISE À JOUR
Comme suggéré je courais la commande suivante (avec une légère modification):
[email protected] ~ /usr/bin/mongod --verbose --config /etc/mongod.conf &
[1] 28495
Lorsque je bien, c'est une execute directe du binaire. Cela me permet maintenant d'au moins connexion en shell mongo:
[email protected] ~ # mongo
MongoDB shell version v3.4.7
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.7
>
Cependant, l'état du service est toujours en restant a échoué avec le code de sortie 100.
MISE À JOUR MISE À JOUR
Lors de la saisie [email protected] ~ # /usr/bin/mongod --verbose
Je reçois l'erreur suivante:
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] MongoDB starting : pid=28642 port=27017 dbpath=/data/db 64-bit host=machine
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] db version v3.4.7
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] git version: cf38c1b8a0a8dca4a11737581beafef4fe120bcd
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] allocator: tcmalloc
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] modules: none
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] build environment:
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] distmod: ubuntu1604
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] distarch: x86_64
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] target_arch: x86_64
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] options: { systemLog: { verbosity: 1 } }
2017-08-15T13:45:40.973+0200 D - [initandlisten] User Assertion: 29:Data directory /data/db not found. src/mongo/db/service_context_d.cpp 98
2017-08-15T13:45:40.973+0200 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2017-08-15T13:45:40.973+0200 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-08-15T13:45:40.973+0200 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] now exiting
2017-08-15T13:45:40.973+0200 I CONTROL [initandlisten] shutting down with code:100
Démarrez le service à travers le terminal '/ usr/bin/mongod --config/etc/mongodb.conf' et de voir quelles sont les erreurs que vous voyez? –
Je mets à jour ma description – Jankapunkt
Je ne vois aucune erreur de mise à jour? Je ne veux pas voir l'état du service, je veux que vous vérifiiez l'exécution dans un terminal normal –