mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Remove polylith/API mode (#2967)
This removes most of the code used for polylith/API mode. This removes the `/api` internal endpoints entirely. Binary size change roughly 5%: ``` 51437560 Feb 13 10:15 dendrite-monolith-server # old 48759008 Feb 13 10:15 dendrite-monolith-server # new ```
This commit is contained in:
parent
cc59879faa
commit
11d9b9db0e
106 changed files with 374 additions and 5850 deletions
|
@ -1,73 +0,0 @@
|
|||
---
|
||||
title: Starting the polylith
|
||||
parent: Installation
|
||||
has_toc: true
|
||||
nav_order: 10
|
||||
permalink: /installation/start/polylith
|
||||
---
|
||||
|
||||
# Starting the polylith
|
||||
|
||||
Once you have completed all of the preparation and installation steps,
|
||||
you can start your Dendrite polylith deployment by starting the various components
|
||||
using the `dendrite-polylith-multi` personalities.
|
||||
|
||||
## Start the reverse proxy
|
||||
|
||||
Ensure that your reverse proxy is started and is proxying the correct
|
||||
endpoints to the correct components. Software such as [NGINX](https://www.nginx.com) or
|
||||
[HAProxy](http://www.haproxy.org) can be used for this purpose. A [sample configuration
|
||||
for NGINX](https://github.com/matrix-org/dendrite/blob/main/docs/nginx/polylith-sample.conf)
|
||||
is provided.
|
||||
|
||||
## Starting the components
|
||||
|
||||
Each component must be started individually:
|
||||
|
||||
### Client API
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml clientapi
|
||||
```
|
||||
|
||||
### Sync API
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml syncapi
|
||||
```
|
||||
|
||||
### Media API
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml mediaapi
|
||||
```
|
||||
|
||||
### Federation API
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml federationapi
|
||||
```
|
||||
|
||||
### Roomserver
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml roomserver
|
||||
```
|
||||
|
||||
### Appservice API
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml appservice
|
||||
```
|
||||
|
||||
### User API
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml userapi
|
||||
```
|
||||
|
||||
### Key server
|
||||
|
||||
```bash
|
||||
./dendrite-polylith-multi -config /path/to/dendrite.yaml keyserver
|
||||
```
|
|
@ -16,12 +16,6 @@ Users can run Dendrite in one of two modes which dictate how these components ar
|
|||
server with generally low overhead. This mode dramatically simplifies deployment complexity and offers the
|
||||
best balance between performance and resource usage for low-to-mid volume deployments.
|
||||
|
||||
* **Polylith mode** runs all components in isolated processes. Components communicate through an external NATS
|
||||
server and HTTP APIs, which incur considerable overhead. While this mode allows for more granular control of
|
||||
resources dedicated toward individual processes, given the additional communications overhead, it is only
|
||||
necessary for very large deployments.
|
||||
|
||||
Given our current state of development, **we recommend monolith mode** for all deployments.
|
||||
|
||||
## Databases
|
||||
|
||||
|
@ -85,21 +79,15 @@ If using the PostgreSQL database engine, you should install PostgreSQL 12 or lat
|
|||
|
||||
### NATS Server
|
||||
|
||||
Monolith deployments come with a built-in [NATS Server](https://github.com/nats-io/nats-server) and
|
||||
therefore do not need this to be manually installed. If you are planning a monolith installation, you
|
||||
Dendrite comes with a built-in [NATS Server](https://github.com/nats-io/nats-server) and
|
||||
therefore does not need this to be manually installed. If you are planning a monolith installation, you
|
||||
do not need to do anything.
|
||||
|
||||
Polylith deployments, however, currently need a standalone NATS Server installation with JetStream
|
||||
enabled.
|
||||
|
||||
To do so, follow the [NATS Server installation instructions](https://docs.nats.io/running-a-nats-service/introduction/installation) and then [start your NATS deployment](https://docs.nats.io/running-a-nats-service/introduction/running). JetStream must be enabled, either by passing the `-js` flag to `nats-server`,
|
||||
or by specifying the `store_dir` option in the the `jetstream` configuration.
|
||||
|
||||
### Reverse proxy
|
||||
|
||||
A reverse proxy such as [Caddy](https://caddyserver.com), [NGINX](https://www.nginx.com) or
|
||||
[HAProxy](http://www.haproxy.org) is required for polylith deployments and is useful for monolith
|
||||
deployments. Configuring those is not covered in this documentation, although sample configurations
|
||||
[HAProxy](http://www.haproxy.org) is useful for deployments. Configuring those is not covered in this documentation, although sample configurations
|
||||
for [Caddy](https://github.com/matrix-org/dendrite/blob/main/docs/caddy) and
|
||||
[NGINX](https://github.com/matrix-org/dendrite/blob/main/docs/nginx) are provided.
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
---
|
||||
title: Installing as a polylith
|
||||
parent: Installation
|
||||
has_toc: true
|
||||
nav_order: 6
|
||||
permalink: /installation/install/polylith
|
||||
---
|
||||
|
||||
# Installing as a polylith
|
||||
|
||||
You can install the Dendrite polylith binary into `$GOPATH/bin` by using `go install`:
|
||||
|
||||
```sh
|
||||
go install ./cmd/dendrite-polylith-multi
|
||||
```
|
||||
|
||||
Alternatively, you can specify a custom path for the binary to be written to using `go build`:
|
||||
|
||||
```sh
|
||||
go build -o /usr/local/bin/ ./cmd/dendrite-polylith-multi
|
||||
```
|
||||
|
||||
The `dendrite-polylith-multi` binary is a "multi-personality" binary which can run as
|
||||
any of the components depending on the supplied command line parameters.
|
||||
|
||||
## Reverse proxy
|
||||
|
||||
Polylith deployments require a reverse proxy in order to ensure that requests are
|
||||
sent to the correct endpoint. You must ensure that a suitable reverse proxy is installed
|
||||
and configured.
|
||||
|
||||
Sample configurations are provided
|
||||
for [Caddy](https://github.com/matrix-org/dendrite/blob/main/docs/caddy/polylith/Caddyfile)
|
||||
and [NGINX](https://github.com/matrix-org/dendrite/blob/main/docs/nginx/polylith-sample.conf).
|
|
@ -7,11 +7,10 @@ permalink: /installation/configuration
|
|||
|
||||
# Configuring Dendrite
|
||||
|
||||
A YAML configuration file is used to configure Dendrite. Sample configuration files are
|
||||
A YAML configuration file is used to configure Dendrite. A sample configuration file is
|
||||
present in the top level of the Dendrite repository:
|
||||
|
||||
* [`dendrite-sample.monolith.yaml`](https://github.com/matrix-org/dendrite/blob/main/dendrite-sample.monolith.yaml)
|
||||
* [`dendrite-sample.polylith.yaml`](https://github.com/matrix-org/dendrite/blob/main/dendrite-sample.polylith.yaml)
|
||||
|
||||
You will need to duplicate the sample, calling it `dendrite.yaml` for example, and then
|
||||
tailor it to your installation. At a minimum, you will need to populate the following
|
||||
|
@ -46,10 +45,9 @@ global:
|
|||
## JetStream configuration
|
||||
|
||||
Monolith deployments can use the built-in NATS Server rather than running a standalone
|
||||
server. If you are building a polylith deployment, or you want to use a standalone NATS
|
||||
Server anyway, you can also configure that too.
|
||||
server. If you want to use a standalone NATS Server anyway, you can also configure that too.
|
||||
|
||||
### Built-in NATS Server (monolith only)
|
||||
### Built-in NATS Server
|
||||
|
||||
In the `global` section, under the `jetstream` key, ensure that no server addresses are
|
||||
configured and set a `storage_path` to a persistent folder on the filesystem:
|
||||
|
@ -63,7 +61,7 @@ global:
|
|||
topic_prefix: Dendrite
|
||||
```
|
||||
|
||||
### Standalone NATS Server (monolith and polylith)
|
||||
### Standalone NATS Server
|
||||
|
||||
To use a standalone NATS Server instance, you will need to configure `addresses` field
|
||||
to point to the port that your NATS Server is listening on:
|
||||
|
@ -86,7 +84,7 @@ one address in the `addresses` field.
|
|||
Configuring database connections varies based on the [database configuration](database)
|
||||
that you chose.
|
||||
|
||||
### Global connection pool (monolith with a single PostgreSQL database only)
|
||||
### Global connection pool
|
||||
|
||||
If you are running a monolith deployment and want to use a single connection pool to a
|
||||
single PostgreSQL database, then you must uncomment and configure the `database` section
|
||||
|
@ -109,7 +107,7 @@ override the `global` database configuration.
|
|||
|
||||
### Per-component connections (all other configurations)
|
||||
|
||||
If you are building a polylith deployment, are using SQLite databases or separate PostgreSQL
|
||||
If you are are using SQLite databases or separate PostgreSQL
|
||||
databases per component, then you must instead configure the `database` sections under each
|
||||
of the component blocks ,e.g. under the `app_service_api`, `federation_api`, `key_server`,
|
||||
`media_api`, `mscs`, `room_server`, `sync_api` and `user_api` blocks.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue