Skip to content

Commit

Permalink
add cqldb configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Dec 15, 2023
1 parent d8568f3 commit d73bd74
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 14 deletions.
58 changes: 53 additions & 5 deletions content/en/docs/configuration/certificate-authority.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <host>:<port> 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 <host>:<port> 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

Expand All @@ -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".
Expand Down
44 changes: 38 additions & 6 deletions content/en/docs/configuration/identity-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
6 changes: 3 additions & 3 deletions content/en/docs/configuration/resource-aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 |
| ---------- | -------- | -------------- | ------- |
Expand Down

0 comments on commit d73bd74

Please sign in to comment.