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.
我正在使用 print 来调试我的 map/reduce 查询,尽管当我将数据库分区为分片时,来自 print 的输出被重定向到存储数据的分片。那么如何将输出从 mongod 实例重定向到 mongos 实例?
不幸的是,没有好的方法可以做到这一点。当您在服务器端 javascript(如 map-reduce)中执行打印语句时,打印将显示在 javascipt 代码正在执行的任何服务器上。在非分片集合上运行时,这将是数据库的主分片。在分片集合上,这可以在任何分片上,具体取决于代码在遇到 print 语句时运行的位置。