run mongodb问题
mongod --dbpath /usr/local/var/mongodb
2018-07-03T10:50:12.444+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] MongoDB starting : pid=44555 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=huhaifengdeMacBook-Pro.local
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] db version v4.0.0
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] allocator: system
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] modules: none
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] build environment:
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] distarch: x86_64
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] target_arch: x86_64
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "/usr/local/var/mongodb" } }
2018-07-03T10:50:12.458+0800 I STORAGE [initandlisten] Detected data files in /usr/local/var/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-07-03T10:50:12.458+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7680M,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),statistics_log=(wait=0),verbose=(recovery_progress),
2018-07-03T10:50:13.065+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:65896][44555:0x7fffa9ffe380], txn-recover: Main recovery loop: starting at 10/5888
2018-07-03T10:50:13.160+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:160125][44555:0x7fffa9ffe380], txn-recover: Recovering log 10 through 11
2018-07-03T10:50:13.224+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:224134][44555:0x7fffa9ffe380], txn-recover: Recovering log 11 through 11
2018-07-03T10:50:13.273+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:273601][44555:0x7fffa9ffe380], txn-recover: Set global recovery timestamp: 0
2018-07-03T10:50:13.347+0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2018-07-03T10:50:13.427+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/usr/local/var/mongodb/diagnostic.data'
2018-07-03T10:50:13.431+0800 I NETWORK [initandlisten] waiting for connections on port 27017
const express = require('express')
const mongoose = require('mongoose')
//链接mongo
const DB_URL = 'mongodb://localhost:27017/'
mongoose.connect(DB_URL)
mongoose.connection.on('connected', function(){
console.log('mongo connect success!')
})
// 新建app
const app = express()
app.get('/', function (req, res) {
res.send('<h1>Hello World1e23</h1>')
})
app.get('/data', function(req, res) {
res.json({name: 'hhf12ees3', type: 'IT'})
})
app.listen(9093, function(){
console.log('Node app start at port 9093')
})
报问题 [nodemon] app crashed - waiting for file changes before starting...
怎么解决
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我解决了一定要有个数据库名才能跑起来
??????
这不是成功了?
关于MongoDB
首先是警告不是错误,并不会造成你不能运行;
其次警告的内容是不是自己先理解一下,看看有什么不懂的地方?
关于NodeJS
可能要说英文不好,那我们来一个词一个词读读
意思是不是很明白?由于某种错误应用不能成功启动,那么现在能重试吗?不管怎么重试还是会失败对不对?所以nodemon要等待文件有变更后再重试是不是更有道理一些呢?
那到底是什么问题?看日志啊,没有日志鬼知道什么问题。
无关的话:建议楼主看到一大堆英文就算很崩溃还是读一下,并没有你想象的那么难。永远不读就永远不会懂,读一读,慢慢就越来越容易。