美文网首页
(mongodb启动报错)mongoDB ERROr: chil

(mongodb启动报错)mongoDB ERROr: chil

作者: 无味wy | 来源:发表于2021-08-13 14:47 被阅读0次

    刚装好mongodb启动报错如下:

    root@inspur-CE3000F:/usr/local/mongodb# /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongodb.conf
    about to fork child process, waiting until server is ready for connections.
    forked process: 8485
    ERROR: child process failed, exited with error number 48
    To see additional information in this output, start without the "--fork" option.
    

    解决方法:

    1. 首先删除data以及log里面生成的所有文件
    root@inspur-CE3000F:/usr/local/mongodb# cd data/
    root@inspur-CE3000F:/usr/local/mongodb/data# ll
    总用量 168
    drwxr-xr-x 3 root root  4096 8月  13 14:34 ./
    drwxr-xr-x 5 root root  4096 8月  13 14:31 ../
    -rw------- 1 root root 16384 8月  13 14:34 collection-0--5967688409628326018.wt
    -rw------- 1 root root 16384 8月  13 14:34 index-0--3870810806853258746.wt
    drwx------ 2 root root  4096 8月  13 14:34 journal/
    -rw------- 1 root root 32768 8月  13 14:34 _mdb_catalog.wt
    -rw------- 1 root root     0 8月  13 14:34 mongod.lock
    -rw------- 1 root root 32768 8月  13 14:34 sizeStorer.wt
    -rw------- 1 root root   114 8月  13 14:34 storage.bson
    -rw------- 1 root root    45 8月  13 14:34 WiredTiger
    -rw------- 1 root root  4096 8月  13 14:34 WiredTigerLAS.wt
    -rw------- 1 root root    21 8月  13 14:34 WiredTiger.lock
    -rw------- 1 root root  1063 8月  13 14:34 WiredTiger.turtle
    -rw------- 1 root root 36864 8月  13 14:34 WiredTiger.wt
    root@inspur-CE3000F:/usr/local/mongodb/data# rm -rf *
    
    root@inspur-CE3000F:/usr/local/mongodb# cd logs/
    root@inspur-CE3000F:/usr/local/mongodb/logs# ll
    总用量 20
    drwxr-xr-x 2 root root  4096 8月  13 14:30 ./
    drwxr-xr-x 5 root root  4096 8月  13 14:31 ../
    -rw------- 1 root root 10816 8月  13 14:34 mongodb.log
    root@inspur-CE3000F:/usr/local/mongodb/logs# rm -rf *
    
    1. 然后执行:
    root@inspur-CE3000F:/usr/local/mongodb/bin# ./mongod --repair
    2021-08-13T14:36:43.833+0800 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] MongoDB starting : pid=8698 port=27017 dbpath=/data/db 64-bit host=inspur-CE3000F
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] db version v4.0.25
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] git version: 89306fde6167fa12ea6e30d61e05791e8e214e55
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] allocator: tcmalloc
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] modules: none
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] build environment:
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten]     distmod: ubuntu1604
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten]     distarch: aarch64
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten]     target_arch: aarch64
    2021-08-13T14:36:43.837+0800 I CONTROL  [initandlisten] options: { repair: true }
    2021-08-13T14:36:43.838+0800 I STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file., terminating
    2021-08-13T14:36:43.838+0800 I CONTROL  [initandlisten] Shutdown started
    2021-08-13T14:36:43.838+0800 I REPL     [initandlisten] Stepping down the ReplicationCoordinator for shutdown, waitTime: 10000ms
    2021-08-13T14:36:43.838+0800 I NETWORK  [initandlisten] Shutting down the global connection pool
    2021-08-13T14:36:43.838+0800 I -        [initandlisten] Killing all operations for shutdown
    2021-08-13T14:36:43.838+0800 I NETWORK  [initandlisten] Shutting down the ReplicaSetMonitor
    2021-08-13T14:36:43.838+0800 I CONTROL  [initandlisten] Shutting down free monitoring
    2021-08-13T14:36:43.838+0800 I FTDC     [initandlisten] Shutting down full-time data capture
    2021-08-13T14:36:43.838+0800 I STORAGE  [initandlisten] Shutting down the HealthLog
    2021-08-13T14:36:43.838+0800 I -        [initandlisten] Dropping the scope cache for shutdown
    2021-08-13T14:36:43.838+0800 I CONTROL  [initandlisten] now exiting
    2021-08-13T14:36:43.838+0800 I CONTROL  [initandlisten] shutting down with code:100
    root@inspur-CE3000F:/usr/local/mongodb/bin# ps -ef|grep mongodb
    mongodb    881     1  0 13:54 ?        00:00:03 /usr/bin/mongod --config /etc/mongodb.conf
    root      8706  3280  0 14:36 pts/1    00:00:00 grep --color=auto mongodb
    root@inspur-CE3000F:/usr/local/mongodb/bin# kill -9 881
    root@inspur-CE3000F:/usr/local/mongodb/bin# kill -9 881
    -bash: kill: (881) - 没有那个进程
    
    1. 再次启动mongodb
    root@inspur-CE3000F:/usr/local/mongodb/bin# /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongodb.conf
    about to fork child process, waiting until server is ready for connections.
    forked process: 8731
    child process started successfully, parent exiting
    root@inspur-CE3000F:/usr/local/mongodb/bin# ps -ef|grep mongodb
    root      8731     1  0 14:37 ?        00:00:00 /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongodb.conf
    root      8765  3280  0 14:37 pts/1    00:00:00 grep --color=auto mongodb
    # 成功启动
    

    相关文章

      网友评论

          本文标题:(mongodb启动报错)mongoDB ERROr: chil

          本文链接:https://www.haomeiwen.com/subject/qdndbltx.html