- rados
- dbstore
- motr
+- name: dbstore_db_dir
+ type: str
+ level: advanced
+ desc: path for the directory for storing the db backend store data
+ default: /var/run/ceph
+ services:
+ - rgw
+- name: dbstore_db_name_prefix
+ type: str
+ level: advanced
+ desc: prefix to the file names created by db backend store
+ default: dbstore
+ services:
+ - rgw
- name: motr_profile_fid
type: str
level: advanced
The above configuration brings up RGW server on dbstore and creates testid user to be used for s3 operations.
-By default, dbstore creates .db file named 'default_ns.db' where in the data is stored.
+
+By default, dbstore creates .db file *'/var/run/ceph/dbstore-default_ns.db'* to store the data. This can be configured using below options in ceph.conf
+
+ [client]
+ dbstore db dir = <path for the directory for storing the db backend store data>
+ dbstore db name prefix = <prefix to the file names created by db backend store>
## DBStore Unit Tests
}
/* Create DBStore instance */
-DB *DBStoreManager::createDB(string tenant) {
+DB *DBStoreManager::createDB(std::string tenant) {
DB *dbs = nullptr;
pair<map<string, DB*>::iterator,bool> ret;
+ const auto& db_path = g_conf().get_val<std::string>("dbstore_db_dir");
+ const auto& db_name = g_conf().get_val<std::string>("dbstore_db_name_prefix");
+
+ std::string db_full_path = db_path + "/" + db_name + "-" + tenant;
+ ldout(cct, 0) << "DB initialization full db_path("<<db_full_path<<")" << dendl;
/* Create the handle */
#ifdef SQLITE_ENABLED
- dbs = new SQLiteDB(tenant, cct);
+ dbs = new SQLiteDB(db_full_path, cct);
#else
- dbs = new DB(tenant, cct);
+ dbs = new DB(db_full_path, cct);
#endif
/* API is DB::Initialize(string logfile, int loglevel);