Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Paweł Chrząszcz committed May 10, 2022
1 parent 0d956f2 commit aa4b9f4
Show file tree
Hide file tree
Showing 21 changed files with 736 additions and 854 deletions.
97 changes: 57 additions & 40 deletions doc/configuration/outgoing-connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,47 @@ For example:

Selects the driver for RDBMS connection. The choice of a driver impacts the set of available options.

#### `outgoing_pools.rdbms.*.connection.keepalive_interval`
* **Syntax:** positive integer
* **Default:** not set - disabled by default
* **Example:** `keepalive_interval = 30`

When enabled, MongooseIM will send `SELECT 1 `query through every DB connection at given interval to keep them open. This option should be used to ensure that database connections are restarted after they became broken (e.g. due to a database restart or a load balancer dropping connections). Currently, not every network-related error returned from a database driver to a regular query will imply a connection restart.

#### `outgoing_pools.rdbms.*.connection.max_start_interval`
* **Syntax:** positive integer
* **Default:** 30
* **Example:** `max_start_interval = 30`

When MongooseIM fails to connect to the DB, it retries with an exponential backoff. This option limits the backoff time for faster reconnection when the DB becomes reachable again.

### Options for `pgsql` and `mysql`

#### `outgoing_pools.rdbms.*.connection.host`
* **Syntax:** string
* **Default:** no default; required for `pgsql` and `mysql`
* **Example:** `host = "localhost"`

#### `outgoing_pools.rdbms.*.connection.port`
* **Syntax:** string
* **Default:** `5432` for `pgsql`; `3306` for `mysql`
* **Example:** `host = "localhost"`

#### `outgoing_pools.rdbms.*.connection.database`
* **Syntax:** string
* **Default:** no default; required for `pgsql` and `mysql`
* **Example:** `database = "mim-db"`

#### `outgoing_pools.rdbms.*.connection.username`
* **Syntax:** string
* **Default:** no default; required for `pgsql` and `mysql`
* **Example:** `username = "mim-user"`

#### `outgoing_pools.rdbms.*.connection.password`
* **Syntax:** string
* **Default:** no default; required for `pgsql` and `mysql`
* **Example:** `password = "mim-password"`

### ODBC options

#### `outgoing_pools.rdbms.*.connection.settings`
Expand Down Expand Up @@ -107,35 +148,11 @@ sslmode = verify-full
sslrootcert = /path/to/ca/cert
```

### Other RDBMS backends

#### `outgoing_pools.rdbms.*.connection.host`
* **Syntax:** string
* **Example:** `host = "localhost"`

#### `outgoing_pools.rdbms.*.connection.database`
* **Syntax:** string
* **Example:** `database = "mim-db"`

#### `outgoing_pools.rdbms.*.connection.username`
* **Syntax:** string
* **Example:** `username = "mim-user"`

#### `outgoing_pools.rdbms.*.connection.password`
* **Syntax:** string
* **Example:** `password = "mim-password"`

#### `outgoing_pools.rdbms.*.connection.keepalive_interval`
* **Syntax:** positive integer
* **Default:** undefined (keep-alive not activated)
* **Example:** `keepalive_interval = 30`

When enabled, MongooseIM will send SELECT 1 query through every DB connection at given interval to keep them open. This option should be used to ensure that database connections are restarted after they became broken (e.g. due to a database restart or a load balancer dropping connections). Currently, not every network-related error returned from a database driver to a regular query will imply a connection restart.

## HTTP options

### `outgoing_pools.http.*.connection.host`
* **Syntax:** `"http[s]://string[:integer]"`
* **Default:** no default; this option is mandatory
* **Example:** `host = "https://server.com:879"`

### `outgoing_pools.http.*.connection.path_prefix`
Expand All @@ -156,7 +173,7 @@ HTTP also supports all TLS-specific options described in the TLS section.

## Redis-specific options

Redis can be used as a session manager backend.
Redis can be used as a session manager backend.
Global distribution (implemented in `mod_global_distrib`) requires Redis pool.

There are two important limitations:
Expand Down Expand Up @@ -195,10 +212,12 @@ Currently, only one Riak connection pool can exist for each supported XMPP host

### `outgoing_pools.riak.*.connection.address`
* **Syntax:** string
* **Default:** none, this option is mandatory
* **Example:** `address = "127.0.0.1"`

### `outgoing_pools.riak.*.connection.port`
* **Syntax:** integer
* **Default:** none, this option is mandatory
* **Example:** `port = 8087`

### `outgoing_pools.riak.*.connection.credentials`
Expand All @@ -213,9 +232,9 @@ Riak also supports all TLS-specific options described in the TLS section.
## Cassandra options

### `outgoing_pools.cassandra.*.connection.servers`
* **Syntax:** a TOML array of tables containing keys `"ip_adddress"` and `"port"`
* **Default:** `[{ip_address = "localhost", port = 9042}]`
* **Example:** `servers = [{ip_address = "host_one", port = 9042}, {ip_address = "host_two", port = 9042}]`
* **Syntax:** a TOML array of tables containing keys `"host"` and `"port"`
* **Default:** `[{host = "localhost", port = 9042}]`
* **Example:** `servers = [{host = "host_one", port = 9042}, {host = "host_two", port = 9042}]`

### `outgoing_pools.cassandra.*.connection.keyspace`
* **Syntax:** string
Expand All @@ -226,10 +245,12 @@ To use plain text authentication (using cqerl_auth_plain_handler module):

### `outgoing_pools.cassandra.*.connection.auth.plain.username`
* **Syntax:** string
* **Default:** none, this option is mandatory
* **Example:** `username = "auser"`

### `outgoing_pools.cassandra.*.connection.auth.plain.password`
* **Syntax:** string
* **Default:** none, this option is mandatory
* **Example:** `password = "somesecretpassword"`

Support for other authentication modules may be added in the future.
Expand All @@ -241,7 +262,7 @@ Cassandra also supports all TLS-specific options described in the TLS section.
Currently, only one pool tagged `default` can be used.

### `outgoing_pools.elastic.default.connection.host`
* **Syntax:** string
* **Syntax:** non-empty string
* **Default:** `"localhost"`
* **Example:** `host = "otherhost"`

Expand Down Expand Up @@ -332,10 +353,10 @@ Sets a limit of messages in a worker's mailbox above which the worker starts dro
* **Default:** `389` (or `636` if encryption is enabled)
* **Example:** `port = 800`

### `outgoing_pools.ldap.*.connection.rootdn`
### `outgoing_pools.ldap.*.connection.root_dn`
* **Syntax:** string
* **Default:** empty string
* **Example:** `rootdn = "cn=admin,dc=example,dc=com"`
* **Default:** empty string
* **Example:** `root_dn = "cn=admin,dc=example,dc=com"`

Leaving out this option makes it an anonymous connection, which most likely is what you want.

Expand All @@ -345,18 +366,14 @@ Leaving out this option makes it an anonymous connection, which most likely is w
* **Example:** `password = "topsecret"`

### `outgoing_pools.ldap.*.connection.connect_interval`
* **Syntax:** integer
* **Syntax:** positive integer
* **Default:** `10000`
* **Example:** `connect_interval = 20000`

Reconnect interval after a failed connection.

### `outgoing_pools.ldap.*.connection.encrypt`
* **Syntax:** string, one of: `"none"` or `"tls"`
* **Default:** `"none"`
* **Example:** `encrypt = "tls"`

LDAP also supports all TLS-specific options described in the TLS section (provided `encrypt` is set to `tls`).
LDAP also supports all TLS-specific options described in the TLS section.
To enable TLS, you need to include the `tls` subsection (it can be empty).

## TLS options

Expand Down
Loading

0 comments on commit aa4b9f4

Please sign in to comment.