2016-04-02 20 views
1

Bir CentOS 7 boş VM'im var.CentOS7 üzerinde MongoDB'yi başlatılamıyor

> hostnamectl 
... 
Operating System: CentOS Linux 7 (Core) 
    CPE OS Name: cpe:/o:centos:centos:7 
      Kernel: Linux 3.18.26-guest-4-4751b4a-x86_64 
    Architecture: x86_64 

MongoDB'yi kurdum.

> mongod --version 
db version v3.0.11 
git version: 48f8b49dc30cc2485c6c1f3db31b723258fcbf39 

yapılandırma dosyası:

> cat /etc/mongod.conf 
# mongod.conf 

# for documentation of all options, see: 
# http://docs.mongodb.org/manual/reference/configuration-options/ 

# where to write logging data. 
systemLog: 
    destination: file 
    logAppend: true 
    path: /mongo/logs #/var/log/mongodb/mongod.log 

# Where and how to store data. 
storage: 
    dbPath: /mongo/data # (default) /var/lib/mongo 
    journal: 
    enabled: true 
# engine: 
# mmapv1: 
# wiredTiger: 

# how the process runs 
processManagement: 
    fork: true # fork and run in background 
    pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile 

# network interfaces 
net: 
    port: 27017 
    bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces. 

#security: 
#operationProfiling: 
#replication: 
#sharding: 
## Enterprise-Only Options 
#auditLog: 
#snmp: 

Ben bu hatayı alıyorum başlatmaya çalıştığınızda:

> service mongod start 
    Starting mongod (via systemctl): Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details 

ve:

> journalctl -xn 
-- Subject: Unit mongod.service has begun with start-up 
-- Defined-By: systemd 
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 
-- 
-- Unit mongod.service has begun starting up. 
avril 02 14:03:06 keystone runuser[30886]: pam_unix(runuser:session): session opened for user mongod by (uid=0) 
avril 02 14:03:06 keystone runuser[30886]: pam_unix(runuser:session): session closed for user mongod 
avril 02 14:03:06 keystone mongod[30879]: Starting mongod: [FAILED] 
avril 02 14:03:06 keystone systemd[1]: mongod.service: control process exited, code=exited status=1 
avril 02 14:03:06 keystone systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database.. 
-- Subject: Unit mongod.service has failed 
-- Defined-By: systemd 
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 
-- 
-- Unit mongod.service has failed. 
-- 
-- The result is failed. 
avril 02 14:03:06 keystone systemd[1]: Unit mongod.service entered failed state. 

herkes sorunu "karşılaştı Has SYSV başlatılamadı "?

Herhangi bir yardım veya ipucu kabul edilir. Teşekkürler, Paul

+0

Are root olarak mı çalışıyorsun? – Jamie

+0

evet, root ile giriş yaptım. – Paul

+1

Olası kopyası [CentOS 7'de MongoDB 3.0.2 hizmeti başlatılamıyor] (http://stackoverflow.com/questions/30182016/unable-to-start-mongodb-3-0-2-service-on-centos- 7) – Jamie

cevap

0

kök sorunu Bu SELinux'u devre dışı bırakma veya Mongo veritabanı yoluna doğru bağlam eklemeye düzeltilebilir CentOS 7'de varsayılan olarak etkindir selinux izinleri şudur:

chcon -R -t mongod_var_lib_t /var/lib/mongod 
İlgili konular