When ServiceControl is hosted in containers, the particular/ image provides the database storage to the Error and Audit instances.
The database container extends the official RavenDB container and is provided to ensure compatibility with ServiceControl instances. In other words, for any version x. version of ServiceControl, the same version x. of the database container should be used to ensure data storage compatibility.
The NServiceBus license covers the license for the embedded RavenDB that ships with ServiceControl. A separate RavenDB license is not required in this case.
A single database container should not be shared between multiple ServiceControl instances in production scenarios.
Basic usage
This minimal example creates a database container using docker run:
docker run -d --name servicecontrol-db \
-v db-config:/etc/ravendb \
-v db-data:/var/lib/ravendb/data \
particular/servicecontrol-ravendb:latest
Once the database container is running, the connection string http:/ can be used for the RAVENDB_CONNECTIONSTRING value for an Error instance or Audit instance.
Required settings
A volume must be mounted to / to provide persistent storage for database contents between container updates. Failure to specify a path for the volume will result in loss of all data when the container is removed.
RavenDB has specific requirements about the types of storage it supports. See the RavenDB deployment storage considerations documentation for more information.
If providing these storage requirements is not possible, it is also possible to connect to an external, separately-licensed RavenDB server. The external server must be using the same Major and Minor version noted in the version map below.
Additional settings
As the ServiceControl RavenDB container extends the official RavenDB container, additional configuration details can be found in the RavenDB Docker container documentation, according to this version map:
| ServiceControl Versions | RavenDB Version | Container Documentation |
|---|---|---|
| 6.x | 6.2 | RavenDB 6.2 container docs |
| 5.4 to 5.11 | 5.4 | RavenDB 5.4 container docs |
The RavenDB container overview on Docker Hub is specific to the most recent version of RavenDB which may not match the version used by ServiceControl.
To host ServiceControl and ServicePulse in Azure Container Apps, use Service Control v6 with RavenDB Cloud for hosting the database
Troubleshooting
The database container reports an AGPL license
A new database container reports AGPL - Open Source from its / endpoint until the first database is created. RavenDB applies the bundled license at that point, so this status is expected before an Error or Audit instance has connected for the first time.
If the data volume was first used by a RavenDB server that did not have the ServiceControl license, for example a container based on the official ravendb/ image, the database container keeps the unlicensed state stored in the volume. It doesn't apply the bundled license, and it doesn't log anything about licensing. In ServiceControl version 6.9 and later, the Error and Audit instances then stop at startup with the message Cannot validate the current RavenDB license.
To apply the bundled license to the existing data, run the following command, replacing servicecontrol-db with the name of the database container:
docker exec servicecontrol-db sh -c 'curl -s -X POST http://localhost:8080/admin/license/activate -H "Content-Type: application/json" --data-binary @/usr/lib/ravendb/servicecontrol-license.json'
Then restart the Error and Audit instances. RavenDB stores the license with the data in the volume, so the license remains in place when the database container is restarted or replaced by a new container that uses the same volume.