I started playing with MongoDB this weekend. It’s a cool little database, and John Nunemaker’sMongoMapper gem is a treat. Mongo’s maintainers are nice enough to provide pre-compiled binaries for OS X, but you still have to do a little setup and configuration. (There’s actually a portfile on MacPorts, but it wasn’t up-to-date with the latest version when I found it.)
Here’s how I got the server installed and running as a daemon in OS X, for local development.
Download, unpack, and install the pre-compiled 64-bit binaries:
1 2 3 4 5 |
curl -O http://downloads.mongodb.org/osx/mongodb-osx-x86_64-1.4.0.tgz tar xzf mongodb-osx-x86_64-1.4.0.tgz sudo mv mongodb-osx-x86_64-1.4.0 /usr/local/mongodb sudo mkdir /usr/local/mongodb_data /var/log/mongodb sudo chown -R root /usr/local/mongodb |
(If you’re on a 32-bit machine, substitute in i386
for each x86_64
above.)
Next, you’ll want to make a config file so you can change the server’s options without fiddling with command-line arguments.
Save as: /usr/local/mongodb/mongod.conf
1 2 3 4 5 |
# Store data alongside MongoDB instead of the default, /data/db/ dbpath = /usr/local/mongodb_data # Only accept local connections bind_ip = 127.0.0.1 |
Now, we’ll make a launchd
job to register the server as an OS X daemon. launchd
will start the server at startup, stop it before shutdown, make sure it stays up, and redirect its output to a nice log file.
Save as: /Library/LaunchDaemons/org.mongodb.mongod.plist
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>org.mongodb.mongod</string> <key>ProgramArguments</key> <array> <string>/usr/local/mongodb/bin/mongod</string> <string>run</string> <string>--config</string> <string>/usr/local/mongodb/mongod.conf</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> <key>WorkingDirectory</key> <string>/usr/local/mongodb</string> <key>StandardErrorPath</key> <string>/var/log/mongodb/output.log</string> <key>StandardOutPath</key> <string>/var/log/mongodb/output.log</string> </dict> </plist> |
相关推荐
您还需要安装MongoDB才能正常运行,因为该项目可以用作日志记录代理。 建立 创建一个MongoDB数据库。 一些好的伪数据可以在找到。 另一个好的工具是 ,它会生成伪造的json,然后可以将其转换为bson。 然后,安装...
遵循mongoDB安装教程(在Ubuntu上: ://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/或在Windows上: ://docs.mongodb.com/manual/tutorial/install )并启动它 如何安装和使用API 进入backend...
翻转以安装 。 平台类 Ubuntu 18.04 依存关系 没有任何。 角色变量 该角色具有以下所示的变量及其默认值: # Ela permite especificar customizar a configuração da instância do MongoDB de acordo ...
意图 kirana / malligai ...安装: Mongodb: ://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ Nodejs: ://nodejs.org/download/ MongoDB: 发射 要在登录时启动启动mongodb: ln -sfv /usr/loc
mongodb-runrs 仅使用一个命令即可运行用于学习和开发的... 转到您的主目录并克隆此存储库的本地副本: $ cd ~$ git clone https://github.com/wingkeet/mongodb-runrs.git入门通过编辑选择您的操作系统和MongoDB版本。
mongoBD4 修改安装路径后报错,服务无法启动,可参考本文方法试试;最后一种方法转被人的,我没遇到,给大家参考
如果安装了 ,则可以在本地构建文档: python2 -m pip install gizagit clone https://github.com/mongodb/docs.gitcd docs/make html如果成功,则构建HTML文件将位于build/<branch>/html/ (例如,在git master...
下载到本地后,在arc, server两个文件夹下分别运行npm install安装依赖包 arc文件夹下通过npm start运行前端文件,http://localhost:3000 server文件夹下通过node app.js运行后端文件, http://localhost:3030 ...
安装 npm install excel-to-mongoDB --save 测验 git clone https://github.com/ngudbhav/excel-to-mongoDB.git cd excel-to-mongoDB/ 导航到该文件夹。 cd test/ nano test.js 现在,此文件需要MongoDB凭
3.转到存储库,然后安装所需的所有软件包: $ cd Express-MongoDB-Authentication $ npm install 4.在route / router.js上编辑Express应用程序的路由! 通过运行app.js确保您的应用程序没有错误。 默认情况下,...
sql到mongodb Node.js脚本,用于将SQL数据库转换为MongoDB数据库。 产品特点 自动检测每个SQL表的主键,并将其复制到MongoDB _id字段。 (可选)使用MongoDB ObjectId重新映射替换键和主键,并重新映射外键。 ...
安装mongoDB服务器和nodejs $ sudo apt-get update $ sudo apt-get install mongodb-org mongodb-org-server nodejs 赢得先决条件 安装 用法 第一次运行 $ sudo npm install 如果您在Linux上运行,请从以下位置更改...
安装yarn add ' ssh://git@github.com:jarjee/mongodb-realm-rollup#main 'npm install ' ssh://git@github.com:jarjee/mongodb-realm-rollup#main '入门只是这个插件import realm from 'mongodb-realm-rollup' ;...
转到安装MongoDB的文件夹(通常为~/usr/local/var/mongodb/ ),然后运行sudo mongod 。 这是数据库的架构: _id :主键 start :键入的开始时间。 格式是UNIX时间。 end :与上述相同,但用于结束时间。 body ...
之后,您需要安装mongodb。 Go to http://docs.mongodb.org/manual/installation/ 现在,您可以使用bower和npm安装项目依赖项,请转到Backbone4Dummies / npm install bower install 怎么跑? 转到api-node...
MongoDB-并安装mongodb-如果您刚刚开始,请查阅。 如果您使用的是ubuntu,这是可以使用的首选存储库... $ curl -sL https://deb.nodesource.com/setup | sudo bash - $ sudo apt-get update $ sudo apt-get ...
佐夫 Zoff(发音为søff )是基于YouTube和SoundCloud的共享(免费)广播...安装 先决条件: MongoDB : https://www.mongodb.org/ NodeJS : https://nodejs.org/en/ npm : https://www.npmjs.com/ 将此存储库克隆到
由于该系统是非常灵活的,它很容易安装,实施和调试新的服务。 更快的速度: 分布式计算系统可以有多台计算机的计算能力,使得它比其他系统有更快的处理速度。 开放系统: 由于它是开放的系统,本地或者远程都可以...
有用的链接有关中介器和配置的其他信息: : OpenFN github 存储库(包括语言): : OpenFN 平台,影响了这个项目 不使用docker时手动安装和设置mongodb(手动安装openhim的要求): ://docs.mongodb....
安装这是的模块,可以通过安装。 它取决于软件包并使用promises。 $ npm install --save mongodb mongodb-cron例下面是一个简单的示例,展示了在Node.js项目中使用此包的好处。 让我们从初始化数据库连接开始。 ...