无法启动 com.bitnami.mongodb

Unable to start com.bitnami.mongodb

我正在使用 MongoDB 并在 azure 上进行复制,我已将 SSD 磁盘附加到 MongoDB 节点并安装在特定路径上。
我将 MongoDB 数据和日志路径更改为 MongoDB.conf(/opt/bitnami/mongodb/conf/mongodb.conf) 文件中的特定路径。
但是当我使用 sudo service bitnami restart 命令重新启动 MongoDB 服务器时,它给了我

这样的错误

ERROR Unable to start com.bitnami.mongodb: Cannot find pid file '/opt/bitnami/mong...b.pid'.

enter image description here

bitnami@mymongodb0:/tmp$ sudo service bitnami status
● bitnami.service - LSB: Bitnami Init Script
   Loaded: loaded (/etc/init.d/bitnami)
   Active: failed (Result: exit-code) since Fri 2017-08-04 05:49:58 UTC; 2min 15s ago
  Process: 26654 ExecStop=/etc/init.d/bitnami stop (code=exited, status=0/SUCCESS)
  Process: 92099 ExecStart=/etc/init.d/bitnami start (code=exited, status=1/FAILURE)

Aug 04 05:46:53 mymongodb0 bitnami[92099]: 2017-08-04T05:46:53.376Z - info: Saving configuration info to disk
Aug 04 05:46:53 mymongodb0 bitnami[92099]: 2017-08-04T05:46:53.987Z - info: Performing service start operation for mongodb
Aug 04 05:49:58 mymongodb0 bitnami[92099]: nami    ERROR Unable to start com.bitnami.mongodb: Cannot find pid file '/opt/bitnami/mong...b.pid'.
Aug 04 05:49:58 mymongodb0 bitnami[92099]: 2017-08-04T05:49:58.249Z - error: Unable to perform start operation nami command exited wi... code 1
Aug 04 05:49:58 mymongodb0 systemd[1]: bitnami.service: control process exited, code=exited status=1
Aug 04 05:49:58 mymongodb0 systemd[1]: Failed to start LSB: Bitnami Init Script.
Aug 04 05:49:58 mymongodb0 systemd[1]: Unit bitnami.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

root@mymongodb0:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        30G  1.8G   27G   7% /
udev             10M     0   10M   0% /dev
tmpfs           3.2G  8.4M  3.2G   1% /run
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sdd1      1007G  272M  956G   1% /data
/dev/sdb1        32G   48M   30G   1% /mnt/resource

/opt/bitnami/mongodb/conf/mongodb.conf

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

# Where and how to store data.
storage:
  dbPath: /data/db
  journal:
    enabled: true
  #engine:
  #mmapv1:
    #smallFiles: true
  #wiredTiger:

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

# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0
  unixDomainSocket:
    enabled: true
    pathPrefix: /opt/bitnami/mongodb/tmp

# replica set options
replication:
  replSetName: replicaset

# process management options
processManagement:
   fork: false
   pidFilePath: /opt/bitnami/mongodb/tmp/mongodb.pid

    /dev/sdc1        50G   33M   50G   1% /bitnami
    tmpfs           1.6G     0  1.6G   0% /run/user/1000

说了半天,根本原因是/data权限不够

chown mongo:mongo -R /data

/data 目录需要 mongo 用户和组。

Follow-up 对于旧图像:bitnami/mongodb:3.2.7-r5

我将主机上的目录 /Users/sb/mongodata 安装到 :/bitnami/mongodb 并且必须手动创建此目录结构:

- conf
  mongodb.conf 
- data
   - db
- logs
- tmp

然后chmod -R g+rwX /Users/sb/mongodata