分享

大数据mapreduce最后报错,求教。

MNBVC94449 发表于 2013-10-17 21:37:49 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 3 4382
一个文档大概2亿条数据,取其中300w条做marreduce,结果集是6w左右,在最后的时候报了个错。
我是用c#写的程序,错误如下:
MongoDB.Driver.MongoCommandException:Command 'marreduce' failed: MR post processing failed:{ result: "表名xxx",errmsg:"exception: getMore: cursor did't exist on server, possible restart or timeout?" ,code: 13127 ,ok:0.0} .......................................
在MongoDB.Driver.MongoCollection.MapReduce(BsonJavaScript map,BsonJavaScript reduce,IMongoMapReduceOptions options)
.........................
求大虾指点迷津,谢谢.
              
               
                    mapreduce
                    13127
                    c#
                    map
                    reduce
               

已有(3)人评论

跳转到指定楼层
visualbasic2000 发表于 2013-10-17 21:38:19

            超时了。。。
你在写连结的时候,没有定义超时,使用了默认值了。
mongoSvrSetting.ConnectionMode = ConnectionMode.Direct;
                SetReadPreferenceWriteConcern(mongoSvrSetting, config);
                //Replset时候可以不用设置吗?
                mongoSvrSetting.Server = new MongoServerAddress(config.Host, config.Port);
                //MapReduce的时候将消耗大量时间。不过这里需要平衡一下,太长容易造成并发问题
                //From Driver 1.4 Pay attention to this comment
                //The default value for SocketTimeout has been changed from 30 seconds to 0,
                //which is a special value meaning to use the operating system default value,
                //which in turn is infinity. If you actually want a SocketTimeout you now have to set it yourself.
                //The SocketTimeout is currently a server level setting, but most likely in a future release it will be possible to set it at other levels,
                //including for individual operations.
                if (config.socketTimeoutMS != 0)
                {
                    mongoSvrSetting.SocketTimeout = new TimeSpan(0, 0, (int)(config.socketTimeoutMS / 1000));
                }
                if (config.connectTimeoutMS != 0)
                {
                    mongoSvrSetting.ConnectTimeout = new TimeSpan(0, 0, (int)(config.connectTimeoutMS / 1000));
                }
        
回复

使用道具 举报

visualbasic2000 发表于 2013-10-17 21:38:50

            以上代码来自我的MongoDB管理工具。
https://github.com/magicdict/MagicMongoDBTool
        
回复

使用道具 举报

MNBVC94449 发表于 2013-10-17 21:39:39

            谢谢vb2000,我试过你的方法了,我把两个超时都设成2小时,还是报这个错。可能是mapreduce的别的什么设置?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条