草庐IT

grunt-connect-proxy

全部标签

mongodb - 在 Docker 启动期间,我收到此消息 : "getting the final child' s pid from pipe caused "read init-p: connection reset by peer"

我在CentOSLinux7.6.1810和PleskOnyx17.8.11下安装了Docker,一切正常。几个小时以来,我无法再启动mongoDB或Docker。我收到此错误消息{"message":"OCIruntimecreatefailed:container_linux.go:344:startingcontainerprocesscaused\"process_linux.go:297:gettingthefinalchild'spidfrompipecaused\\\"readinit-复制代码p:连接由对等方重置\\\“\”:未知“它会是什么?

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running

当docker ps出现CannotconnecttotheDockerdaemonatunix:///var/run/docker.sock.Isthedockerdaemonrunning以下报错时,首先systemctlstatusdocker查看docker服务的状态如果处于关闭状态则需要启动docker服务systemctlstartdocker如果服务是启动状态docker  ps还是报这个错vim/usr/lib/systemd/system/docker.service[Unit]Description=DockerApplicationContainerEngineDocum

node.js - 使用 connect-mongo 和 mongoose 在 mongodb 中存储 session

当我尝试使用mongodb配置express.jssession存储时,左右出现错误。我正在为我的框架使用机车并配置了Mongoose。在我的02_mongoose.js的初始化程序目录中,我有这个。module.exports=function(){mongoose.connect('mongodb://localhost:27018/basbac');mongoose.model('User',UserSchema);}我知道我已连接到数据库,因为我可以将我的用户拉入我的Controller。DeveloperController.show=function(){varself=t

node.js - 为什么这个 MongoDB 连接在 grunt 脚本中不起作用?

如果我使用Node运行它,它会打印“已连接到数据库”:varMongoClient=require("mongodb").MongoClient;MongoClient.connect("mongodb://localhost/db1",function(err,db){if(err){throwerr;}console.log("ConnectedtoDatabase");db.close();});但是,如果我尝试使用Grunt任务运行它,它什么也不做,而且是静默的。module.exports=function(grunt){returngrunt.registerTask("t

node.js - 如何在 Connect 中间件中对 mongoDB 进行异步调用?

假设我有以下Express/Connect中间件:returnfunction(req,res,next){mongoose.connect(url,options);varConfig=mongoose.model('Config',mongoose.Schema({field1:Boolean,field2:[]}));Config.findOne({},function(err,doc){if(!err){if(someCondition)//somelogic:sendresponseandinterruptmiddlewarechainres.end('Somerespons

php - 审查器 + PHP + MongoDB : Connection refused

在Scrutinizer上运行测试时,我无法连接到MongoDB。我的测试套件出错了MongoConnectionException:Failedtoconnectto:localhost:27017:Connectionrefused它需要任何凭据吗?我需要以某种方式启用MongoDB吗?我需要告诉PHP我想使用它吗?(显然,我没有在SO、网络或Scrutinizer文档中找到任何内容。) 最佳答案 你启用了吗?你应该通过添加这个来做到这一点:build:environment:mongodb:true在你的配置文件中。我在这里找

mongodb - 路径 "doctrine_mongodb.connections"的类型无效。预期的数组,但得到了字符串

我对编码和这个网站还很陌生,所以对于我会和/或不会犯的错误,我深表歉意。我正在尝试为mongoDB生成setter和getter(使用symfony3)但是当我输入控制台时phpC:\wamp64\www\test\app\consoledoctrine:mongodb:generate:documentsMainBundle我收到这个错误:[Symfony\Component\Config\Definition\Exception\InvalidTypeException]Invalidtypeforpath"doctrine_mongodb.connections".Expecte

javascript - 从 mongodb connect 和 find 返回一个数组

我有以下代码用于连接到我的MongoDB实例并返回一些记录。我需要遍历游标结果来为我的应用程序创建合适的数据结构。但是,我努力弄清楚如何将表数组的内容返回给调用函数。如果我预定义一个表变量,它就可以工作,但这不是我需要实现的。如何让findUsage函数将表数组返回给调用MongoClient.connect代码?constMongoClient=require('mongodb').MongoClientconstassert=require('assert')consturl='mongodb://localhost:27017/test'consttable=[]constfin

node.js - MongoClient.connect 仅一次

所以在下面的函数中,我总是与我的mongodb建立新的连接。我将如何更改我的代码,以便它只在开始时连接一次,而不是在所有这些功能中连接一次。functiongetData(callback){arrayOfArticles=[];MongoClient.connect(url,{useNewUrlParser:true},callback,function(err,db){if(err)throwerr;letdbo=db.db('testdb');article=dbo.collection('testname').find({}).toArray(function(err,arti

node.js - 连接到副本集时的“MongoError: no mongos proxy available”

我正在遵循本教程(https://github.com/drginm/docker-boilerplates/tree/master/mongodb-replicaset),以便获得三个实例的mongodb副本集,以在docker-compose中工作。这是我到目前为止已采取的步骤:1)我已经将setup和mongo-rs0-1文件夹复制到了我的根目录中。2)我已经将三个mongo实例和安装实例添加到我的docker-compose文件中。现在看起来像这样:version:'3'services:mongo-rs0-1:image:"mongo-start"build:./mongo-