{"id":7116,"date":"2012-06-12T09:34:51","date_gmt":"2012-06-12T00:34:51","guid":{"rendered":"http:\/\/fukata.org\/?p=7116"},"modified":"2017-08-11T22:47:42","modified_gmt":"2017-08-11T22:47:42","slug":"mongodb-error-tried-to-insert-object-with-no-valid-shard-key","status":"publish","type":"post","link":"https:\/\/blog.fukata.org\/archives\/7116\/","title":{"rendered":"MongoDB\u306e\u30a8\u30e9\u30fc\u300c8011: tried to insert object with no valid shard key\u300d\u3067\u30cf\u30de\u3063\u305f"},"content":{"rendered":"

\u4eca\u6708\u3082\u65e2\u306b\u4e2d\u65ec\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u6708\u521d\u3081\u3066\u306e\u30d6\u30ed\u30b0\u66f4\u65b0\u3067\u3059\u3002<\/p>\n

\u5f79\u8077\u304c\u4ed8\u304f\u3088\u3046\u306b\u306a\u308a\u3001\u4eca\u307e\u3067\u81ea\u5206\u304c\u884c\u306a\u3063\u3066\u3044\u305f\u4ed5\u4e8b\u3092\u4ed6\u306b\u632f\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u4ee5\u524d\u306b\u6bd4\u3079\u3066\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3059\u308b\u91cf\u304c\u304b\u306a\u308a\u6e1b\u3063\u3066\u591a\u5c11\u7126\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n

\u4eca\u56de\u306f\u3001fluentd\u7d4c\u7531\u3067MongoDB\u306b\u30ed\u30b0\u3092400\u4e07\u4ef6\u307b\u3069\u633f\u308c\u3066\u3044\u305f\u3068\u3053\u308d\u3001\u300c8011: tried to insert object with no valid shard key<\/strong>\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u304b\u306a\u308a\u30cf\u30de\u3063\u305f\u306e\u3067\u30ed\u30b0\u3068\u3057\u3066\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

<\/p>\n

foward\u5148\u3068\u3057\u3066\u30ea\u30e2\u30fc\u30c8\u306b\u8a2d\u7f6e\u3057\u305ffluentd\u306e\u30ed\u30b0\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u51fa\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n

\r\n2012-06-11 21:33:18 +0900: failed to flush the buffer, retrying. error=\"8011: tried to insert object with no valid shard key\" instance=70320056203900\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/mongo-1.6.2\/lib\/mongo\/networking.rb:95:in `send_message_with_safe_check'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/mongo-1.6.2\/lib\/mongo\/collection.rb:979:in `block in insert_documents'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/mongo-1.6.2\/lib\/mongo\/util\/logging.rb:36:in `instrument'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/mongo-1.6.2\/lib\/mongo\/collection.rb:977:in `insert_documents'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/mongo-1.6.2\/lib\/mongo\/collection.rb:353:in `insert'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/fluent-plugin-mongo-0.6.7\/lib\/fluent\/plugin\/out_mongo.rb:139:in `operate_invalid_records'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/fluent-plugin-mongo-0.6.7\/lib\/fluent\/plugin\/out_mongo.rb:118:in `operate'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/fluent-plugin-mongo-0.6.7\/lib\/fluent\/plugin\/out_mongo.rb:106:in `write'\r\n2012-06-11 21:33:18 +0900: \/usr\/lib64\/fluent\/ruby\/lib\/ruby\/gems\/1.9.1\/gems\/fluentd-0.10.22\/lib\/fluent\/buffer.rb:274:in `write_chunk'\r\n<\/pre>\n

no valid shard key\u3068\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u3067\u3066\u3063\u304d\u308ashard key\u306b\u4e0d\u6b63\u306a\u5024\u3067\u3082\u6307\u5b9a\u3057\u3066\u3057\u307e\u3063\u305f\u306e\u304b\u306a\u3068\u601d\u3044\u3001\u305d\u3053\u3070\u304b\u308a\u63a2\u3057\u3066\u3044\u305f\u3093\u3067\u3059\u304c\u3001\u4f3c\u305f\u3088\u3046\u306a\u73fe\u8c61\u306b\u3042\u3063\u305f\u30d6\u30ed\u30b0\u3082\u3042\u307e\u308a\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u30ed\u30fc\u30e9\u30fc\u4f5c\u6226\u7684\u306b\u633f\u5165\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u5185\u5bb9\u3092shard key\u306e\u307f\u304b\u3089\u59cb\u307e\u308a\u3001\u5f90\u3005\u306b\u5897\u3084\u3057\u3066\u3044\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\u305d\u3053\u3067\u3001\u4e00\u756a\u6700\u521d\u306bshard key\u306e\u307f\u3067\u633f\u5165\u3057\u305f\u3068\u3053\u308d\u3001\u6b63\u5e38\u306b\u51e6\u7406\u3067\u304d\u305f\u306e\u3067\u3001shard key\u81ea\u4f53\u304c\u554f\u984c\u3067\u306f\u306a\u3044\u3093\u3060\u306a\u3068\u601d\u3044\u307e\u3057\u305f\u3002\u5f90\u3005\u306b\u5897\u3084\u3057\u3066\u3044\u3063\u305f\u7d50\u679c\u3001\u3042\u308b\u30ad\u30fc\u306b\u5bfe\u3059\u308b\u5024\u304c\u5909\u306b\u6587\u5b57\u5316\u3051\u3092\u8d77\u3053\u3057\u3066\u304a\u308a\u3001\u305d\u308c\u304c\u539f\u56e0\u3067\u5f53\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u305f\u3088\u3046\u3067\u3059\u3002\u305d\u306e\u30ad\u30fc\u3092\u5916\u3057\u305f\u3068\u3053\u308d\u3001\u6b63\u5e38\u306b\u51e6\u7406\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n

\u4eca\u56de\u306f\u3042\u307e\u308a\u6642\u9593\u304c\u306a\u304b\u3063\u305f\u306e\u3067\u76f4\u63a5\u7684\u306a\u539f\u56e0\u306f\u8abf\u3079\u3089\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u4e00\u6bb5\u843d\u7740\u3044\u305f\u3089\u8abf\u3079\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u307e\u305f\u3001\u5c11\u3057\u6c17\u306b\u306a\u3063\u305f\u52d5\u4f5c\u3068\u3057\u3066\u633f\u5165\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u306b\u30ea\u30c8\u30e9\u30a4\u3059\u308b\u3088\u3046\u306a\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u3093\u3067\u3059\u304c\u3001\u30ea\u30c8\u30e9\u30a4\u3059\u308b\u5358\u4f4d\u306fchunk\u3060\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001chunk\u5185\u3067\u7570\u5e38\u306a\u30c7\u30fc\u30bf\u3092\u542b\u307e\u306a\u3044\u3082\u306e\u306b\u95a2\u3057\u3066\u306f\u91cd\u8907\u3057\u3066\u633f\u5165\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002\uff08\u30d7\u30ed\u30b0\u30e9\u30e0\u5074\u304b\u3089\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u4ef6\u6570\u304c\u633f\u5165\u3055\u308c\u3066\u3044\u305f\u305f\u3081\uff09\u30b3\u30ec\u3092\u9632\u3050\u65b9\u6cd5\u304c\u3042\u308b\u306e\u304b\u3069\u3046\u304b\u306f\u307e\u3060\u5206\u304b\u308a\u307e\u305b\u3093\u304c\u30fb\u30fb\u30fb\u3002<\/p>\n

\u74b0\u5883<\/h2>\n

MongoDB: 2.0.6
\nfluentd: 1.1.6<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4eca\u6708\u3082\u65e2\u306b\u4e2d\u65ec\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u6708\u521d\u3081\u3066\u306e\u30d6\u30ed\u30b0\u66f4\u65b0\u3067\u3059\u3002 \u5f79\u8077\u304c\u4ed8\u304f\u3088\u3046\u306b\u306a\u308a\u3001\u4eca\u307e\u3067\u81ea\u5206\u304c\u884c\u306a\u3063\u3066\u3044\u305f\u4ed5\u4e8b\u3092\u4ed6\u306b\u632f\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u4ee5\u524d\u306b\u6bd4\u3079\u3066\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3059\u308b\u91cf\u304c\u304b\u306a\u308a\u6e1b\u3063\u3066\u591a\u5c11\u7126\u3063 … \u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":2,"featured_media":9223372036854775807,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1980],"tags":[975,1088],"_links":{"self":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/7116"}],"collection":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/comments?post=7116"}],"version-history":[{"count":0,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/7116\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media\/9223372036854775807"}],"wp:attachment":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media?parent=7116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/categories?post=7116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/tags?post=7116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}