python - Open edX and split mongo consumes disk space -
i using open edx uses mongodb store courses. running three-node replica set. using split mongo - feature makes copy of current document (backup) before editing. time passes by, piles up, resulting in consumption of large disk space. there around 30 courses , when export it, consumes around 2-3 gb. however, disk space using
i tried clean unwanted courses using this script
upon executing in primary member, takes time , deletes unwanted documents. not release disk space.
rs0:secondary> db.stats() { "db" : "edxapp", "collections" : 5, "objects" : 277557, "avgobjsize" : 112645.21484235671, "datasize" : 31265467896, "storagesize" : 57843929088, "numextents" : 0, "indexes" : 6, "indexsize" : 6938624, "ok" : 1 } root@mongo:~# df filesystem 1k-blocks used available use% mounted on udev 4082828 12 4082816 1% /dev tmpfs 817564 396 817168 1% /run /dev/xvda1 8115168 1805528 5874364 24% / none 4 0 4 0% /sys/fs/cgroup none 5120 0 5120 0% /run/lock none 4087804 0 4087804 0% /run/shm none 102400 0 102400 0% /run/user /dev/xvdf 62904320 57542660 5361660 92% /edx /dev/xvdh 72117576 53012 68378164 1% /tmp/repairdb i tried compact db using
rs0:secondary> db.runcommand( { compact : 'modulestore.structures', force: 'true' } ) { "ok" : 1 } it didn't either.
could please let me know how reclaim disk space in such situation? want in prod server fast can.
you need initial sync. 1 secondary @ time , step down primary , initial sync on too.
so, stop secondary , remove files nodes dbpath. start node , let initial sync. repeat nodes.
Comments
Post a Comment