La La la
This situation
[Email protected]:/#mongomongodb Shell version:3.2. -Connecting To:test .- to-31t07: +:34.548-0700W NETWORK [Thread1] Failed to connect to127.0.0.1:27017,inch(Checking socket for ErrorAfter poll), Reason:errno:111Connection refused .- to-31t07: +:34.549-0700E QUERY [Thread1] Error:couldn't connect to server 127.0.0.1:27017, connection attempt failed:[Email Protected]/mongo/shell/mongo.js:229: -@ (Connect):1:6Exception:connect failed
Because of the process of killing directly, I do not know why options:{} is empty when the service is restarted. Specify the-dbpath parameter while starting
" /var/lib/mongodb/ "
However, this must ensure that the service window cannot be closed.
Start with a configuration file
Mongod-f/etc/mongod.conf
This must also ensure that the service window cannot be closed.
Start with daemon mode: Daemon
The –fork parameter allows MongoDB services to be run in the background
[Email protected]:/# mongod-fork-f/etc/untilfor1163childProcess Started successfully, parent exiting
Mongod.log
.- to-31t07: the:28.242-0700I CONTROL [Main] * * * * * SERVER restarted * * * * .- to-31t07: the:28.249-0700I CONTROL [Initandlisten] MongoDB starting:pid=1163port=27017Dbpath=/var/lib/mongodb --bit host=localhost .- to-31t07: the:28.250-0700I CONTROL [Initandlisten] DB version v3.2.13 .- to-31t07: the:28.250-0700I CONTROL [initandlisten] git version:23899209cad60aaafe114f6aea6cb83025ff51bc .- to-31t07: the:28.251-0700I CONTROL [Initandlisten] OpenSSL Version:openssl1.0.2g1Mar . .- to-31t07: the:28.251-0700I CONTROL [Initandlisten] Allocator:tcmalloc .- to-31t07: the:28.251-0700I CONTROL [Initandlisten] Modules:none .- to-31t07: the:28.251-0700I CONTROL [Initandlisten] Build environment: .- to-31t07: the:28.252-0700I CONTROL [Initandlisten] distmod:ubuntu1604 .- to-31t07: the:28.252-0700I CONTROL [Initandlisten] distarch:x86_64 .- to-31t07: the:28.252-0700I CONTROL [Initandlisten] target_arch:x86_64 .- to-31t07: the:28.252-0700I CONTROL [Initandlisten] options: {config:"/etc/mongod.conf", net: {port:27017}, Processmanagement: {fork:true}, Storage: {dbPath:"/var/lib/mongodb", Journal: {enabled:true}}, Systemlog: {destination:"file", Logappend:true, Path:"/var/log/mongodb/mongod.log" } } .- to-31t07: the:28.276-0700I-[Initandlisten] detected data filesinch/var/lib/mongodb created by the'Wiredtiger'Storage engine, so setting the active storage engine to'Wiredtiger'. .- to-31t07: the:28.276-0700I STORAGE [Initandlisten] Wiredtiger_open config:create,cache_size=1g,session_max=20000, eviction= (threads_min=4, threads_max=4), config_base=false, statistics= (FAST), log= (enabled=true, archive=true, Path=journal,compressor=snappy), file_manager= (close_idle_time=100000), checkpoint= (wait= -, LOG_SIZE=2GB), statistics_log= (wait=0), .- to-31t07: the:28.461-0700I CONTROL [Initandlisten] * * Warning:you is running this process as the root user, which is notrecommended. .- to-31t07: the:28.462-0700I CONTROL [Initandlisten] .- to-31t07: the:28.462-0700I CONTROL [Initandlisten] .- to-31t07: the:28.462-0700I CONTROL [Initandlisten] * * WARNING:/sys/kernel/mm/transparent_hugepage/enabled is' always'. .- to-31t07: the:28.462-0700I CONTROL [Initandlisten] * * We suggest setting it to'never' .- to-31t07: the:28.462-0700I CONTROL [Initandlisten] .- to-31t07: the:28.463-0700I CONTROL [Initandlisten] * * WARNING:/sys/kernel/mm/transparent_hugepage/defrag is' always'. .- to-31t07: the:28.463-0700I CONTROL [Initandlisten] * * We suggest setting it to'never' .- to-31t07: the:28.463-0700I CONTROL [Initandlisten] .- to-31t07: the:28.466-0700I ftdc [Initandlisten] Initializing full-time diagnostic data capture with directory'/var/lib/mongodb/diagnostic.data' .- to-31t07: the:28.466-0700I NETWORK [Initandlisten] Waiting forConnections on port27017 .- to-31t07: the:28.467-0700I NETWORK [hostnamecanonicalizationworker] starting hostname canonicalization worker .- to-31t07: +:01.201-0700I NETWORK [Initandlisten] connection accepted from127.0.0.1:56034#1(1Connection now OPEN)
La La la
La La la
MongoDB Beginner Unexpected Solution class set