我正在使用PythonAnywhere托管我的web应用程序。使用Mongodb作为我的数据库。现在,我的任务是定期进行备份,并随时恢复特定版本的mongodb。
在本地(windows机器)上做这件事很容易。安装Mongodb实用程序并执行命令
mongodump --mongodbConnectionString //From location where this executable is stored
mongorestore --mongodbConnectionString
现在,我面临的挑战是如何从PythonAnywhere中做到这一点。在这里,我应该如何使用这些实用程序
我阅读了上的文档,并按照以下步骤安装了mongodb
上面写着:
To start the database, run $HOME/webapps/application/mongodb-linux-architecture-version/bin/mongod --auth --dbpath $HOME/webapps/application/data/ --port number.
To stop MongoDB while it is running in the foreground, press Ctrl + C.
但我需要保持数据库始终运行
我该怎么做呢?
请给我.Thanks
我使用的是Slim 4框架,以及Jenssegers MongoDB库和胶囊(来自Laravel的照明数据库)。我已经在我的Linux服务器上安装了MongoDB扩展,看起来一切正常,但是我似乎不能向数据库中插入数据,也不能从数据库中获取任何东西。我已经尝试过使用查询构建器和Eloquent。我的查询构建器示例代码如下。 use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule;
$capsule->getDatabaseManager()->extend('mongodb
我在MongoDB之前卸载了它,但由于以下错误,现在无法安装它:
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe).
我运行了这个命令-> sudo apt-get install -y mongodb-org
我的终端输出如下:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically instal
我想知道MongoDB内存消耗的情况。我已经阅读了相应的手册部分和其他关于该主题的问题,但我认为这种情况是不同的。我可以向你请教一下吗?
这是数据库日志文件中的错误:
Fri Oct 26 20:34:00 [conn1] ERROR: mmap private failed with out of memory. (64 bit build)
Fri Oct 26 20:34:00 [conn1] Assertion: 13636:file /docdata/mongodb/data/xxx_letters.5 open/create failed in createPrivateMap
我有一个使用mongo驱动程序连接mongodb的golang应用程序。如果我以go run main.go的形式运行主文件,那么一切都很好--它能够像预期的那样连接到数据库。
但是,如果我对应用程序进行了文档化,每当我点击与数据库交互的api时,它就无法与数据库通信,而该api将退出与消息的交互。
数据库字段必须在操作时设置
Dockerfile
ARG ROOT="/go/src/bitbucket.org/myteam/myapp"
ARG BIN="/go/bin"
FROM golang:1.13 as build
ARG ROOT
ARG BIN