From e4ef00304dc93cb33804070c0c15cb29c9263b2c Mon Sep 17 00:00:00 2001 From: Kengo Nakatsuka Date: Thu, 22 Jun 2023 13:53:16 +0900 Subject: [PATCH 1/8] Add -dbURI option --- src/app/contextBroker/contextBroker.cpp | 5 +- src/lib/mongoBackend/MongoGlobal.cpp | 4 +- src/lib/mongoBackend/MongoGlobal.h | 1 + src/lib/mongoDriver/mongoConnectionPool.cpp | 100 ++++++++++++-------- src/lib/mongoDriver/mongoConnectionPool.h | 1 + test/unittests/main_UnitTest.cpp | 4 +- 6 files changed, 74 insertions(+), 41 deletions(-) diff --git a/src/app/contextBroker/contextBroker.cpp b/src/app/contextBroker/contextBroker.cpp index 7e81493ad0..bf81abec8f 100644 --- a/src/app/contextBroker/contextBroker.cpp +++ b/src/app/contextBroker/contextBroker.cpp @@ -148,6 +148,7 @@ char authMech[64]; char authDb[64]; bool dbSSL; bool dbDisableRetryWrites; +char dbURI[1024]; char pidPath[256]; bool harakiri; bool useOnlyIPv4; @@ -276,6 +277,7 @@ bool logDeprecate; #define NGSIV1_AUTOCAST_DESC "automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations" #define MQTT_MAX_AGE_DESC "max time (in minutes) that an unused MQTT connection is kept, default: 60" #define LOG_DEPRECATE_DESC "log deprecation usages as warnings" +#define DBURI_DESC "complete URI for database connection" @@ -295,6 +297,7 @@ PaArgument paArgs[] = { "-port", &port, "PORT", PaInt, PaOpt, 1026, 1, 65535, PORT_DESC }, { "-pidpath", pidPath, "PID_PATH", PaString, PaOpt, PIDPATH, PaNL, PaNL, PIDPATH_DESC }, + { "-dbURI", dbURI, "MONGO_URI", PaString, PaOpt, _i "", PaNL, PaNL, DBURI_DESC }, { "-dbhost", dbHost, "MONGO_HOST", PaString, PaOpt, LOCALHOST, PaNL, PaNL, DBHOST_DESC }, { "-rplSet", rplSet, "MONGO_REPLICA_SET", PaString, PaOpt, _i "", PaNL, PaNL, RPLSET_DESC }, { "-dbuser", user, "MONGO_USER", PaString, PaOpt, _i "", PaNL, PaNL, DBUSER_DESC }, @@ -1213,7 +1216,7 @@ int main(int argC, char* argV[]) alarmMgr.init(relogAlarms); mqttMgr.init(mqttTimeout); orionInit(orionExit, ORION_VERSION, policy, statCounters, statSemWait, statTiming, statNotifQueue, strictIdv1); - mongoInit(dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, dbDisableRetryWrites, mtenant, dbTimeout, writeConcern, dbPoolSize, statSemWait); + mongoInit(dbURI, dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, dbDisableRetryWrites, mtenant, dbTimeout, writeConcern, dbPoolSize, statSemWait); metricsMgr.init(!disableMetrics, statSemWait); logSummaryInit(&lsPeriod); diff --git a/src/lib/mongoBackend/MongoGlobal.cpp b/src/lib/mongoBackend/MongoGlobal.cpp index 876a8daeec..189fd2f93c 100644 --- a/src/lib/mongoBackend/MongoGlobal.cpp +++ b/src/lib/mongoBackend/MongoGlobal.cpp @@ -104,6 +104,7 @@ bool mongoMultitenant(void) */ void mongoInit ( + const char* dbURI, const char* dbHost, const char* rplSet, std::string dbName, @@ -123,7 +124,8 @@ void mongoInit // Set the global multitenant variable multitenant = mtenant; - if (orion::mongoConnectionPoolInit(dbHost, + if (orion::mongoConnectionPoolInit(dbURI, + dbHost, dbName.c_str(), rplSet, user, diff --git a/src/lib/mongoBackend/MongoGlobal.h b/src/lib/mongoBackend/MongoGlobal.h index 53d86c6194..9b750e01b5 100644 --- a/src/lib/mongoBackend/MongoGlobal.h +++ b/src/lib/mongoBackend/MongoGlobal.h @@ -71,6 +71,7 @@ extern bool mongoMultitenant(void); */ void mongoInit ( + const char* dbURI, const char* dbHost, const char* rplSet, std::string dbName, diff --git a/src/lib/mongoDriver/mongoConnectionPool.cpp b/src/lib/mongoDriver/mongoConnectionPool.cpp index 281b1c472c..b1ae052654 100644 --- a/src/lib/mongoDriver/mongoConnectionPool.cpp +++ b/src/lib/mongoDriver/mongoConnectionPool.cpp @@ -316,6 +316,7 @@ static void mongoDriverLogger */ static std::string composeMongoUri ( + const char* dbURI, const char* host, const char* rplSet, const char* username, @@ -329,54 +330,76 @@ static std::string composeMongoUri { // Compose the mongoUri, taking into account all information - std::string uri = "mongodb://"; + std::string uri; - // Add auth parameter if included - if (strlen(username) != 0 && strlen(passwd) != 0) + if (strlen(dbURI) != 0) { - uri += username + std::string(":") + passwd + "@"; + const char* pwd = strstr(dbURI, "${PWD}"); + if (pwd != NULL) + { + if (strlen(passwd) == 0) + { + LM_X(1, ("Invalid Command Line Options: -dbURI is used with a password substitution, but no password (-dbpwd) is supplied")); + } + + uri = std::string(dbURI, pwd - dbURI) + passwd + (pwd + 6); + } + else + { + uri = dbURI; + } } + else + { + uri = "mongodb://"; - uri += host + std::string("/"); + // Add auth parameter if included + if (strlen(username) != 0 && strlen(passwd) != 0) + { + uri += username + std::string(":") + passwd + "@"; + } - if (strlen(authDb) != 0) - { - uri += authDb; - } + uri += host + std::string("/"); - // First option prefix is '?' symbol - std::string optionPrefix = "?"; + if (strlen(authDb) != 0) + { + uri += authDb; + } - if (strlen(rplSet) != 0) - { - uri += optionPrefix + "replicaSet=" + rplSet; - optionPrefix = "&"; - } + // First option prefix is '?' symbol + std::string optionPrefix = "?"; - if (strlen(mechanism) != 0) - { - uri += optionPrefix + "authMechanism=" + mechanism; - optionPrefix = "&"; - } + if (strlen(rplSet) != 0) + { + uri += optionPrefix + "replicaSet=" + rplSet; + optionPrefix = "&"; + } - if (dbSSL) - { - uri += optionPrefix + "tls=true&tlsAllowInvalidCertificates=true"; - optionPrefix = "&"; - } + if (strlen(mechanism) != 0) + { + uri += optionPrefix + "authMechanism=" + mechanism; + optionPrefix = "&"; + } - if (dbDisableRetryWrites) - { - uri += optionPrefix + "retryWrites=false"; - optionPrefix = "&"; - } + if (dbSSL) + { + uri += optionPrefix + "tls=true&tlsAllowInvalidCertificates=true"; + optionPrefix = "&"; + } - if (timeout > 0) - { - char buf[STRING_SIZE_FOR_LONG]; - i2s(timeout, buf, sizeof(buf)); - uri += optionPrefix + "connectTimeoutMS=" + buf; - optionPrefix = "&"; + if (dbDisableRetryWrites) + { + uri += optionPrefix + "retryWrites=false"; + optionPrefix = "&"; + } + + if (timeout > 0) + { + char buf[STRING_SIZE_FOR_LONG]; + i2s(timeout, buf, sizeof(buf)); + uri += optionPrefix + "connectTimeoutMS=" + buf; + optionPrefix = "&"; + } } LM_T(LmtMongo, ("MongoDB connection URI: '%s'", offuscatePassword(uri, passwd).c_str())); @@ -392,6 +415,7 @@ static std::string composeMongoUri */ int orion::mongoConnectionPoolInit ( + const char* dbURI, const char* host, const char* db, const char* rplSet, @@ -421,7 +445,7 @@ int orion::mongoConnectionPoolInit atexit(shutdownClient); // Set mongo Uri to connect - std::string uri = composeMongoUri(host, rplSet, username, passwd, mechanism, authDb, dbSSL, dbDisableRetryWrites, timeout); + std::string uri = composeMongoUri(dbURI, host, rplSet, username, passwd, mechanism, authDb, dbSSL, dbDisableRetryWrites, timeout); #ifdef UNIT_TEST /* Basically, we are mocking all the DB pool with a single connection. The getMongoConnection() and mongoReleaseConnection() methods diff --git a/src/lib/mongoDriver/mongoConnectionPool.h b/src/lib/mongoDriver/mongoConnectionPool.h index 79ca14c9e3..0dddc183ae 100644 --- a/src/lib/mongoDriver/mongoConnectionPool.h +++ b/src/lib/mongoDriver/mongoConnectionPool.h @@ -46,6 +46,7 @@ extern void mongoVersionGet(int* mayor, int* minor); */ extern int mongoConnectionPoolInit ( + const char* dbURI, const char* host, const char* db, const char* rplSet, diff --git a/test/unittests/main_UnitTest.cpp b/test/unittests/main_UnitTest.cpp index 420f3493b6..7d7b9bc991 100644 --- a/test/unittests/main_UnitTest.cpp +++ b/test/unittests/main_UnitTest.cpp @@ -80,6 +80,7 @@ unsigned long logLineMaxSize = 32 * 1024; bool logDeprecate = false; +char dbURI[1024]; char dbHost[256]; char rplSet[64]; char dbName[64]; @@ -107,6 +108,7 @@ unsigned long fcMaxInterval = 0; */ PaArgument paArgs[] = { + { "-dbURI", dbURI, "DB_URI", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, { "-dbhost", dbHost, "DB_HOST", PaString, PaOpt, (int64_t) "localhost", PaNL, PaNL, "" }, { "-rplSet", rplSet, "RPL_SET", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, { "-dbuser", user, "DB_USER", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, @@ -158,7 +160,7 @@ int main(int argC, char** argV) LM_M(("Init tests")); orionInit(exitFunction, orionUnitTestVersion, SemReadWriteOp, false, false, false, false, false); // Note that disableRetryTries, multitenancy and mutex time stats are disabled for unit test mongo init - mongoInit(dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, false, false, dbTimeout, writeConcern, dbPoolSize, false); + mongoInit(dbURI, dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, false, false, dbTimeout, writeConcern, dbPoolSize, false); alarmMgr.init(false); logSummaryInit(&lsPeriod); // setupDatabase(); FIXME #3775: pending on mongo unit test re-enabling From c521ca67772a55c03e69ca1f33dd4510a5374057 Mon Sep 17 00:00:00 2001 From: Kengo Nakatsuka Date: Tue, 8 Aug 2023 08:42:35 +0000 Subject: [PATCH 2/8] Fix test --- test/functionalTest/cases/0000_cli/bool_option_with_value.test | 1 + test/functionalTest/cases/0000_cli/command_line_options.test | 1 + .../cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test | 1 + test/functionalTest/cases/3658_env_vars/env_vars.test | 1 + 4 files changed, 4 insertions(+) diff --git a/test/functionalTest/cases/0000_cli/bool_option_with_value.test b/test/functionalTest/cases/0000_cli/bool_option_with_value.test index dbdc0d45b7..157a33b97a 100644 --- a/test/functionalTest/cases/0000_cli/bool_option_with_value.test +++ b/test/functionalTest/cases/0000_cli/bool_option_with_value.test @@ -50,6 +50,7 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] [option '-port' ] [option '-pidpath' ] + [option '-dbURI' ] [option '-dbhost' ] [option '-rplSet' ] [option '-dbuser' ] diff --git a/test/functionalTest/cases/0000_cli/command_line_options.test b/test/functionalTest/cases/0000_cli/command_line_options.test index 8e5b9b1ecb..20a639175b 100644 --- a/test/functionalTest/cases/0000_cli/command_line_options.test +++ b/test/functionalTest/cases/0000_cli/command_line_options.test @@ -39,6 +39,7 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] [option '-port' ] [option '-pidpath' ] + [option '-dbURI' ] [option '-dbhost' ] [option '-rplSet' ] [option '-dbuser' ] diff --git a/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test b/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test index 2ae2c7ad60..cf566803ce 100644 --- a/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test +++ b/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test @@ -40,6 +40,7 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] [option '-port' ] [option '-pidpath' ] + [option '-dbURI' ] [option '-dbhost' ] [option '-rplSet' ] [option '-dbuser' ] diff --git a/test/functionalTest/cases/3658_env_vars/env_vars.test b/test/functionalTest/cases/3658_env_vars/env_vars.test index bd68c35e98..495c359dec 100644 --- a/test/functionalTest/cases/3658_env_vars/env_vars.test +++ b/test/functionalTest/cases/3658_env_vars/env_vars.test @@ -85,6 +85,7 @@ Extended Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] ORION_LOCALIP '0.0.0.0' /'0.0.0.0'/ [option '-port' ] ORION_PORT 1 <= 1026 /1026/ <= 65535 [option '-pidpath' ] ORION_PID_PATH '/tmp/contextBroker.pid' /'/tmp/contextBroker/ + [option '-dbURI' ] ORION_MONGO_URI '' /''/ [option '-dbhost' ] ORION_MONGO_HOST 'localhost' /'localhost'/ [option '-rplSet' ] ORION_MONGO_REPLICA_SET '' /''/ [option '-dbuser' ] ORION_MONGO_USER '' /''/ From 477566c3736507c8afd2009317bd7b9aec67bc61 Mon Sep 17 00:00:00 2001 From: Kengo Nakatsuka Date: Thu, 10 Aug 2023 05:50:15 +0000 Subject: [PATCH 3/8] Validate combination of CLI options --- src/lib/mongoDriver/mongoConnectionPool.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/mongoDriver/mongoConnectionPool.cpp b/src/lib/mongoDriver/mongoConnectionPool.cpp index b1ae052654..6ecfa7d715 100644 --- a/src/lib/mongoDriver/mongoConnectionPool.cpp +++ b/src/lib/mongoDriver/mongoConnectionPool.cpp @@ -334,6 +334,11 @@ static std::string composeMongoUri if (strlen(dbURI) != 0) { + if (strlen(username) != 0 || strlen(authDb) != 0 || strlen(rplSet) != 0 || strlen(mechanism) != 0 || dbSSL || dbDisableRetryWrites || timeout > 0) + { + LM_X(1, ("Invalid Command Line Options: -dbURI cannot be combined with -dbhost, -rplSet, -dbTimeout, -dbuser, -dbAuthMech, -dbAuthDb, -dbSSL and -dbDisableRetryWrites")); + } + const char* pwd = strstr(dbURI, "${PWD}"); if (pwd != NULL) { From d9fd2701511de634009e0d294a8d3093b76ab435 Mon Sep 17 00:00:00 2001 From: Kengo Nakatsuka Date: Thu, 10 Aug 2023 06:23:48 +0000 Subject: [PATCH 4/8] Update cli.md --- doc/manuals.jp/admin/cli.md | 4 ++++ doc/manuals/admin/cli.md | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/doc/manuals.jp/admin/cli.md b/doc/manuals.jp/admin/cli.md index 643bdaa263..1fbcbf468c 100644 --- a/doc/manuals.jp/admin/cli.md +++ b/doc/manuals.jp/admin/cli.md @@ -32,6 +32,9 @@ broker はデフォルトでバックグラウンドで実行されるため、 - **-ipv6** : broker を IPv6 専用モードで実行します。デフォルトでは、broker は IPv4 と IPv6 の両方で動作します。-ipv4 と同時に使用することはできません。 - **-multiservice** : マルチサービス/マルチテナントモードを有効にします。[マルチ・テナンシーのセクション](../orion-api.md#multi-tenancy)を参照してください - **-db ** : 使用する MogoDB データベース、または (`-multiservice` を使用している場合) サービス単位/テナント単位のデータベースのプレフィックス ([マルチ・テナンシー](../orion-api.md#multi-tenancy)のセクションを参照してください) です。このフィールドは最大10文字までです +- **-dbURI ** : 使用する MongoDB を URI で指定します。 + URI に文字列 `${PWD}` がある場合は `-dbpwd` または環境変数 `ORION_MONGO_PASSWORD` で指定したパスワードで置き換えられます。 + このオプションは `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, `-dbAuthMech`, `-dbAuthDb`, `-dbSSL`, `-dbDisableRetryWrites` と組み合わせできません。 - **-dbhost ** : 使用する MongoDB のホストとポートです。たとえば、`-dbhost localhost:12345` です - **-rplSet ** : 指定すれば、Orion CB が MongoDB レプリカセット (スタンドアロン MongoDB インスタンスではなく) に接続されます。使用するレプリカセットの名前は、パラメータの値です。この場合、-dbhost パラメーターは、レプリカ・セットのシードとして使用されるホスト ("," で区切られた) のリストにすることができます - **-dbTimeout ** : レプリカセット (-rplSet) を使用する場合にのみ使用され、それ以外の場合は無視されます。レプリカセットへの接続のタイムアウトをミリ秒単位で指定します @@ -139,6 +142,7 @@ Orion は、環境変数を使用した引数の受け渡しをサポートし | ORION_LOCALIP | localIp | | ORION_PORT | port | | ORION_PID_PATH | pidpath | +| ORION_MONGO_URI | dbURI | | ORION_MONGO_HOST | dbhost | | ORION_MONGO_REPLICA_SET | rplSet | | ORION_MONGO_USER | dbuser | diff --git a/doc/manuals/admin/cli.md b/doc/manuals/admin/cli.md index a133939397..a1cf76c021 100644 --- a/doc/manuals/admin/cli.md +++ b/doc/manuals/admin/cli.md @@ -46,6 +46,11 @@ The list of available options is the following: [service/tenant database separation](../orion-api.md#multi-tenancy). This field is restricted to 10 characters max length. +- **-dbURI ** : The URI to use the MongoDB. + If the URI contains the string `${PWD}`, it will be replaced with the password + specified in `-dbpwd` or the environment variable `ORION_MONGO_PASSWORD`. + This option cannot be combined with -dbhost, -rplSet, -dbTimeout, -dbuser, + -dbAuthMech, -dbAuthDb, -dbSSL and -dbDisableRetryWrites. - **-dbhost **. The MongoDB host and port to use, e.g. `-dbhost localhost:12345`. - **-rplSet **. If used, Orion CB connnects to a @@ -211,6 +216,7 @@ Two facts have to be taken into account: | ORION_LOCALIP | localIp | | ORION_PORT | port | | ORION_PID_PATH | pidpath | +| ORION_MONGO_URI | dbURI | | ORION_MONGO_HOST | dbhost | | ORION_MONGO_REPLICA_SET | rplSet | | ORION_MONGO_USER | dbuser | From b7cdb855bc95f8d065a1cf8b2ef14286adedb41d Mon Sep 17 00:00:00 2001 From: Kengo Nakatsuka Date: Thu, 10 Aug 2023 06:24:31 +0000 Subject: [PATCH 5/8] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 528af55d4c..e2adf5db37 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ - Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated) +- Add: CLI parameter -dbUri / env var ORION_MONGO_URI (#3794) From 6a9bd19f35e76860940ba88c9a0cca437ebb2985 Mon Sep 17 00:00:00 2001 From: ctc-nakatsuka <32257982+ctc-nakatsuka@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:06:49 +0900 Subject: [PATCH 6/8] Update doc/manuals/admin/cli.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fermín Galán Márquez --- doc/manuals/admin/cli.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/manuals/admin/cli.md b/doc/manuals/admin/cli.md index a1cf76c021..0899b45255 100644 --- a/doc/manuals/admin/cli.md +++ b/doc/manuals/admin/cli.md @@ -49,8 +49,9 @@ The list of available options is the following: - **-dbURI ** : The URI to use the MongoDB. If the URI contains the string `${PWD}`, it will be replaced with the password specified in `-dbpwd` or the environment variable `ORION_MONGO_PASSWORD`. - This option cannot be combined with -dbhost, -rplSet, -dbTimeout, -dbuser, - -dbAuthMech, -dbAuthDb, -dbSSL and -dbDisableRetryWrites. + This option cannot be combined with `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, + `-dbAuthMech`, `-dbAuthDb`, `-dbSSL` and `-dbDisableRetryWrites` (if you attempt to do that + Orion will exit with an error on startup). - **-dbhost **. The MongoDB host and port to use, e.g. `-dbhost localhost:12345`. - **-rplSet **. If used, Orion CB connnects to a From 4fbebd331e4bd6e27353b9660c29352d4ffc91a5 Mon Sep 17 00:00:00 2001 From: ctc-nakatsuka <32257982+ctc-nakatsuka@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:06:56 +0900 Subject: [PATCH 7/8] Update src/lib/mongoDriver/mongoConnectionPool.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fermín Galán Márquez --- src/lib/mongoDriver/mongoConnectionPool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/mongoDriver/mongoConnectionPool.cpp b/src/lib/mongoDriver/mongoConnectionPool.cpp index 6ecfa7d715..ed0d1db07c 100644 --- a/src/lib/mongoDriver/mongoConnectionPool.cpp +++ b/src/lib/mongoDriver/mongoConnectionPool.cpp @@ -347,6 +347,7 @@ static std::string composeMongoUri LM_X(1, ("Invalid Command Line Options: -dbURI is used with a password substitution, but no password (-dbpwd) is supplied")); } + // +6 is the length of the "${PWD}" uri = std::string(dbURI, pwd - dbURI) + passwd + (pwd + 6); } else From faddd4217db90e3b44c22f062a5d7546faf7dd7c Mon Sep 17 00:00:00 2001 From: Kengo Nakatsuka Date: Mon, 14 Aug 2023 07:09:52 +0000 Subject: [PATCH 8/8] (JP) Update cli.md --- doc/manuals.jp/admin/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manuals.jp/admin/cli.md b/doc/manuals.jp/admin/cli.md index 1fbcbf468c..076b43d4e3 100644 --- a/doc/manuals.jp/admin/cli.md +++ b/doc/manuals.jp/admin/cli.md @@ -34,7 +34,7 @@ broker はデフォルトでバックグラウンドで実行されるため、 - **-db ** : 使用する MogoDB データベース、または (`-multiservice` を使用している場合) サービス単位/テナント単位のデータベースのプレフィックス ([マルチ・テナンシー](../orion-api.md#multi-tenancy)のセクションを参照してください) です。このフィールドは最大10文字までです - **-dbURI ** : 使用する MongoDB を URI で指定します。 URI に文字列 `${PWD}` がある場合は `-dbpwd` または環境変数 `ORION_MONGO_PASSWORD` で指定したパスワードで置き換えられます。 - このオプションは `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, `-dbAuthMech`, `-dbAuthDb`, `-dbSSL`, `-dbDisableRetryWrites` と組み合わせできません。 + このオプションは `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, `-dbAuthMech`, `-dbAuthDb`, `-dbSSL`, `-dbDisableRetryWrites` と組み合わせできません。(組み合わせた場合、Orion は起動時にエラーで終了します) - **-dbhost ** : 使用する MongoDB のホストとポートです。たとえば、`-dbhost localhost:12345` です - **-rplSet ** : 指定すれば、Orion CB が MongoDB レプリカセット (スタンドアロン MongoDB インスタンスではなく) に接続されます。使用するレプリカセットの名前は、パラメータの値です。この場合、-dbhost パラメーターは、レプリカ・セットのシードとして使用されるホスト ("," で区切られた) のリストにすることができます - **-dbTimeout ** : レプリカセット (-rplSet) を使用する場合にのみ使用され、それ以外の場合は無視されます。レプリカセットへの接続のタイムアウトをミリ秒単位で指定します