在Windows 7和Ubuntu上使用相同的mongodb数据库(Use same mongodb database over Windows 7 & Ubuntu)
我想在Windows 7上使用与在Ubuntu上使用的相同的MongoDB数据库。
在Ubuntu上,我进入了文件:
/etc/mongodb.conf
并将
dbpath=/var/lib/mongodb
更改为dbpath=/media/meaniostack/OS/data/db
,这是Windows分区上的数据库。当我尝试启动mongod和mongo时,我收到以下错误:
MongoDB shell version: 2.6.7 connecting to: test 2015-01-30T14:19:11.027-0500 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2015-01-30T14:19:11.028-0500 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146 exception: connect failed
但是,当我回到
dbpath=/var/lib/mongodb
,它就像正常一样工作。 请记住,我已经安装了media/meaniostack/OS
我该如何完成这项工作,是否可能? 与Ubuntu相比,mongodb使用不同类型的存储吗?
I would like to use the same MongoDB database I use on windows 7 as I do on Ubuntu.
On Ubuntu, I went into the file:
/etc/mongodb.conf
and changed
dbpath=/var/lib/mongodb
todbpath=/media/meaniostack/OS/data/db
which is the database on the windows partition.When I tried starting up mongod & mongo, I got the following error:
MongoDB shell version: 2.6.7 connecting to: test 2015-01-30T14:19:11.027-0500 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2015-01-30T14:19:11.028-0500 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146 exception: connect failed
However, when I go back to
dbpath=/var/lib/mongodb
, it works like normal. Keep in mind, that I have mountedmedia/meaniostack/OS
How do I make this work, and is it possible? Does mongodb, use a different type of storage compared to the one in Ubuntu?
原文:https://stackoverflow.com/questions/28243130
最满意答案
如果您不是管理员,则无法安装全局模块。 尝试使用
sudo
运行命令,如果可以的话sudo npm install -g nodemon
您也可以通过删除
-g
选项来将nodemon安装到本地文件夹中。You can't install a global module if you are not as an admin. Try to run the command with
sudo
if you cansudo npm install -g nodemon
You can also install nodemon in your local folder by removing the
-g
option.
相关问答
更多-
使用pip faces错误在ubuntu16.04上安装Django(Installation of Django on ubuntu16.04 using pip faces error)[2024-03-16]
像sudo一样运行pip并不是最好的选择。 这就像为超级用户提供对外部应用程序的访问权限。 而是首先尝试这个: pip install --user django==1.11 Running pip as sudo is not the best of choices. That is like giving superuser access to an external application. Rather try this first: pip install --user django==1.11 ... -
如何在Ubuntu16.04中安装pygame for python3.5?(How to install pygame for python3.5 in Ubuntu16.04?)[2023-01-20]
你可能没有安装pip3.5 ,所以我相信你并不容易。 所以一个解决方案可能是开始安装pip3.5 。 根据这篇关于如何在Ubuntu中安装pip3 文章 ,以下是针对您的问题的可能解决方案。 首先安装Python 3的setuptools sudo apt-get install python3-setuptools 然后安装pip (它将包含pip3.5 ): sudo easy_install3 pip 在前两个命令之后,你应该安装pip3.5 。 现在你可以简单地做 sudo pip3.5 ins ... -
看起来它安装正确。 唯一的错误是警告: npm WARN optional dep failed, continuing fsevents@1.0.12 请注意, fsevents仅用于支持OS X主机( https://github.com/strongloop/fsevents ),在Linux / Ubuntu上不需要。 您应该能够在终端中运行nodemon命令来验证这一点。 It looks like it installed correctly. The only error is a warn ...
-
ubuntu16.04上的Node.js - 无法安装并运行nodemon(Node.js on ubuntu16.04 - Failing to install and run nodemon)[2022-11-13]
如果您不是管理员,则无法安装全局模块。 尝试使用sudo运行命令,如果可以的话 sudo npm install -g nodemon 您也可以通过删除-g选项来将nodemon安装到本地文件夹中。 You can't install a global module if you are not as an admin. Try to run the command with sudo if you can sudo npm install -g nodemon You can also install ... -
在本地安装和使用nodemon(Install and use nodemon locally)[2024-01-06]
你想用nodemon为index.js提供服务,所以在命令开始时使用nodemon。 将它安装到项目中后,您不必在节点模块中追踪nodemon的路径。 "devserver": "nodemon index.js" you want to serve index.js with nodemon so use nodemon at the start of command. You dont have to trace the path of nodemon in node modules, after y ... -
我认为构建脚本是错误的: gcc -g -O2 -o scopy scopy.o gggetopt.o -lm -L. -lspro 由于-lspro使用-lm函数,因此必须-lspro使用它。 有些背景,请参阅此答案。 I think the build script is just wrong: gcc -g -O2 -o scopy scopy.o gggetopt.o -lm -L. -lspro Since -lspro uses functions from -lm, it ...
-
您是说在设置路径之前检查了命令窗口中的路径? 你如何启动命令窗口? I solved my issue. It turns out that there was a space directly before my npm user environment variable. For example, the PATH variable looked like this: C:\path1;C:\path2; C:\Users\name\AppData\Roaming\npm Note the space ...
-
bash没有找到nodemon 。 编辑~/.bash_profile文件并添加: PATH=$PATH:/usr/local/bin/bin/ 启动一个新shell以查看它是否有效,或者运行source ~/.bash_profile以使其适用于当前会话。 nodemon is not being found by bash. Edit your ~/.bash_profile file and add: PATH=$PATH:/usr/local/bin/bin/ Start a new shell t ...
-
我只是通过将我的node.js版本从0.10.22升级到0.10.28来成功安装nodemon模块。 现在它有效!!! I succeed to install the nodemon module simply by upgrading my version of node.js from 0.10.22 to 0.10.28. Now it works !!!
-
nodemon显示es16的错误(nodemon show error for es16)[2022-05-24]
看起来,nodejs使用的是ES6 / E2015而不是nodemon。 结合babel-installation的提示我提出了一个nodemon --exec nodejs进行试验...... It seems, that nodejs is using ES6/E2015 and nodemon not. Combining the hint from the babel-installation I propose a nodemon --exec nodejs for a trial...