Tag: 冗余

Node.js – 需要mongoose在这里和那里造成冗余?

我有以下的Node.js目录结构。 |–app/ |–app.js |–routers/ |–index.js/ |–models/ |–schemas.js |–post.js 在app.js中 ,有一行喜欢这个mongoose.connect('mongodb://localhost/' + config.DB_NAME); 。 在schema.js中 : var mongoose = require('mongoose') , Schema = mongoose.Schema , ObjectId = Schema.ObjectId; var PostSchema = new Schema({ title: String , author: String , body: String , creataAt: { type: Date , default: Date.now } }); // other schemas goes here […]

Elasticsearch部署在2服务器负载均衡节点js应用程序设置中

我有我的节点JS应用程序的以下生产设置: 我现在要在这个设置中集成Elasticsearch。 我的问题是关于在生产环境中部署Elasticsearch的最佳实践。 我所有的实例都是虚拟机,我知道Elasticsearch使用了大量的内存。 因此,我是否应该在自己的服务器(服务器3)上设置Elasticsearch,在服务器1和服务器2上将其设置为群集(非常类似于Mongo数据库副本集),或者将其作为单独的实例安装在每台服务器上。 select的方法有什么好处? 非常感谢!