Define small files in ShardingTest

I know there is a ShardingTest () object that can be used to create a test wrapper (see https://serverfault.com/questions/590576/installing-multiple-mongodb-versions-on-the-same-server ), for example :

mongo --nodb
cluster = new ShardingTest({shards : 3, rs : false})

However, given that the disk space in my test machine is limited, and I get "Not enough free space for log files" errors when using the above command, I would like to set the smallfiles parameter. I have not tried:

cluster = new ShardingTest({shards : 3, rs : false, smallfiles: true})

How can small files be included for a fragment test, please? Thank!

+4
source share
2 answers

, MongoDB, - . ,

ShardingTest

. 30 :

    // Allow specifying options like :
    // { mongos : [ { noprealloc : "" } ], config : [ { smallfiles : "" } ], shards : { rs : true, d : true } }

mongos, config shards ( non replicaset ). . :

else if( isObject( numShards ) ){
            tempCount = 0;
            for( var i in numShards ) {
                otherParams[ i ] = numShards[i];
                tempCount++;
            }

            numShards = tempCount;

. :

cluster = new ShardingTest({shards : {d0:{smallfiles:''}, d1:{smallfiles:''}, d2:{smallfiles:''}}})

, , -smallfiles:

shell: started program mongod --port 30000 --dbpath /data/db/test0 --smallfiles --setParameter enableTestCommands=1 
shell: started program mongod --port 30001 --dbpath /data/db/test1 --smallfiles --setParameter enableTestCommands=1 
shell: started program mongod --port 30002 --dbpath /data/db/test2 --smallfiles --setParameter enableTestCommands=1

, , javascript .

+6

ShardingTest() .

, smallFiles :

cluster = new ShardingTest({shards: {d0:{smallfiles:''}, d1:{smallfiles:''}}})
+2

Source: https://habr.com/ru/post/1542771/


All Articles