時間:2024-02-05 11:03作者:下載吧人氣:18
現(xiàn)在公司的服務(wù)器經(jīng)常性斷電,所以要經(jīng)常性重啟所有的服務(wù),然而這些redis、mysql、mongo等服務(wù)中,mongo經(jīng)常性出現(xiàn)重啟失敗的情況,根據(jù)之前的經(jīng)驗(yàn)和網(wǎng)絡(luò)上帖子的信息,這里記錄一下總結(jié);
首先說明一下,這里安裝的服務(wù)都是通過yum 或者 apt 安裝的,這是我一直推薦和使用的操作,因?yàn)檫@樣安裝整潔、該放什么類型的文件到哪個目錄下都是一樣的(如:/var/log/xxx/xxx.log)
報(bào)錯主要問題如下:
[root@localhost mongo]# systemctl status mongod ● mongod.service - MongoDB Database Server Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since 一 2021-06-28 14:32:51 CST; 6s ago Docs: https://docs.mongodb.org/manual Process: 3351 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=1/FAILURE) Process: 3348 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) Process: 3345 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) Process: 3343 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) 6月 28 14:32:51 localhost systemd[1]: Starting MongoDB Database Server... 6月 28 14:32:51 localhost mongod[3351]: about to fork child process, waiting until server is ready for connections. 6月 28 14:32:51 localhost mongod[3351]: forked process: 3354 6月 28 14:32:51 localhost mongod[3351]: ERROR: child process failed, exited with 1 6月 28 14:32:51 localhost mongod[3351]: To see additional information in this output, start without the "--fork" option. 6月 28 14:32:51 localhost systemd[1]: mongod.service: control process exited, code=exited status=1 6月 28 14:32:51 localhost systemd[1]: Failed to start MongoDB Database Server. 6月 28 14:32:51 localhost systemd[1]: Unit mongod.service entered failed state. 6月 28 14:32:51 localhost systemd[1]: mongod.service failed.
網(wǎng)友評論