mongod: unrecognized service after install on Debian 8

1,080 views
Skip to first unread message

Hafid Mermouri

unread,
Feb 19, 2017, 3:40:40 AM2/19/17
to mongodb-user
Hello there
I installed mongodb on Debia 8 using this https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/
the install was OK but when i try to start the service, i have this message

mongod: unrecognized service

i tried
mongod--repair

 then i get an error with permission access (can't create lock file in read only directory /data/db/
i run 
sudo chown-R'id -u'/data/db/
and this solved my issue
now mongod --repair output this









hafid@ns3097105:/$ mongod --repair


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] MongoDB starting : pid=27875 port=27017 dbpath=/data/db 64-bit host=ns3097105.ip-188-165-200.eu


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] db version v3.4.2


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] allocator: tcmalloc


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] modules: none


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] build environment:


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten]     distmod: ubuntu1404


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten]     distarch: x86_64


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten]     target_arch: x86_64


2017-02-19T09:42:34.811+0100 I CONTROL  [initandlisten] options: { repair: true }


2017-02-19T09:42:34.841+0100 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.


2017-02-19T09:42:34.841+0100 I STORAGE  [initandlisten]


2017-02-19T09:42:34.841+0100 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine


2017-02-19T09:42:34.841+0100 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem


2017-02-19T09:42:34.841+0100 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=15527M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),,log=(enabled=false),


2017-02-19T09:42:35.808+0100 I STORAGE  [initandlisten] Repairing size cache


2017-02-19T09:42:35.809+0100 I STORAGE  [initandlisten] Verify succeeded on uri table:sizeStorer. Not salvaging.


2017-02-19T09:42:35.809+0100 I STORAGE  [initandlisten] Repairing catalog metadata


2017-02-19T09:42:35.810+0100 I STORAGE  [initandlisten] Verify succeeded on uri table:_mdb_catalog. Not salvaging.


2017-02-19T09:42:35.951+0100 I CONTROL  [initandlisten]


2017-02-19T09:42:35.951+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.


2017-02-19T09:42:35.951+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.


2017-02-19T09:42:35.951+0100 I CONTROL  [initandlisten]


2017-02-19T09:42:35.952+0100 I STORAGE  [initandlisten] finished checking dbs


2017-02-19T09:42:35.952+0100 I NETWORK  [initandlisten] shutdown: going to close listening sockets...


2017-02-19T09:42:35.952+0100 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock


2017-02-19T09:42:35.952+0100 I NETWORK  [initandlisten] shutdown: going to flush diaglog...


2017-02-19T09:42:35.952+0100 I STORAGE  [initandlisten] WiredTigerKVEngine shutting down


2017-02-19T09:42:36.302+0100 I STORAGE  [initandlisten] shutdown: removing fs lock...


2017-02-19T09:42:36.302+0100 I CONTROL  [initandlisten] now exiting


2017-02-19T09:42:36.302+0100 I CONTROL  [initandlisten] shutting down with code:0


again when i run sudo service mongod status, it don't reconize the service.

any help ?
thanks



Kevin Adistambha

unread,
Mar 1, 2017, 7:03:09 PM3/1/17
to mongodb-user

Hi Hafid

I tried following all the instruction in https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/ and found that the service was installed correctly on a vanilla Debian 8 deployment:

$ uname -a
Linux jessie 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux
$ sudo service mongod status
● mongod.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/lib/systemd/system/mongod.service; disabled)
   Active: active (running) since Wed 2017-03-01 23:52:33 GMT; 22s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 9230 (mongod)
   CGroup: /system.slice/mongod.service
           └─9230 /usr/bin/mongod --quiet --config /etc/mongod.conf

Could you please post the step-by-step commands that you executed?

Please note that --repair has nothing to do with MongoDB service installation; it is a maintenance command that affects your data in a non-reversible manner. Running --repair on an existing deployment without a thorough understanding of the command’s operations is therefore not recommended.

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages