简体   繁体   English

启动后无法打开 PID 文件 /var/run/mongodb/mongod.pid(还没有?):符号链接级别太多 MongoDB Centos 7

[英]Can't open PID file /var/run/mongodb/mongod.pid (yet?) after start: Too many levels of symbolic links MongoDB Centos 7

I've installed mongodb on centos 7, but I can't start the service with systemctl.我已经在 centos 7 上安装了 mongodb,但是我无法使用 systemctl 启动服务。 Running mongod starts successfully.运行mongod成功启动。

I've followed all the instructions from here: https://mongoing.com/docs/tutorial/install-mongodb-on-red-hat.html我已按照此处的所有说明进行操作: https://mongoing.com/docs/tutorial/install-mongodb-on-red-hat.html

systemctl status mongod returns this: systemctl status mongod 返回:

* mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mongod.service.d
           `-override.conf
   Active: failed (Result: timeout) since Sun 2020-05-03 14:58:02 CEST; 4min 27s ago
     Docs: https://docs.mongodb.org/manual
  Process: 528 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
  Process: 525 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 522 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 519 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)

May 03 14:56:32 zakazise systemd[1]: Starting MongoDB Database Server...
May 03 14:56:32 zakazise mongod[528]: about to fork child process, waiting until server is ready for connections.
May 03 14:56:32 zakazise mongod[528]: forked process: 530
May 03 14:56:34 zakazise systemd[1]: Can't open PID file /var/run/mongodb/mongod.pid (yet?) after start: Too many levels of symbolic links
May 03 14:58:02 zakazise systemd[1]: mongod.service start operation timed out. Terminating.
May 03 14:58:02 zakazise systemd[1]: Failed to start MongoDB Database Server.
May 03 14:58:02 zakazise systemd[1]: Unit mongod.service entered failed state.
May 03 14:58:02 zakazise systemd[1]: mongod.service failed.

There is a line in /var/log/mongodb/mongod.log, that I think might be important: /var/log/mongodb/mongod.log 中有一行,我认为这可能很重要:

2020-05-03T14:58:02.210+0200 I  CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends

/etc/mongod.conf: /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: /var/log/mongodb/mongod.log

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

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

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.


#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options

#auditLog:

#snmp:

/etc/systemd/system/multi-user.target.wants/mongod.service: /etc/systemd/system/multi-user.target.wants/mongod.service:

[Unit]
Description=MongoDB Database Server
Documentation=https://docs.mongodb.org/manual
After=network.target

[Service]
User=mongod
Group=mongod
Environment="OPTIONS=-f /etc/mongod.conf"
EnvironmentFile=-/etc/sysconfig/mongod
ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb
ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb
ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb
ExecStart=/usr/bin/mongod $OPTIONS
PermissionsStartOnly=true
PIDFile=/var/run/mongodb/mongod.pid
Type=forking
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
# Recommended limits for for mongod as specified in
# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings

[Install]
WantedBy=multi-user.target

I didn't change anything in mongod.conf and mongod.service.我没有更改 mongod.conf 和 mongod.service 中的任何内容。 This is a fully fresh install.这是一个全新的安装。

Steps I've tried:我尝试过的步骤:

 touch /var/run/mongodb/mongod.pid 
 chown mongod:mongod/var/run/mongodb/mongod.pid
  • I've checked every path with mongo in it, and they have the right privileges.我已经检查了其中包含 mongo 的每条路径,并且它们具有正确的权限。 (mongod:mongod) (蒙戈:蒙戈)
  • Checked that SELinux is disabled.检查 SELinux 是否已禁用。
  • Allowed 27017 in ufw.在 ufw 中允许 27017。

EDIT编辑

/var/run/mongodb has every rwx. /var/run/mongodb 有每个 rwx。

I'm logged in as root我以 root 身份登录

These two paths are different:这两条路径不同:

May 02 21:53:44 zakazise systemd[1]: Can't open PID file /var/run/mongodb/mongod.pid (yet?) after start: Too many levels of symbolic links

pidFilePath: /var/run/mongo/mongod.pid  # location of pidfile

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:无法将 pid 文件写入 /var/run/mongodb/mongod.pid:没有这样的文件或目录 inf fedora 20 - ERROR: Cannot write pid file to /var/run/mongodb/mongod.pid: No such file or directory inf fedora 20 Mongo 重启错误 — /var/run/mongodb/mongod.pid 存在 - Mongo Restart Error — /var/run/mongodb/mongod.pid exists MongoDB,不是root用户的Ubuntu用户,并将PID文件存储在/ var / run / mongodb中 - MongoDB, an Ubuntu user other than root, and storing the PID file in /var/run/mongodb 在mongod.conf上打开auth时无法启动mongodb - can't start mongodb when open auth on mongod.conf Mongo退出代码45,无法启动mongod,MongoDB无法打开或获取文件锁定 - Mongo exit code 45, can't start mongod, MongoDB cannot open or obtain a lock on a file Node.js-当我运行“npm run start”或运行“mongod”时启动 MongoDB 时无法打开 React 浏览器 - Node.js- Can't get React browser to open when I run 'npm run start' or MongoDB to start when I run 'mongod' MongoDB - 无法运行,因为 SELinux 阻止 mongod 对文件 /proc/sys.net/ipv4/tcp_fastopen 的开放访问 - MongoDB - can't run because of SELinux is preventing mongod from open access on the file /proc/sys/net/ipv4/tcp_fastopen 无法将日志发送到 /var/mongodb/logs/mongod.log 文件并且无法将 mongod 分叉并作为守护进程运行 - Not able to send logs to /var/mongodb/logs/mongod.log file and not able to mongod is forked and run as a daemon 无法在CentOS7上启动MongoDB - Can't start MongoDB on CentOS7 无法使用mongod和mongo启动MongoDB服务 - Can't start MongoDB service with either mongod & mongo
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM