opencb / cellbase

High-Performance NoSQL database and RESTful web services to access to most relevant biological data
Apache License 2.0
89 stars 53 forks source link

Load data into MongoDB #278

Closed apaytuvi closed 8 years ago

apaytuvi commented 8 years ago

I am trying to load data to the MongDB by doing:

../build/bin/cellbase.sh load -d variation --database cellbase_slycopersicum_sl2.50 -i slycopersicum_SL2.50_build/ -L debug -Dmongodb-index-folder=/Synology/server_variants/cellbase/cellbase-app/app/mongodb-scripts/

However, I get the following error:

[main] DEBUG org.opencb.commons.datastore.mongodb.MongoDataStoreManager - MongoDataStoreManager: creating a MongoDataStore object for database: 'cellbase_slycopersicum_gca0001881152_v4' ...
Exception in thread "main" java.lang.IllegalArgumentException: No match for read preference of ${CELLBASE.DB.MONGODB.READPREFERENCE}
    at com.mongodb.ReadPreference.valueOf(ReadPreference.java:237)
    at org.opencb.commons.datastore.mongodb.MongoDataStoreManager.create(MongoDataStoreManager.java:114)
    at org.opencb.commons.datastore.mongodb.MongoDataStoreManager.get(MongoDataStoreManager.java:93)
    at org.opencb.cellbase.mongodb.impl.MongoDBAdaptorFactory.createMongoDBDatastore(MongoDBAdaptorFactory.java:113)
    at org.opencb.cellbase.mongodb.impl.MongoDBAdaptorFactory.getVariationDBAdaptor(MongoDBAdaptorFactory.java:225)
    at org.opencb.cellbase.mongodb.impl.MongoDBAdaptorFactory.getVariationDBAdaptor(MongoDBAdaptorFactory.java:220)
    at org.opencb.cellbase.mongodb.loader.MongoDBCellBaseLoader.getDBAdaptor(MongoDBCellBaseLoader.java:154)
    at org.opencb.cellbase.mongodb.loader.MongoDBCellBaseLoader.init(MongoDBCellBaseLoader.java:128)
    at org.opencb.cellbase.core.loader.LoadRunner.load(LoadRunner.java:96)
    at org.opencb.cellbase.core.loader.LoadRunner.load(LoadRunner.java:68)
    at org.opencb.cellbase.app.cli.LoadCommandExecutor.loadVariationData(LoadCommandExecutor.java:223)
    at org.opencb.cellbase.app.cli.LoadCommandExecutor.execute(LoadCommandExecutor.java:122)
    at org.opencb.cellbase.app.CellBaseMain.main(CellBaseMain.java:91)

What should I do?

apaytuvi commented 8 years ago

I needed to add -C config.json in the command with a config file with "readPreference": "nearest" set. So, the issue is solved.