Unit mongod service not found

Пытаюсь сделать на yii2:

Problem 1
— Installation request for yiisoft/yii2-mongodb 2.1.7 -> satisfiable by yiisoft/yii2-mongodb[2.1.7].
— yiisoft/yii2-mongodb 2.1.7 requires ext-mongodb >=1.0.0 -> the requested PHP extension mongodb is missing from your system.

Пытаюсь снести mongo и установить заново:

Удаляется mongodb-org-server (4.0.3) …
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: ошибка при обработке пакета mongodb-org-server (—remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
При обработке следующих пакетов произошли ошибки:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo rm -r /var/log/mongodb /var/lib/mongodb

Пробовал еще кусок пакетов установить:

Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Пакет mongodb-enterprise недоступен, но упомянут в списке зависимостей другого пакета.
Это может означать, что пакет отсутствует, устарел, или доступен из источников, не упомянутых в sources.list

Пакет mongodb-enterprise-mongos недоступен, но упомянут в списке зависимостей другого пакета.
Это может означать, что пакет отсутствует, устарел, или доступен из источников, не упомянутых в sources.list

Пакет mongodb-enterprise-server недоступен, но упомянут в списке зависимостей другого пакета.
Это может означать, что пакет отсутствует, устарел, или доступен из источников, не упомянутых в sources.list

Пакет mongodb-enterprise-shell недоступен, но упомянут в списке зависимостей другого пакета.
Это может означать, что пакет отсутствует, устарел, или доступен из источников, не упомянутых в sources.list

Пакет mongodb-enterprise-tools недоступен, но упомянут в списке зависимостей другого пакета.
Это может означать, что пакет отсутствует, устарел, или доступен из источников, не упомянутых в sources.list

E: Для пакета «mongodb-enterprise» не найден кандидат на установку
E: Для пакета «mongodb-enterprise-server» не найден кандидат на установку
E: Для пакета «mongodb-enterprise-shell» не найден кандидат на установку
E: Для пакета «mongodb-enterprise-mongos» не найден кандидат на установку
E: Для пакета «mongodb-enterprise-tools» не найден кандидат на установку

Читайте также:  Анна из ван хельсинга фото

Пробую запустить mongo:

$ mongod
2018-10-12T11:31:34.017+0300 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify —sslDisabledProtocols ‘none’
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] MongoDB starting : p > 2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] db version v4.0.3
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] git version: 7ea530946fa7880364d88c8d8b6026bbc9ffa48c
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] allocator: tcmalloc
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] modules: none
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] build environment:
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] distmod: ubuntu1404
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] distarch: x86_64
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] target_arch: x86_64
2018-10-12T11:31:34.027+0300 I CONTROL [initandlisten] options: <>
2018-10-12T11:31:34.028+0300 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2018-10-12T11:31:34.029+0300 I NETWORK [initandlisten] shutdown: going to close listening sockets.
2018-10-12T11:31:34.029+0300 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-10-12T11:31:34.029+0300 I CONTROL [initandlisten] now exiting
2018-10-12T11:31:34.029+0300 I CONTROL [initandlisten] shutting down with code:100

Saturday, June 10, 2017

Failed to start mongod.service unit mongod.service not found. ubuntu 16.04

In this post I will show you how to resolve Failed to start mongod.service unit mongod.service not found.

Previously I had shown how to install MongoDB on Ubuntu & Windows

If it is not as shown above just copy & paste the below code and save.
Now with the below commands start the service and check its starte or not
and finally enable it permanently by using the below command

For whatever reason, whenever I try to start MongoDB as a service (sudo service mongod start) I get the following error:

Failed to start mongod.service: Unit mongod.service not found. I followed Installation Steps mention following link mongo db installation failed

And when I try sudo mongod :

And when I try mongod —repair :

3 Answers 3

I reinstalled mongod-org, since my data will still stay safe.

Читайте также:  Nvidia geforce 8000 характеристики

The problem was that my system couldn’t find mongod.service when I ran sudo service mongod status .

Running this fixed it and restored the service:

Then all I had to do was copy my correct config to /etc/mongod.conf and run

This has worked for me.

Uninstall your mongo completely from your system:

Now reinstall mongodb using following commands:

To install a specific release, you must specify each component package individually along with the version number, as in the following example:

Now you can see mongod working but still the same issue is bothering you. The issue is that your system couldn’t find mongod.service when you run sudo service mongod status .

Running this fixed it and restored the service:

Now you’re all set to use mongo.

I too faced the exact problem mentioned by OP, even though I installed Mongodb using the official install tutorial (https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ ),

NOTE: in step 2 of the tutorial (create a list file for Mongodb), it is important to click on the tab specific to the particular version of Ubuntu on your machine. By default it shows Ubuntu 14.04, which created the problems mentioned by OP (Failed to start mongod.service: Unit mongod.service not found)

When I finally noticed that in step 2 I had to properly select Ubuntu 16.04 (for me), the install was successful and after this mongod ran without any issues.

Rate this post

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *