From d73bd7428a4b7b01234e67c9d7bb8d0f8e3093a0 Mon Sep 17 00:00:00 2001 From: Jozef Kralik Date: Fri, 15 Dec 2023 14:12:08 +0000 Subject: [PATCH] add cqldb configuration --- .../configuration/certificate-authority.md | 58 +++++++++++++++++-- .../en/docs/configuration/identity-store.md | 44 ++++++++++++-- .../docs/configuration/resource-aggregate.md | 6 +- 3 files changed, 94 insertions(+), 14 deletions(-) diff --git a/content/en/docs/configuration/certificate-authority.md b/content/en/docs/configuration/certificate-authority.md index c760a71c..5c6b6cc2 100644 --- a/content/en/docs/configuration/certificate-authority.md +++ b/content/en/docs/configuration/certificate-authority.md @@ -69,11 +69,11 @@ gRPC API of the Certificate Authority service as defined [here](https://github.c | Property | Type | Description | Default | | ---------- | -------- | -------------- | ------- | - | apis.http.address | string | Listen specification : for http client connection. | `"0.0.0.0:9101"` | - | apis.http.readTimeout | string | The maximum duration for reading the entire request, including the body by the server. A zero or negative value means there will be no timeout. | `8s` | - | apis.http.readHeaderTimeout | string | The amount of time allowed to read request headers by the server. If readHeaderTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout. | `4s` | - | apis.http.writeTimeout | string | The maximum duration before the server times out writing of the response. A zero or negative value means there will be no timeout. | `16s` | - | apis.http.idleTimeout | string | The maximum amount of time the server waits for the next request when keep-alives are enabled. If idleTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout. | `30s` | + | `apis.http.address` | string | Listen specification : for http client connection. | `"0.0.0.0:9101"` | + | `apis.http.readTimeout` | string | The maximum duration for reading the entire request, including the body by the server. A zero or negative value means there will be no timeout. | `8s` | + | `apis.http.readHeaderTimeout` | string | The amount of time allowed to read request headers by the server. If readHeaderTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout. | `4s` | + | `apis.http.writeTimeout` | string | The maximum duration before the server times out writing of the response. A zero or negative value means there will be no timeout. | `16s` | + | `apis.http.idleTimeout` | string | The maximum amount of time the server waits for the next request when keep-alives are enabled. If idleTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout. | `30s` | ### Signer @@ -87,6 +87,54 @@ Signer configuration to issue identity certificates for devices or client applic | `signer.expiresIn` | string | The time up to which the certificate is valid. | `"87600h"` | | `signer.hubID` | string | Hub ID which is stored in coap-gw certificate and it cannot be used in the common name in the CSR. | `""` | +### Storage Configuration + +To configure the Storage, modify the properties under `clients.storage` in your configuration file. You can choose between two databases: `MongoDB` and `CqlDB``, and customize their settings accordingly. + +#### General Storage Settings + +| Property | Type | Description | Default | +| ---------- | -------- | -------------- | ------- | +| `clients.storage.use` | string | Database to store events. The supported values are: "mongoDB", "cqlDB". | `"mongoDB"` | +| `clients.storage.cleanUpRecords` | string | Schedule time when the expired non-identity certificates will be removed in the cron format | `"0 1 * * *"` | + +#### MongoDB Configuration + +Configure MongoDB settings under `clients.storage.mongoDB`. + +| Property | Type | Description | Default | +| ---------- | -------- | -------------- | ------- | +| `clients.storage.mongoDB.uri` | string | URI to the MongoDB database. | `"mongodb://localhost:27017"` | +| `clients.storage.mongoDB.database` | string | Name of the MongoDB database. | `"eventStore"` | +| `clients.storage.mongoDB.maxPoolSize` | int | Limits the number of connections. | `16` | +| `clients.storage.mongoDB.maxConnIdleTime` | string | Closes connection when idle time reaches the specified value. | `4m` | +| `clients.storage.mongoDB.tls.caPool` | []string | File paths to root certificates in PEM format. | `[]` | +| `clients.storage.mongoDB.tls.keyFile` | string | File path to the private key in PEM format. | `""` | +| `clients.storage.mongoDB.tls.certFile` | string | File path to the certificate in PEM format. | `""` | +| `clients.storage.mongoDB.tls.useSystemCAPool` | bool | If true, use the system certification pool. | `false` | + +#### CqlDB Configuration + +Configure CqlDB settings under `clients.storage.cqlDB`. + +| Property | Type | Description | Default | +| ---------- | -------- | -------------- | ------- | +| `clients.storage.cqlDB.table` | string | Name of the CqlDB table. | `"events"` | +| `clients.storage.cqlDB.keyspace.name` | string | Name of the CqlDB keyspace. | `"plgdhub"` | +| `clients.storage.cqlDB.keyspace.create` | bool | If true, attempt to create the keyspace if it does not exist. | `true` | +| `clients.storage.cqlDB.keyspace.replication` | object | [Replication map](https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/cqlCreateKeyspace.html) determining the data copies in a data center. | `{ "class": "SimpleStrategy", "replication_factor": 1 }` | +| `clients.storage.cqlDB.hosts` | []string | List of hosts to connect to without scheme and port. | `[]` | +| `clients.storage.cqlDB.port` | int | Port to connect to. | `9042` | +| `clients.storage.cqlDB.numConnections` | int | The number of connections to the DB. | `16` | +| `clients.storage.cqlDB.connectTimeout` | string | Time to wait until a successful connection is established. | `10s` | +| `clients.storage.cqlDB.useHostnameResolution` | bool | If true, attempt to resolve IP for FQDN and use it for connection. | `true` | +| `clients.storage.cqlDB.reconnectionPolicy.constant.interval` | string | Time to sleep between connection attempts after a failure. | `3s` | +| `clients.storage.cqlDB.reconnectionPolicy.constant.maxRetries` | int | Number of times to attempt reconnection. | `3` | +| `clients.storage.cqlDB.tls.caPool` | []string | File paths to root certificates in PEM format. | `[]` | +| `clients.storage.cqlDB.tls.keyFile` | string | File path to the private key in PEM format. | `""` | +| `clients.storage.cqlDB.tls.certFile` | string | File path to the certificate in PEM format. | `""` | +| `clients.storage.cqlDB.tls.useSystemCAPool` | bool | If true, use the system certification pool. | `false` | + {{< note >}} Note that the string type related to time (i.e. timeout, idleConnTimeout, expirationTime) is decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us", "ms", "s", "m", "h". diff --git a/content/en/docs/configuration/identity-store.md b/content/en/docs/configuration/identity-store.md index 08600a47..3b9d0ae9 100644 --- a/content/en/docs/configuration/identity-store.md +++ b/content/en/docs/configuration/identity-store.md @@ -74,21 +74,53 @@ plgd hub uses NATS messaging system as a event bus. | `clients.eventBus.nats.tls.certFile` | string | File name of certificate in PEM format. | `""` | | `clients.eventBus.nats.tls.useSystemCAPool` | bool | If true, use the system certification pool. | `false` | -### Storage +### Storage Configuration -plgd hub uses MongoDB database as owner's device store. +To configure the Storage, modify the properties under `clients.storage` in your configuration file. You can choose between two databases: `MongoDB` and `CqlDB``, and customize their settings accordingly. + +#### General Storage Settings + +| Property | Type | Description | Default | +| ---------- | -------- | -------------- | ------- | +| `clients.storage.use` | string | Database to store events. The supported values are: "mongoDB", "cqlDB". | `"mongoDB"` | + +#### MongoDB Configuration + +Configure MongoDB settings under `clients.storage.mongoDB`. | Property | Type | Description | Default | | ---------- | -------- | -------------- | ------- | -| `clients.storage.mongoDB.uri` | string | URI to mongo database. | `"mongodb://localhost:27017"` | -| `clients.storage.mongoDB.database` | string | Name of database. | `"ownersDevices"` | -| `clients.storage.mongoDB.maxPoolSize` | int | Limits number of connections. | `16` | -| `clients.storage.mongoDB.maxConnIdleTime` | string | Close connection when idle time reach the value. | `4m` | +| `clients.storage.mongoDB.uri` | string | URI to the MongoDB database. | `"mongodb://localhost:27017"` | +| `clients.storage.mongoDB.database` | string | Name of the MongoDB database. | `"eventStore"` | +| `clients.storage.mongoDB.maxPoolSize` | int | Limits the number of connections. | `16` | +| `clients.storage.mongoDB.maxConnIdleTime` | string | Closes connection when idle time reaches the specified value. | `4m` | | `clients.storage.mongoDB.tls.caPool` | []string | File paths to root certificates in PEM format. | `[]` | | `clients.storage.mongoDB.tls.keyFile` | string | File path to the private key in PEM format. | `""` | | `clients.storage.mongoDB.tls.certFile` | string | File path to the certificate in PEM format. | `""` | | `clients.storage.mongoDB.tls.useSystemCAPool` | bool | If true, use the system certification pool. | `false` | +#### CqlDB Configuration + +Configure CqlDB settings under `clients.storage.cqlDB`. + +| Property | Type | Description | Default | +| ---------- | -------- | -------------- | ------- | +| `clients.storage.cqlDB.table` | string | Name of the CqlDB table. | `"events"` | +| `clients.storage.cqlDB.keyspace.name` | string | Name of the CqlDB keyspace. | `"plgdhub"` | +| `clients.storage.cqlDB.keyspace.create` | bool | If true, attempt to create the keyspace if it does not exist. | `true` | +| `clients.storage.cqlDB.keyspace.replication` | object | [Replication map](https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/cqlCreateKeyspace.html) determining the data copies in a data center. | `{ "class": "SimpleStrategy", "replication_factor": 1 }` | +| `clients.storage.cqlDB.hosts` | []string | List of hosts to connect to without scheme and port. | `[]` | +| `clients.storage.cqlDB.port` | int | Port to connect to. | `9042` | +| `clients.storage.cqlDB.numConnections` | int | The number of connections to the DB. | `16` | +| `clients.storage.cqlDB.connectTimeout` | string | Time to wait until a successful connection is established. | `10s` | +| `clients.storage.cqlDB.useHostnameResolution` | bool | If true, attempt to resolve IP for FQDN and use it for connection. | `true` | +| `clients.storage.cqlDB.reconnectionPolicy.constant.interval` | string | Time to sleep between connection attempts after a failure. | `3s` | +| `clients.storage.cqlDB.reconnectionPolicy.constant.maxRetries` | int | Number of times to attempt reconnection. | `3` | +| `clients.storage.cqlDB.tls.caPool` | []string | File paths to root certificates in PEM format. | `[]` | +| `clients.storage.cqlDB.tls.keyFile` | string | File path to the private key in PEM format. | `""` | +| `clients.storage.cqlDB.tls.certFile` | string | File path to the certificate in PEM format. | `""` | +| `clients.storage.cqlDB.tls.useSystemCAPool` | bool | If true, use the system certification pool. | `false` | + {{< note >}} Note that the string type related to time (i.e. timeout, idleConnTimeout, expirationTime) is decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us", "ms", "s", "m", "h". diff --git a/content/en/docs/configuration/resource-aggregate.md b/content/en/docs/configuration/resource-aggregate.md index 93e4ffb2..2e574957 100644 --- a/content/en/docs/configuration/resource-aggregate.md +++ b/content/en/docs/configuration/resource-aggregate.md @@ -76,7 +76,7 @@ plgd hub uses NATS messaging system as a event bus. ### Event Store Configuration -To configure the Event Store, modify the properties under `clients.eventStore` in your Hugo configuration file. You can choose between two databases: `MongoDB` and `CqlDB``, and customize their settings accordingly. +To configure the Event Store, modify the properties under `clients.eventStore` in your configuration file. You can choose between two databases: `MongoDB` and `CqlDB`, and customize their settings accordingly. #### General Event Store Settings @@ -101,9 +101,9 @@ Configure MongoDB settings under `clients.eventStore.mongoDB`. | `clients.eventStore.mongoDB.tls.certFile` | string | File path to the certificate in PEM format. | `""` | | `clients.eventStore.mongoDB.tls.useSystemCAPool` | bool | If true, use the system certification pool. | `false` | -#### CqlDB (Scylla) Configuration +#### CqlDB Configuration -Configure CqlDB (Scylla) settings under `clients.eventStore.cqlDB`. +Configure CqlDB settings under `clients.eventStore.cqlDB`. | Property | Type | Description | Default | | ---------- | -------- | -------------- | ------- |