R
R
Rodion Goncov2016-11-01 14:24:19
Yii
Rodion Goncov, 2016-11-01 14:24:19

Yii2 & MongoDB: Problem adding new shard to cluster?

There is an application on yii2 and mongodb. It has a console script that imports data from an external source into the database. Because Assuming a large amount of data (10Gb+) decided to use sharding. I used https://habrahabr.ru/post/217393/ as a guide, everything worked fine, I created and added a shard on a remote host, connected it via sh.addShard(":"), db.printShardingStatus() shows that the shard has been added, but the balancer does not transfer chunks to it, and also when starting the yii2 console script again, it says:
Exception 'yii\mongodb\Exception' with message ':: Request contains sharding metadata, but the server has not been made sharding aware.'
in /home/work/www/rtb-admin/vendor/yiisoft/yii2-mongodb/Collection.php:451
Stack trace:
#0 /home/work/www/rtb-admin/vendor/yiisoft/yii2-mongodb/ActiveRecord.php(265): yii\mongodb\Collection->update(Array, Array)
#1 /home/work/www/ rtb-admin/vendor/yiisoft/yii2/db/BaseActiveRecord.php(695): yii\mongodb\ActiveRecord->updateInternal(Array)
#2 /home/work/www/rtb-admin/vendor/yiisoft/yii2/db /BaseActiveRecord.php(634): yii\db\BaseActiveRecord->update(true, Array)
#3 save(true, Array)
#4 /home/work/www/rtb-admin/commands/GetMetricaController.php(149): app\models\DmpRawData->setNewApp(Array)
#5 /home/work/www/rtb- admin/commands/GetMetricaController.php(93): app\commands\GetMetricaController->import(Array)
#6 [internal function]: app\commands\GetMetricaController->actionLogs()
#7 /home/work/www/rtb-admin/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#8 /home/work/www/rtb-admin/vendor/yiisoft /yii2/base/Controller.php(154): yii\base\InlineAction->runWithParams(Array)
#9 /home/work/www/rtb-admin/vendor/yiisoft/yii2/console/Controller.php(128) : yii\base\Controller->runAction('logs', Array)
#10 /home/work/www/rtb-admin/vendor/yiisoft/yii2/base/Module.php(454): yii\console\Controller- >runAction('logs', Array)
#11 /home/work/www/rtb-admin/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('get-metrica /log...', Array)
#12 /home/work/www/rtb-admin/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('get-metrica /log...',array)
#13 /home/work/www/rtb-admin/vendor/yiisoft/yii2/base/Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))
#14 /home /work/www/rtb-admin/yii(20): yii\base\Application->run()
#15 {main}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question