Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以从主集群动态打开/关闭 redis 订阅?我问的原因是我只想一次订阅一个集群,但如果该集群死了,我需要让另一个集群订阅。
从根本上说,主集群是否可以仅通过 api 向分叉集群发送消息?
在 master 中,您可以轻松地将消息发送到集群,您只需保存作为 fork() 调用的结果的 worker 对象。
var cluster = require("cluster"); worker = cluster.fork(); worker.on("message,function(msg){ console.log("Master says:" + msg); }); worker.send({message:'hello'});