啦啦啦

这种情况

root@localhost:/# mongo
MongoDB shell version: 3.2.
connecting to: test
--31T07::34.548- W NETWORK [thread1] Failed to connect to 127.0.0.1:, in(checking socket for error after poll), reason: errno: Connection refused
--31T07::34.549- E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js::
@(connect):: exception: connect failed

由于直接kill掉的进程,不知道为什么服务再启动时options:{}为空。虽启动时指定-dbpath 参数

mongod -dbpath "/var/lib/mongodb/"

但是这样必须保证服务窗口不能关闭。

使用配置文件方式启动

mongod -f /etc/mongod.conf

这样也必须保证服务窗口不能关闭。

采用守护进程方式启动:Daemon

–fork参数可以将mongodb的服务放在后台运行

root@localhost:/# mongod -fork -f /etc/mongod.conf
about to fork child process, waiting until server is ready for connections.
forked process:
child process started successfully, parent exiting

mongod.log

--31T07::28.242- I CONTROL  [main] ***** SERVER RESTARTED *****
--31T07::28.249- I CONTROL [initandlisten] MongoDB starting : pid= port= dbpath=/var/lib/mongodb -bit host=localhost
--31T07::28.250- I CONTROL [initandlisten] db version v3.2.13
--31T07::28.250- I CONTROL [initandlisten] git version: 23899209cad60aaafe114f6aea6cb83025ff51bc
--31T07::28.251- I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g Mar
--31T07::28.251- I CONTROL [initandlisten] allocator: tcmalloc
--31T07::28.251- I CONTROL [initandlisten] modules: none
--31T07::28.251- I CONTROL [initandlisten] build environment:
--31T07::28.252- I CONTROL [initandlisten] distmod: ubuntu1604
--31T07::28.252- I CONTROL [initandlisten] distarch: x86_64
--31T07::28.252- I CONTROL [initandlisten] target_arch: x86_64
--31T07::28.252- I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { port: }, processManagement: { fork: true }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
--31T07::28.276- I - [initandlisten] Detected data files in /var/lib/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
--31T07::28.276- I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=,eviction=(threads_min=,threads_max=),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=),checkpoint=(wait=,log_size=2GB),statistics_log=(wait=),
--31T07::28.461- I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
--31T07::28.462- I CONTROL [initandlisten]
--31T07::28.462- I CONTROL [initandlisten]
--31T07::28.462- I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
--31T07::28.462- I CONTROL [initandlisten] ** We suggest setting it to 'never'
--31T07::28.462- I CONTROL [initandlisten]
--31T07::28.463- I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
--31T07::28.463- I CONTROL [initandlisten] ** We suggest setting it to 'never'
--31T07::28.463- I CONTROL [initandlisten]
--31T07::28.466- I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data'
--31T07::28.466- I NETWORK [initandlisten] waiting for connections on port
--31T07::28.467- I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
--31T07::01.201- I NETWORK [initandlisten] connection accepted from 127.0.0.1: # ( connection now open)

啦啦啦

啦啦啦

最新文章

  1. 介绍几个好用的vs插件
  2. Net设计模式实例系列文章总结
  3. 自定义ViewGroup初步探究
  4. RSA加密(C语言)
  5. dede数据库类使用方法 $dsql
  6. 【C-001】printf理解
  7. MVC api json 格式
  8. Redis 高可用性解决方案(Sentinel)
  9. sikuli+java实例
  10. 自定义Toast的显示效果
  11. MongoDB学习笔记-游标
  12. 【转】itunes connect 如何修改主要语言
  13. T-SQL应用,视图、存储过程、触发器、游标、临时表等
  14. Eclipse安装反编译插件JD(Java Decompiler)
  15. Dispatcher & Redirect
  16. myeclispe启动后报错 Subclipse talks to Subversion via a Java API that requires access to native libraries.
  17. Git学习 -- 管理修改
  18. 2764: [JLOI2011]基因补全
  19. Jerry的通过CDS view + Smart Template 开发Fiori应用的blog合集
  20. 001-为什么Java能这么流行

热门文章

  1. mysql 表锁进程非常多的情况
  2. python知识积累
  3. 删除一直处于deleting状态的数据卷
  4. POJ 3388 Japanese Puzzle (二分)
  5. Spring通过注解配置Bean
  6. Remote Debugging (2)
  7. Ng第十三课:聚类(Clustering)
  8. noip第18课作业
  9. Linqpad工具
  10. C语言中:static与extern对变量和函数的作用