From 1d8a75848aa55f2819ca7ebe59512b7da2621fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 7 Feb 2024 14:17:00 +0100 Subject: [PATCH 1/3] FIX deprecated old db CLI --- CHANGES_NEXT_RELEASE | 1 + ci/deb/build.sh | 4 +-- ci/deb/makefile | 2 +- doc/manuals/admin/cli.md | 36 +------------------ doc/manuals/admin/database_admin.md | 25 +++++++------ doc/manuals/admin/diagnosis.md | 2 +- doc/manuals/admin/sanity_check.md | 15 +++----- doc/manuals/admin/watchdog.md | 2 +- doc/manuals/deprecated.md | 28 +++++++++++++++ doc/manuals/devel/cookbook.md | 2 +- docker/README.md | 10 +++--- docker/docker-compose.yml | 2 +- docker/docker_swarm.md | 2 +- docker/raspberry_pi.md | 2 +- etc/init.d/contextBroker.centos | 5 ++- etc/init.d/contextBroker.ubuntu | 2 +- makefile | 4 +-- .../components/common_steps/initial_steps.py | 2 +- test/functionalTest/harnessFunctions.sh | 14 ++++---- 19 files changed, 77 insertions(+), 83 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index fdb575ad63..e628230f8f 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,4 @@ - Fix: changed the default value of `-dbTimeout` to 0 to resolve conflict with `-dbURI` (#4496) - Fix: wrong INFO startup log showing ORION_MONGO_TIMEOUT, ORION_IN_REQ_PAYLOAD_MAX_SIZE and ORION_OUT_REQ_MSG_MAX_SIZE env var values (#4496) - Fix: return 400 Bad Request when subject.entities exists but it is an empty array (#4499) +- Deprecate: `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, `-dbAuthMech`, `-dbAuthDb`, `-dbSSL` and `-dbDisableRetryWrites` CLI parameters along with associated env vars (use `-dbURI` instead`) \ No newline at end of file diff --git a/ci/deb/build.sh b/ci/deb/build.sh index f78d96371a..aea9ed627d 100755 --- a/ci/deb/build.sh +++ b/ci/deb/build.sh @@ -93,8 +93,8 @@ function _execute() sleep 3 - contextBroker -port 30001 -dbhost localhost:20001 -pidpath cb1.pid & - contextBroker -port 30002 -dbhost localhost:20002 -pidpath cb2.pid & + contextBroker -port 30001 -dbURI mongodb://localhost:20001 -pidpath cb1.pid & + contextBroker -port 30002 -dbURI mongodb://localhost:20002 -pidpath cb2.pid & } [ $# = 0 ] && _usage diff --git a/ci/deb/makefile b/ci/deb/makefile index 4cbc001c5d..be524b592f 100644 --- a/ci/deb/makefile +++ b/ci/deb/makefile @@ -69,7 +69,7 @@ install_unit: install unit: @echo '------------------------------------- make unit ----------------------------------------' - BUILD_UNIT/test/unittests/unitTest -t 0-255 -dbhost ${MONGO_HOST} --gtest_output=xml:/tmp/builder/logs/unit.xml + BUILD_UNIT/test/unittests/unitTest -t 0-255 -dbURI mongodb://${MONGO_HOST} --gtest_output=xml:/tmp/builder/logs/unit.xml build_functional: prepare @echo '------------------------------------- make build_functional ----------------------------' diff --git a/doc/manuals/admin/cli.md b/doc/manuals/admin/cli.md index 0899b45255..0159a4e1a8 100644 --- a/doc/manuals/admin/cli.md +++ b/doc/manuals/admin/cli.md @@ -49,36 +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` (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 - MongoDB replica set (instead of a stand-alone MongoDB instance). - The name of the replica set to use is the value of the parameter. In - this case, the -dbhost parameter can be a list of hosts (separated - by ",") which are used as seed for the replica set. -- **-dbTimeout **. Only used in the case of using replica - set (-rplSet), ignored otherwise. It specifies the timeout in - milliseconds for connections to the replica set. -- **-dbuser **. The MongoDB user to use. If your MongoDB doesn't - use authorization then this option must be avoided. See [database - authorization section](database_admin.md#database-authorization). - **-dbpwd **. The MongoDB password to use. If your MongoDB doesn't use authorization then this option must be avoided. See [database - authorization section]( database_admin.md#database-authorization). -- **-dbAuthMech **. The MongoDB authentication mechanism to use in the case - of providing `-dbuser` and `-dbpwd`. Alternatives are SCRAM-SHA-1 or SCRAM-SHA-256. -- **-dbAuthDb **. Specifies the database to use for authentication in the case - of providing `-dbuser` and `-dbpwd`. -- **-dbSSL**. Enable SSL in the connection to MongoDB. You have to use this option if your - MongoDB server or replica set is using SSL (or, the other way around, you have not to use - this option if your MongoDB server or replicat set is not using SSL). Note there is - currently a limitation: Orion uses `tlsAllowInvalidCertificates=true` in this case, - so the certificate used by MongoDB server is not being validated. -- **-dbDisableRetryWrites**. Set retryWrite parameter to false in DB connections (not - recommended, only to keep compatibility with old MongoDB instances) + authorization section](database_admin.md#database-authorization). - **-dbPoolSize **. Database connection pool. Default size of the pool is 10 connections. - **-writeConcern <0|1>**. Write concern for MongoDB write operations: @@ -218,15 +191,8 @@ Two facts have to be taken into account: | ORION_PORT | port | | ORION_PID_PATH | pidpath | | ORION_MONGO_URI | dbURI | -| ORION_MONGO_HOST | dbhost | -| ORION_MONGO_REPLICA_SET | rplSet | -| ORION_MONGO_USER | dbuser | | ORION_MONGO_PASSWORD | dbpwd | -| ORION_MONGO_AUTH_MECH | dbAuthMech | -| ORION_MONGO_AUTH_SOURCE | dbAuthDb | -| ORION_MONGO_SSL | dbSSL | | ORION_MONGO_DB | db | -| ORION_MONGO_TIMEOUT | dbTimeout | | ORION_MONGO_POOL_SIZE | dbPoolSize | | ORION_USEIPV4 | ipv4 | | ORION_USEIPV6 | ipv6 | diff --git a/doc/manuals/admin/database_admin.md b/doc/manuals/admin/database_admin.md index 7f0e868a8c..f521469252 100644 --- a/doc/manuals/admin/database_admin.md +++ b/doc/manuals/admin/database_admin.md @@ -65,41 +65,44 @@ you need to apply the procedures to each per-tenant/service database. ## Database authorization -MongoDB authorization is configured with the `-db`, `-dbuser` and `-dbpwd` -options ([see section on command line -options](cli.md)). There are a few different cases +MongoDB authorization is configured using `-dbURI` and `-dbpwd` +options ([see section on command line options](cli.md)). There are a few different cases to take into account: - If your MongoDB instance/cluster doesn't use authorization, - then do not use the `-dbuser` and `-dbpwd` options. -- You can specify authentication mechanism with `-dbAuthMech`. + then do not use the `-dbpwd` and use `-dbURI` without the `username:${PWD}@` part. +- You can specify authentication mechanism within the `-dbURI`, using the `authMechanism` option. - If your MongoDB instance/cluster uses authorization , then: + - In the `-dbURI` you have to use the `username:${PWD}@` part. The `${PWD}` will be replaced + by the value of the `dbpwd` parameter. - If you run Orion in single service/tenant mode (i.e. without `-multiservice`) then you are using only one database - (the one specified by the -db option) and the authorization is - done with `-dbuser` and `-dbpwd` in that database. + (the one specified by the `-db` option) and the authorization is + done in that database with the username specified in the `-dbURI` and `-dbpwd`. - If you run Orion in multi service/tenant mode (i.e. with `-multiservice`) then the authorization is done at `admin` - database using `-dbuser` and `-dbpwd`. As described [later in this + database using the username specified in the `-dbURI` and `-dbpwd`. As described [later in this document](#multiservicemultitenant-database-separation), in multi service/tenant mode, Orion uses several databases (which in addition can potentially be created on the fly), thus authorizing on `admin` DB ensures permissions in all of them. - - Anyway, you can override the above default with `-dbAuthDb` and + - Anyway, you can override the above default with `defaultauthdb` in the `-dbURI` and specify the authentication DB you want. +Check the [MongoURI documentation](https://www.mongodb.com/docs/manual/reference/connection-string) for additional information. + Let's consider the following example. If your MongoDB configuration is so you typically access to it using: ``` -mongo "mongodb://example1.net:27017,example2.net:27017,example3.net:27017/orion?replicaSet=rs0" --ssl --authenticationDatabase admin --username orion --password orionrules +mongosh mongodb://orion@orionrules:example1.net:27017,example2.net:27017,example3.net:27017/admin?replicaSet=rs0&tls=true&tlsAllowInvalidCertificates=true ``` Then the equivalent connection in Context Broker CLI parameters will be: ``` --dbhost examples1.net:27017,example2.net:27017,example3.net:27017 -rplSet rs0 -dbSSL -dbAuthDb admin -dbuser orion -dbpwd orionrules +-dbURI mongodb://orion@${PWD}:example1.net:27017,example2.net:27017,example3.net:27017/admin?replicaSet=rs0&tls=true&tlsAllowInvalidCertificates=true -dbpwd orionrules ``` diff --git a/doc/manuals/admin/diagnosis.md b/doc/manuals/admin/diagnosis.md index f4a0117b77..b59ce9de36 100644 --- a/doc/manuals/admin/diagnosis.md +++ b/doc/manuals/admin/diagnosis.md @@ -288,7 +288,7 @@ The symptoms of a database connection problem are the following: ``` In both cases, check that the connection to MonogDB is correctly -configured (in particular, the "-dbhost" option [from the command +configured (in particular, the `-dbURI` option [from the command line](cli.md)) and that the mongod/mongos process (depending if you are using sharding or not) is up and running. diff --git a/doc/manuals/admin/sanity_check.md b/doc/manuals/admin/sanity_check.md index b52616cbdf..2657aff67e 100644 --- a/doc/manuals/admin/sanity_check.md +++ b/doc/manuals/admin/sanity_check.md @@ -46,7 +46,7 @@ A process named "contextBroker" should be up and running, e.g.: ``` $ ps ax | grep contextBroker - 8517 ? Ssl 8:58 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbhost localhost -db orion + 8517 ? Ssl 8:58 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbURI mongodb://localhost/ -db orion ``` [Top](#top) @@ -63,25 +63,18 @@ changed using the -port command line option. The Orion Context Broker uses a MongoDB database, whose parameters are provided using the command line options: -* `-dbhost` +* `-dbUri` * `-db` -* `-dbuser` * `-dbpwd` -* `-dbAuthMech` -* `-dbAuthDb` -* `-dbSSL` -* `-dbDisableRetryWrites` -* `-dbTimeout` * `-dbPoolSize` * `-writeConcern` -Note that `-dbuser`, `-dbpwd`, `-dbAuthMech` and `-dbAuthDb`. -are only used if MongoDB runs using authentication, i.e. with `--auth`. +Note that `-dbpwd` is only used if MongoDB runs using authentication, i.e. with `--auth`. You can check that the database is working using the mongo console: ``` -mongo / +mongosh / ``` You can check the different collections used by the broker using the diff --git a/doc/manuals/admin/watchdog.md b/doc/manuals/admin/watchdog.md index 88071dbbe9..27ffd197da 100644 --- a/doc/manuals/admin/watchdog.md +++ b/doc/manuals/admin/watchdog.md @@ -90,7 +90,7 @@ e.g.: # ps -ef | grep contextBroker 500 27175 1 0 21:06 ? 00:00:00 monit -v -c /home/localadmin/monit_CB/monitBROKER.conf -d 10 -p /var/log/contextBroker/monit.pid - 500 27205 1 0 21:06 ? 00:00:00 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbhost localhost -db orion; + 500 27205 1 0 21:06 ? 00:00:00 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbURI mongodb://localhost/ -db orion; Then, kill contextBroker, e.g.: diff --git a/doc/manuals/deprecated.md b/doc/manuals/deprecated.md index 141ab0d6d5..9b289331b4 100644 --- a/doc/manuals/deprecated.md +++ b/doc/manuals/deprecated.md @@ -15,6 +15,9 @@ not maintained or evolved any longer. In particular: A list of deprecated features and the version in which they were deprecated follows: +* CLI parameters (and associated env vars): `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, + `-dbAuthMech`, `-dbAuthDb`, `-dbSSL` and `-dbDisableRetryWrites` in Orion 3.12.0. Use `dbURI` instead, + checking [this section](#mapping-to-mongouri-from-old-cli-parameters) if you need to know hot to build the MongoDB URI. * `geo:point`, `geo:line`, `geo:box` and `geo:polygon` attribute types in Orion 3.10.0. Use `geo:json` instead. * `GET /v2` operation in Orion 3.8.0. This operation is pretty useless and not actually used. * Initial notification in subscriptions (along with `skipInitialNotification` option) in Orion 3.1.0. @@ -77,6 +80,30 @@ A list of deprecated features and the version in which they were deprecated foll * Configuration Manager role (deprecated in 0.21.0, removed in 0.25.0) * Associations (deprecated in 0.21.0, removed in 0.25.0). +### Mapping to MongoURI from old CLI parameters + +Considering we have the following CLI parameters: + +* `-dbhost HOST` +* `-rplSet RPLSET` +* `-dbTimeout TIMEOUT` +* `-dbuser USER` +* `-dbpass PASS` +* `-dbAuthMech AUTHMECH` +* `-dbAuthDb AUTHDB` +* `-dbSSL` +* `-dbDisableRetryWrites` + +The resulting MongoURI (i.e. the value for `-dbURI`) should be: + +> mongodb://[USER:PASS@]HOST/[AUTHDB][?replicaSet=RPLSET[&authMechanism=AUTHMECH][&tls=true&tlsAllowInvalidCertificates=true][&retryWrites=false][&connectTimeoutMS=TIMEOUT] + +Notes: + +* The `&tls=true&tlsAllowInvalidCertificates=true` token is added if `-dbSSL` is used +* The `&retryWrites=false` token is added if `-dbDisableRetryWrites` is used +* Other `[...]` mean optional tokens, depending on if the corresponding parameter is used or not. + ## Log deprecation warnings Some (not all) usages of deprecated features can be logged using the `-logDeprecate` [CLI flag](admin/cli.md) @@ -107,6 +134,7 @@ The following table provides information about the last Orion version supporting | **Removed feature** | **Last Orion version supporting feature** | **That version release date** | |----------------------------------------------------------------------------|-------------------------------------------|---------------------------------| +| CLI `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, `-dbAuthMech`, `-dbAuthDb`, `-dbSSL` and `-dbDisableRetryWrites` (and associated env vars) | Not yet defined | Not yet defined | | `attributes` field in `POST /v2/entities` operation | Not yet defined | Not yet defined | | `APPEND`, `UPDATE`, etc. action types in `POST /v2/op/update` | Not yet defined | Not yet defined | | `dateCreated` and `dateModified` in `options` URI parameter | Not yet defined | Not yet defined | diff --git a/doc/manuals/devel/cookbook.md b/doc/manuals/devel/cookbook.md index 6af4ee7b8f..323adc39ac 100644 --- a/doc/manuals/devel/cookbook.md +++ b/doc/manuals/devel/cookbook.md @@ -20,7 +20,7 @@ You basically need to implement two things: * a **new item** in the `PaArgument` vector `paArgs` If the new CLI parameter is a boolean one, like `-v` (verbose), a `bool` variable is needed, -if it's a text parameter, like `-dbHost `, a char-vector is used, and so on. +if it's a text parameter, like `-dbURI `, a char-vector is used, and so on. The easiest way is to simply copy an older CLI parameter of the same type. diff --git a/docker/README.md b/docker/README.md index e8cc578dce..31f7ccf9a1 100644 --- a/docker/README.md +++ b/docker/README.md @@ -35,7 +35,7 @@ Follow these steps: - "1026:1026" depends_on: - mongo - command: -dbhost mongo + command: -dbURI mongodb://mongo mongo: image: mongo:6.0 @@ -81,7 +81,7 @@ In case you want to run MongoDB on another container you can launch it like this And then run Orion with this command - sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 fiware/orion -dbhost mongodb + sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 fiware/orion -dbURI mongodb://mongodb Check that everything works with @@ -93,7 +93,7 @@ This method is functionally equivalent as the one described in section 1, but do If you want to connect to a different MongoDB instance do the following command **instead of** the previous one - sudo docker run -d --name orion1 -p 1026:1026 fiware/orion -dbhost + sudo docker run -d --name orion1 -p 1026:1026 fiware/orion -dbURI mongodb:// Check that everything works with @@ -113,10 +113,10 @@ Steps: * Manually, running MongoDB on another container: 1. `sudo docker run --name mongodb -d mongo:6.0` 2. `sudo docker build -t orion .` - 3. `sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 orion -dbhost mongodb`. + 3. `sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 orion -dbURI mongodb://mongodb`. * Manually, specifying where to find your MongoDB host: 1. `sudo docker build -t orion .` - 2. `sudo docker run -d --name orion1 -p 1026:1026 orion -dbhost `. + 2. `sudo docker run -d --name orion1 -p 1026:1026 orion -dbURI mongodb://`. Check that everything works with diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 4587af3990..81b78922e7 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,7 +7,7 @@ services: - "1026:1026" depends_on: - mongo - command: -dbhost mongo + command: -dbURI mongodb://mongo mongo: image: mongo:6.0 diff --git a/docker/docker_swarm.md b/docker/docker_swarm.md index ef30a5b5a4..d6f23ee16c 100644 --- a/docker/docker_swarm.md +++ b/docker/docker_swarm.md @@ -185,7 +185,7 @@ Details on how to deploy a MongoDB ReplicaSet in Docker Swarm are available image: fiware/orion:latest ports: - "1026:1026" - command: -logLevel DEBUG -dbhost mongo_mongo -rplSet rs -dbTimeout 10000 + command: -logLevel DEBUG -dbURI mongodb://mongo_mongo/?replicaSet=rs&connectTimeoutMS=10000 deploy: replicas: 2 networks: diff --git a/docker/raspberry_pi.md b/docker/raspberry_pi.md index bbc3615ac6..cb7baecd07 100644 --- a/docker/raspberry_pi.md +++ b/docker/raspberry_pi.md @@ -46,7 +46,7 @@ services: - "1026:1026" depends_on: - mongo - command: -dbhost mongo + command: -dbURI mongodb://mongo mongo: image: mongo:6.0 diff --git a/etc/init.d/contextBroker.centos b/etc/init.d/contextBroker.centos index e507ef4046..cf9d2df29f 100644 --- a/etc/init.d/contextBroker.centos +++ b/etc/init.d/contextBroker.centos @@ -79,19 +79,22 @@ BROKER_OPTS="-port ${BROKER_PORT} \ -logDir ${BROKER_LOG_DIR} \ -logLevel ${BROKER_LOG_LEVEL} \ -pidpath ${BROKER_PID_FILE} \ - -dbhost ${BROKER_DATABASE_HOST} \ + -dbURI mongodb://${BROKER_DATABASE_HOST} \ -db ${BROKER_DATABASE_NAME} \ ${BROKER_EXTRA_OPS}" # Optional parameters +# FIXME: -dbuser option is deprecated. This needs to be migrated to -dbURI usage if [[ ! -z "${BROKER_DATABASE_USER}" ]]; then BROKER_OPTS="${BROKER_OPTS} -dbuser ${BROKER_DATABASE_USER}" fi +# FIXME: -dbpwd needs ${PWD} in the -dbURI CLI. This needs to be adapted if [[ ! -z "${BROKER_DATABASE_PASSWORD}" ]]; then BROKER_OPTS="${BROKER_OPTS} -dbpwd ${BROKER_DATABASE_PASSWORD}" fi +# FIXME: -rplsSet option is deprecated. This needs to be migrated to -dbURI usage if [[ ! -z "${BROKER_DATABASE_RPLSET}" ]]; then BROKER_OPTS="${BROKER_OPTS} -rplSet ${BROKER_DATABASE_RPLSET}" fi diff --git a/etc/init.d/contextBroker.ubuntu b/etc/init.d/contextBroker.ubuntu index d3cd38e1e2..d86fab69ef 100755 --- a/etc/init.d/contextBroker.ubuntu +++ b/etc/init.d/contextBroker.ubuntu @@ -58,7 +58,7 @@ SCRIPTNAME=/etc/init.d/$NAME DAEMON_ARGS="-port ${BROKER_PORT} \ -logDir ${BROKER_LOG_DIR} \ -pidpath ${BROKER_PID_FILE} \ - -dbhost ${BROKER_DATABASE_HOST} \ + -dbURI mongodb://${BROKER_DATABASE_HOST} \ -db ${BROKER_DATABASE_NAME} \ ${BROKER_EXTRA_OPS}" diff --git a/makefile b/makefile index 594f21f2d3..8e940023ae 100644 --- a/makefile +++ b/makefile @@ -216,9 +216,9 @@ build_unit_test: prepare_unit_test unit_test: build_unit_test @echo '------------------------------- unit_test starts ---------------------------------' if [ -z "${TEST_FILTER}" ]; then \ - BUILD_UNITTEST/test/unittests/unitTest -t 0-255 -dbhost ${MONGO_HOST} --gtest_output=xml:BUILD_UNITTEST/unit_test.xml; \ + BUILD_UNITTEST/test/unittests/unitTest -t 0-255 -dbURI mongodb://${MONGO_HOST} --gtest_output=xml:BUILD_UNITTEST/unit_test.xml; \ else \ - BUILD_UNITTEST/test/unittests/unitTest -t 0-255 -dbhost ${MONGO_HOST} --gtest_output=xml:BUILD_UNITTEST/unit_test.xml --gtest_filter=${TEST_FILTER}; \ + BUILD_UNITTEST/test/unittests/unitTest -t 0-255 -dbURI mongodb://${MONGO_HOST} --gtest_output=xml:BUILD_UNITTEST/unit_test.xml --gtest_filter=${TEST_FILTER}; \ fi @echo '------------------------------- unit_test ended ---------------------------------' diff --git a/test/acceptance/behave/components/common_steps/initial_steps.py b/test/acceptance/behave/components/common_steps/initial_steps.py index e033cf6d98..f662dd17e3 100644 --- a/test/acceptance/behave/components/common_steps/initial_steps.py +++ b/test/acceptance/behave/components/common_steps/initial_steps.py @@ -82,7 +82,7 @@ def start_context_broker(context): __logger__.debug("Starting contextBroker per command line interface...") props_cb["CB_EXTRA_OPS"] = props_cb["CB_EXTRA_OPS"].replace('"', "") # hint: the -harakiri option is used to kill contextBroker (must be compiled in DEBUG mode) - command = "contextBroker -port %s -logDir %s -pidpath %s -dbhost %s -db %s %s -harakiri" %\ + command = "contextBroker -port %s -logDir %s -pidpath %s -dbURI mondodb://%s -db %s %s -harakiri" %\ (props_cb["CB_PORT"], props_cb["CB_LOG_FILE"], props_cb["CB_PID_FILE"], props_mongo["MONGO_HOST"], props_mongo["MONGO_DATABASE"], props_cb["CB_EXTRA_OPS"]) __logger__.debug("command: %s" % command) diff --git a/test/functionalTest/harnessFunctions.sh b/test/functionalTest/harnessFunctions.sh index d1de8a684d..6a9886df9f 100644 --- a/test/functionalTest/harnessFunctions.sh +++ b/test/functionalTest/harnessFunctions.sh @@ -377,38 +377,38 @@ function localBrokerStart() if [ "$role" == "CB" ] then port=$CB_PORT - CB_START_CMD="$CB_START_CMD_PREFIX -port $CB_PORT -pidpath $CB_PID_FILE -dbhost $dbHost:$dbPort -db $CB_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption $extraParams" + CB_START_CMD="$CB_START_CMD_PREFIX -port $CB_PORT -pidpath $CB_PID_FILE -dbURI mongodb://$dbHost:$dbPort -db $CB_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption $extraParams" elif [ "$role" == "CBHA" ] then # CB-HA broker uses same database than main CB mkdir -p $CBHA_LOG_DIR port=$CBHA_PORT - CB_START_CMD="$CB_START_CMD_PREFIX -port $CBHA_PORT -pidpath $CBHA_PID_FILE -dbhost $dbHost:$dbPort -db $CB_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CBHA_LOG_DIR $extraParams" + CB_START_CMD="$CB_START_CMD_PREFIX -port $CBHA_PORT -pidpath $CBHA_PID_FILE -dbURI mongodb://$dbHost:$dbPort -db $CB_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CBHA_LOG_DIR $extraParams" elif [ "$role" == "CP1" ] then mkdir -p $CP1_LOG_DIR port=$CP1_PORT - CB_START_CMD="$CB_START_CMD_PREFIX -port $CP1_PORT -pidpath $CP1_PID_FILE -dbhost $dbHost:$dbPort -db $CP1_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP1_LOG_DIR $extraParams" + CB_START_CMD="$CB_START_CMD_PREFIX -port $CP1_PORT -pidpath $CP1_PID_FILE -dbURI mongodb://$dbHost:$dbPort -db $CP1_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP1_LOG_DIR $extraParams" elif [ "$role" == "CP2" ] then mkdir -p $CP2_LOG_DIR port=$CP2_PORT - CB_START_CMD="$CB_START_CMD_PREFIX -port $CP2_PORT -pidpath $CP2_PID_FILE -dbhost $dbHost:$dbPort -db $CP2_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP2_LOG_DIR $extraParams" + CB_START_CMD="$CB_START_CMD_PREFIX -port $CP2_PORT -pidpath $CP2_PID_FILE -dbURI mongodb://$dbHost:$dbPort -db $CP2_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP2_LOG_DIR $extraParams" elif [ "$role" == "CP3" ] then mkdir -p $CP3_LOG_DIR port=$CP3_PORT - CB_START_CMD="$CB_START_CMD_PREFIX -port $CP3_PORT -pidpath $CP3_PID_FILE -dbhost $dbHost:$dbPort -db $CP3_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP3_LOG_DIR $extraParams" + CB_START_CMD="$CB_START_CMD_PREFIX -port $CP3_PORT -pidpath $CP3_PID_FILE -dbURI mongodb://$dbHost:$dbPort -db $CP3_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP3_LOG_DIR $extraParams" elif [ "$role" == "CP4" ] then mkdir -p $CP4_LOG_DIR port=$CP4_PORT - CB_START_CMD="$CB_START_CMD_PREFIX -port $CP4_PORT -pidpath $CP4_PID_FILE -dbhost $dbHost:$dbPort -db $CP4_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP4_LOG_DIR $extraParams" + CB_START_CMD="$CB_START_CMD_PREFIX -port $CP4_PORT -pidpath $CP4_PID_FILE -dbURI mongodb://$dbHost:$dbPort -db $CP4_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP4_LOG_DIR $extraParams" elif [ "$role" == "CP5" ] then mkdir -p $CP5_LOG_DIR port=$CP5_PORT - CB_START_CMD="$CB_START_CMD_PREFIX -port $CP5_PORT -pidpath $CP5_PID_FILE -dbhost $dbHost:$dbPort -db $CP5_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP5_LOG_DIR $extraParams" + CB_START_CMD="$CB_START_CMD_PREFIX -port $CP5_PORT -pidpath $CP5_PID_FILE -dbURI mongodb://$dbHost:$dbPort -db $CP5_DB_NAME -dbPoolSize $POOL_SIZE -t $traceLevels $IPvOption -logDir $CP5_LOG_DIR $extraParams" fi From 2c15d46feba4f1a1b6131458a50a458d02b90b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 7 Feb 2024 14:33:27 +0100 Subject: [PATCH 2/3] FIX broken utest --- test/unittests/main_UnitTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittests/main_UnitTest.cpp b/test/unittests/main_UnitTest.cpp index 7d7b9bc991..3b7718b0c1 100644 --- a/test/unittests/main_UnitTest.cpp +++ b/test/unittests/main_UnitTest.cpp @@ -117,7 +117,7 @@ PaArgument paArgs[] = { "-dbAuthDb", authDb, "DB_AUTH_DB", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, { "-dbSSL", &dbSSL, "DB_AUTH_SSL", PaBool, PaOpt, false, false, true, "" }, { "-db", dbName, "DB", PaString, PaOpt, (int64_t) "orion", PaNL, PaNL, "" }, - { "-dbTimeout", &dbTimeout, "DB_TIMEOUT", PaInt64, PaOpt, 10000, PaNL, PaNL, "" }, + { "-dbTimeout", &dbTimeout, "DB_TIMEOUT", PaInt64, PaOpt, 0, PaNL, PaNL, "" }, { "-dbPoolSize", &dbPoolSize, "DB_POOL_SIZE", PaInt, PaOpt, 10, 1, 10000, "" }, { "-writeConcern", &writeConcern, "WRITE_CONCERN", PaInt, PaOpt, 1, 0, 1, "" }, { "--gtest_filter=", gtest_filter, "", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, From 574be0475e5c7ccadee21fafee9432915cec1e5e Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Fri, 23 Feb 2024 22:56:32 +0900 Subject: [PATCH 3/3] (JP) FIX deprecated old db CLI (#4505) --- doc/manuals.jp/admin/cli.md | 23 ---------------------- doc/manuals.jp/admin/database_admin.md | 17 ++++++++-------- doc/manuals.jp/admin/diagnosis.md | 2 +- doc/manuals.jp/admin/sanity_check.md | 13 ++++--------- doc/manuals.jp/admin/watchdog.md | 2 +- doc/manuals.jp/deprecated.md | 27 ++++++++++++++++++++++++++ doc/manuals.jp/devel/cookbook.md | 2 +- docker/README.jp.md | 10 +++++----- docker/docker_swarm.jp.md | 2 +- docker/raspberry_pi.jp.md | 2 +- 10 files changed, 50 insertions(+), 50 deletions(-) diff --git a/doc/manuals.jp/admin/cli.md b/doc/manuals.jp/admin/cli.md index 076b43d4e3..bdc50ba14a 100644 --- a/doc/manuals.jp/admin/cli.md +++ b/doc/manuals.jp/admin/cli.md @@ -34,23 +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` と組み合わせできません。(組み合わせた場合、Orion は起動時にエラーで終了します) -- **-dbhost ** : 使用する MongoDB のホストとポートです。たとえば、`-dbhost localhost:12345` です -- **-rplSet ** : 指定すれば、Orion CB が MongoDB レプリカセット (スタンドアロン MongoDB インスタンスではなく) に接続されます。使用するレプリカセットの名前は、パラメータの値です。この場合、-dbhost パラメーターは、レプリカ・セットのシードとして使用されるホスト ("," で区切られた) のリストにすることができます -- **-dbTimeout ** : レプリカセット (-rplSet) を使用する場合にのみ使用され、それ以外の場合は無視されます。レプリカセットへの接続のタイムアウトをミリ秒単位で指定します -- **-dbuser ** : 使用する MongoDB ユーザ。MongoDB が認証を使用しない場合、このオプションは避けなければなりません。[データベース認証セクション](database_admin.md#database-authorization)を参照してください - **-dbpwd ** : 使用する MongoDB パスワード。MongoDB が認証を使用しない場合、このオプションは避けなければなりません。[データベース認証セクション](database_admin.md#database-authorization)を参照してください -- **-dbAuthMech **. `-dbuser` と `-dbpwd` を提供する場合に使用する MongoDB - 認証メカニズム。代替手段はSCRAM-SHA-1 または SCRAM-SHA-256 です。 -- **-dbAuthDb ** : `-dbuser` と `-dbpwd` を提供する場合に認証に使用するデータベース - を指定します。 -- **-dbSSL** : MongoDB への接続で SSL を有効にします。MongoDB サーバまたはレプリカ・セットが - SSL を使用している場合は、このオプションを使用する必要があります (または、逆に、MongoDB - サーバまたはレプリカ・セットが SSL を使用していない場合は、このオプションを使用する必要は - ありません)。現在、制限があることに注意してください。この場合、Orion は `tlsAllowInvalidCertificates=true` - を使用するため、MongoDB サーバで使用される証明書は検証されません。 -- **-dbDisableRetryWrites** : DB 接続で retryWrite パラメータを false に設定します - (古い MongoDB インスタンスとの互換性を維持するためにのみで、通常は推奨されません) - **-dbPoolSize ** : データベース・コネクション・プール プールのデフォルトサイズは10接続です - **-writeConcern <0|1>** : MongoDB の書き込み操作に対する確認を指定 : 確認 (1) または未確認 (0)。デフォルトは 1です - **-https** : セキュアな HTTP モードで作業します (`-cert` および `-key` を参照) @@ -143,15 +127,8 @@ Orion は、環境変数を使用した引数の受け渡しをサポートし | ORION_PORT | port | | ORION_PID_PATH | pidpath | | ORION_MONGO_URI | dbURI | -| ORION_MONGO_HOST | dbhost | -| ORION_MONGO_REPLICA_SET | rplSet | -| ORION_MONGO_USER | dbuser | | ORION_MONGO_PASSWORD | dbpwd | -| ORION_MONGO_AUTH_MECH | dbAuthMech | -| ORION_MONGO_AUTH_SOURCE | dbAuthDb | -| ORION_MONGO_SSL | dbSSL | | ORION_MONGO_DB | db | -| ORION_MONGO_TIMEOUT | dbTimeout | | ORION_MONGO_POOL_SIZE | dbPoolSize | | ORION_USEIPV4 | ipv4 | | ORION_USEIPV6 | ipv6 | diff --git a/doc/manuals.jp/admin/database_admin.md b/doc/manuals.jp/admin/database_admin.md index c3c6b28da3..eb0138dc87 100644 --- a/doc/manuals.jp/admin/database_admin.md +++ b/doc/manuals.jp/admin/database_admin.md @@ -54,27 +54,28 @@ mongorestore --host --db dump/ ## データベースの認証 -MongoDB の認証は `-db, `-dbuser` と `-dbpwd` オプションで設定されます ([コマンドライン・オプションのセクション](cli.md)を参照)。考慮するいくつかの異なるケースがあります : +MongoDB の認証は `-dbURI` および `-dbpwd` オプションを使用して設定されます ([コマンドライン・オプションのセクションを参照](cli.md))。考慮すべきいくつかの異なるケースがあります: -- MongoDB インスタンス/クラスタが認証を使用していない場合は、`-dbuser` と `-dbpwd` オプションは使用しないでください -- `-dbAuthMech` で認証メカニズムを指定できます +- MongoDB インスタンス/クラスタが認証を使用していない場合は、`-dbpwd` を使用せず、`username:${PWD}@` のパートを省略した `-dbURI` を使用してください +- `authMechanism` オプションを使用して、`-dbURI` 内で認証メカニズムを指定できます - MongoDB インスタンス/クラスタが認可を使用している場合は、次のようになります : - - Orion をシングルサービス/テナントモードで実行している場合 (つまり `-multiservice` でない場合)、1つのデータベース (-db オプションで指定されたもの) のみを使用しているので、認証は、そのデータベースで `-dbuser` と `-dbpwd` を使用して行われます - - Orion をマルチサービス/テナントモードで実行している場合 (つまり `-multiservice` の場合)、認証は、`admin` データベースで `-dbuser` と `-dbpwd` を使用して行われます。[このドキュメントの後半](#multiservicemultitenant-database-separation)で説明するように、マルチサービス/テナントモードでは、Orion はいくつかのデータベース (潜在的にオンザフライで作成される可能性があります) を使用します。`admin` データベース上での認証は、それらの全てで許可します - - とにかく、上記のデフォルトを `-dbAuthDb` でオーバーライドして、 + - `-dbURI` では、`username:${PWD}@` のパートを使用する必要があります。`${PWD}` は `dbpwd` パラメータの値に置き換えられます + - Orion をシングルサービス/テナントモードで実行している場合 (つまり `-multiservice` でない場合)、1つのデータベース (`-db` オプションで指定されたもの) であり、認証は、`-dbURI` および `-dbpwd` で指定されたユーザ名を使用してそのデータベース内で行われます + - Orion をマルチサービス/テナントモードで実行している場合 (つまり `-multiservice` の場合)、認証は、`admin` データベースで `-dbURI` で指定されたユーザー名と `-dbpwd` を使用して行われます。[このドキュメントの後半](#multiservicemultitenant-database-separation)で説明するように、マルチサービス/テナントモードでは、Orion はいくつかのデータベース (潜在的にオンザフライで作成される可能性があります) を使用します。`admin` データベース上での認証は、それらの全てで許可します + - とにかく、上記のデフォルトを `-dbURI` の `defaultauthdb` でオーバーライドして、 必要な認証 DB を指定できます 次の例を考えてみましょう。 MongoDB の構成がそうである場合、通常は以下を使用してアクセスします : ``` -mongo "mongodb://example1.net:27017,example2.net:27017,example3.net:27017/orion?replicaSet=rs0" --ssl --authenticationDatabase admin --username orion --password orionrules +mongosh mongodb://orion@orionrules:example1.net:27017,example2.net:27017,example3.net:27017/admin?replicaSet=rs0&tls=true&tlsAllowInvalidCertificates=true ``` Context Broker CLI パラメーターの同等の接続は次のようになります : ``` --dbhost examples1.net:27017,example2.net:27017,example3.net:27017 -rplSet rs0 -dbSSL -dbAuthDb admin -dbuser orion -dbpwd orionrules +-dbURI mongodb://orion@${PWD}:example1.net:27017,example2.net:27017,example3.net:27017/admin?replicaSet=rs0&tls=true&tlsAllowInvalidCertificates=true -dbpwd orionrules ``` diff --git a/doc/manuals.jp/admin/diagnosis.md b/doc/manuals.jp/admin/diagnosis.md index 03e082444b..b52e185dcb 100644 --- a/doc/manuals.jp/admin/diagnosis.md +++ b/doc/manuals.jp/admin/diagnosis.md @@ -220,7 +220,7 @@ Orion Context Broker は、次のフローを使用します : } ``` -どちらの場合も、MonogDB への接続が正しく構成されていることを確認してください。特に、[コマンドラインから実行する](cli.md)場合は "-dbhost" オプションです。また、シャーディングを使用しているかどうかによって異なりますが、mongod/mongos プロセスが起動していることです。 +どちらの場合も、MonogDB への接続が正しく構成されていることを確認してください。特に、[コマンドラインから実行する](cli.md)場合は `-dbURI` オプションです。また、シャーディングを使用しているかどうかによって異なりますが、mongod/mongos プロセスが起動していることです。 MongoDB が停止していることが問題の場合は、Orion Context Broker は、準備ができたらデータベースに再接続できることに注意してください。つまり、データベースに再接続するために broker を再起動する必要はありません。 diff --git a/doc/manuals.jp/admin/sanity_check.md b/doc/manuals.jp/admin/sanity_check.md index d1288f93cd..bf89c90187 100644 --- a/doc/manuals.jp/admin/sanity_check.md +++ b/doc/manuals.jp/admin/sanity_check.md @@ -45,7 +45,7 @@ curl --header 'Accept: application/json' localhost:1026/version ``` $ ps ax | grep contextBroker - 8517 ? Ssl 8:58 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbhost localhost -db orion + 8517 ? Ssl 8:58 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbURI mongodb://localhost/ -db orion ``` [トップ](#top) @@ -63,25 +63,20 @@ Orion Context Broker は、デフォルト・ポートとして TCP 1026を使 Orion Context Broker は MongoDB データベースを使用します。このパラメーターは、 コマンドライン・オプションを使用して提供されます : -* `-dbhost` +* `-dbUri` * `-db` -* `-dbuser` * `-dbpwd` -* `-dbAuthMech` -* `-dbAuthDb` -* `-dbSSL` -* `-dbDisableRetryWrites` -* `-dbTimeout` * `-dbPoolSize` * `-writeConcern` `-dbuser`, `-dbpwd`, `-dbAuthMech` および `-dbAuthDb` は、MongoDB が認証を使用 して、つまり `--auth` で実行される場合にのみ使用されることを注意して ください。 +`-dbpwd` は、MongoDB が認証を使用して実行される場合、つまり `--auth` を使用して実行される場合にのみ使用されることに注意してください。 mongo コンソールを使用してデータベースが動作していることを確認できます : ``` -mongo / +mongosh / ``` mongo コンソールの次のコマンドを使用して、broker が使用するさまざまなコレクションをチェックすることができます。ただし、最初にドキュメントを挿入するときに broker がコレクションを作成するので、broker を初めて実行する、またはデータベースがクリーンアップされている、broker がまだリクエストを受信していない場合、コレクションは存在しません。特定の瞬間に実際のコレクションリストを取得するために `show collections` を使用します。 diff --git a/doc/manuals.jp/admin/watchdog.md b/doc/manuals.jp/admin/watchdog.md index c3d6bc7afa..1546d3a861 100644 --- a/doc/manuals.jp/admin/watchdog.md +++ b/doc/manuals.jp/admin/watchdog.md @@ -72,7 +72,7 @@ monit が正常に動作していることを確認するには、プロセス # ps -ef | grep contextBroker 500 27175 1 0 21:06 ? 00:00:00 monit -v -c /home/localadmin/monit_CB/monitBROKER.conf -d 10 -p /var/log/contextBroker/monit.pid - 500 27205 1 0 21:06 ? 00:00:00 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbhost localhost -db orion; + 500 27205 1 0 21:06 ? 00:00:00 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbURI mongodb://localhost/ -db orion; そして、contextBroker を kill します。例 : diff --git a/doc/manuals.jp/deprecated.md b/doc/manuals.jp/deprecated.md index 3b81eacd34..a515871299 100644 --- a/doc/manuals.jp/deprecated.md +++ b/doc/manuals.jp/deprecated.md @@ -8,6 +8,7 @@ 推奨されなくなった機能のリストと、廃止された機能のバージョンは次のとおりです : +* Orion 3.12.0 での CLI パラメータ (および関連する環境変数): `-dbhost`、`-rplSet`、`-dbTimeout`、`-dbuser`、`-dbAuthMech`、`-dbAuthDb`、`-dbSSL`、および `-dbDisableRetryWrites`。MongoDB URI を構築するために必要な情報が必要な場合は、[このセクション](#mapping-to-mongouri-from-old-cli-parameters) をチェックして、代わりに `dbURI` を使用してください * Orion 3.10.0 での `geo:point`, `geo:line`, `geo:box` および `geo:polygon` 属性タイプ。代わりに `geo:json` を使用してください * Orion 3.8.0 での `GET /v2` 操作。この操作はかなり役に立たず、実際には使用されません。 * Orion 3.1.0 のサブスクリプションでの初期通知 (`skipInitialNotification` オプションと共に)。(Orion 3.2.0 で削除)。初期通知の @@ -52,6 +53,31 @@ * Configuration Manager のロールは、0.21.0 で非推奨になり、0.25.0 で削除されました * Associations は、0.21.0 で非推奨になり、0.25.0 で削除されました + + +### 古い CLI パラメータから MongoURI へのマッピング + +次の CLI パラメータがあることを考慮します: + +* `-dbhost HOST` +* `-rplSet RPLSET` +* `-dbTimeout TIMEOUT` +* `-dbuser USER` +* `-dbpass PASS` +* `-dbAuthMech AUTHMECH` +* `-dbAuthDb AUTHDB` +* `-dbSSL` +* `-dbDisableRetryWrites` + +結果の MongoURI (つまり、`-dbURI` の値) は次のようになります: + +> mongodb://[USER:PASS@]HOST/[AUTHDB][?replicaSet=RPLSET[&authMechanism=AUTHMECH][&tls=true&tlsAllowInvalidCertificates=true][&retryWrites=false][&connectTimeoutMS=TIMEOUT] +Notes: + +* `-dbSSL` が使用される場合、`&tls=true&tlsAllowInvalidCertificates=true` トークンが追加されます +* `-dbDisableRetryWrites` が使用される場合、`&retryWrites=false` トークンが追加されます +* その他の `[...]` は、対応するパラメータが使用されているかどうかに応じて、オプションのトークンを意味します + ## 非推奨の警告をログに記録 @@ -77,6 +103,7 @@ | **削除された機能** | **機能をサポートする Orion ラスト・バージョン** | **バージョンのリリース日** | |--------------------------------------------------------------------------------------|-------------------------------------------------|----------------------------| +| CLI `-dbhost`、`-rplSet`、`-dbTimeout`、`-dbuser`、`-dbAuthMech`、`-dbAuthDb`、`-dbSSL`、および `-dbDisableRetryWrites` (および関連する環境変数) | まだ定義されていません | まだ定義されていません | | `POST /v2/entities` オペレーションの `attributes` フィールド | まだ定義されていません | まだ定義されていません | | `APPEND`, `UPDATE`, など。`POST /v2/op/update` でのアクション・タイプ | まだ定義されていません | まだ定義されていません | | URI パラメータでの `dateCreated` および `dateModified` | まだ定義されていません | まだ定義されていません | diff --git a/doc/manuals.jp/devel/cookbook.md b/doc/manuals.jp/devel/cookbook.md index f25aa69f26..633a7e25eb 100644 --- a/doc/manuals.jp/devel/cookbook.md +++ b/doc/manuals.jp/devel/cookbook.md @@ -20,7 +20,7 @@ Orion に新しい CLI パラメータを追加するのは簡単です。これ * 新しい CLI パラメーターの値を保持する**変数**、および * `PaArgument` ベクトルの**新しい項目** `paArgs` -新しいCLIパラメーターが `-v` (verbose) のようなブール値の場合、`bool` 変数が必要です。`-dbHost ` のようなテキスト・パラメータの場合は、char-vector が使用されるなどです。 +新しいCLIパラメーターが `-v` (verbose) のようなブール値の場合、`bool` 変数が必要です。`-dbURI ` のようなテキスト・パラメータの場合は、char-vector が使用されるなどです。 最も簡単な方法は、同じタイプの古い CLI パラメータを単純にコピーすることです。 diff --git a/docker/README.jp.md b/docker/README.jp.md index c36ae73140..e1080f2888 100644 --- a/docker/README.jp.md +++ b/docker/README.jp.md @@ -33,7 +33,7 @@ Orion Context Broker を試してみたいし、データベースについて - "1026:1026" depends_on: - mongo - command: -dbhost mongo + command: -dbURI mongodb://mongo mongo: image: mongo:6.0 @@ -79,7 +79,7 @@ Orion Context Broker を試してみたいし、データベースについて そして、このコマンドで Orion を実行します - sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 fiware/orion -dbhost mongodb + sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 fiware/orion -dbURI mongodb://mongodb すべてが動作することを確認します。 @@ -91,7 +91,7 @@ Orion Context Broker を試してみたいし、データベースについて 別の MongoDB インスタンスに接続する場合は、前のコマンドの**代わりに**、次のコマンドを実行します - sudo docker run -d --name orion1 -p 1026:1026 fiware/orion -dbhost + sudo docker run -d --name orion1 -p 1026:1026 fiware/orion -dbURI mongodb:// すべてが動作することを確認します。 @@ -111,10 +111,10 @@ Orion Context Broker を試してみたいし、データベースについて * 手動で MongoDB を別のコンテナで実行します : 1. `sudo docker run --name mongodb -d mongo:6.0` 2. `sudo docker build -t orion .` - 3. `sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 orion -dbhost mongodb`. + 3. `sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 orion -dbURI mongodb://mongodb`. * 手動で MongoDB ホストを見つける場所を指定します : 1. `sudo docker build -t orion .` - 2. `sudo docker run -d --name orion1 -p 1026:1026 orion -dbhost `. + 2. `sudo docker run -d --name orion1 -p 1026:1026 orion -dbURI mongodb://`. すべてが動作することを確認します diff --git a/docker/docker_swarm.jp.md b/docker/docker_swarm.jp.md index 6b35f7920d..494fc4ac3d 100644 --- a/docker/docker_swarm.jp.md +++ b/docker/docker_swarm.jp.md @@ -172,7 +172,7 @@ MongoDB ReplicaSet を Docker Swarm にデプロイする方法の詳細につ image: fiware/orion:latest ports: - "1026:1026" - command: -logLevel DEBUG -dbhost mongo_mongo -rplSet rs -dbTimeout 10000 + command: -logLevel DEBUG -dbURI mongodb://mongo_mongo/?replicaSet=rs&connectTimeoutMS=10000 deploy: replicas: 2 networks: diff --git a/docker/raspberry_pi.jp.md b/docker/raspberry_pi.jp.md index 6a2e961cc7..03ee1ec375 100644 --- a/docker/raspberry_pi.jp.md +++ b/docker/raspberry_pi.jp.md @@ -47,7 +47,7 @@ services: - "1026:1026" depends_on: - mongo - command: -dbhost mongo + command: -dbURI mongodb://mongo mongo: image: mongo:6.0