Configuration
In the Quickstart, we installed Manul in memory mode. In this mode, the manul server is not connected to storage services, meaning all data will be lost upon restart.
To make manul server persistent, we need to connect it to PostgreSQL and OpenSearch.
Install PostgreSQL
Section titled “Install PostgreSQL”Manul uses PostgreSQL as the primary storage engine. If you don’t have it installed, download it from here.
Once installed, create a new database to be used in the configuration below.
Install OpenSearch
Section titled “Install OpenSearch”Manul relies on OpenSearch for object indexing and search. You can download OpenSearch from here.
Note: Elasticsearch is also compatible if you prefer it over OpenSearch.
Configure Manul
Section titled “Configure Manul”Make the following changes to ~/.manul/conf/manul.yml to enable persistence:
- Change the
modetopersistent. - Add PostgreSQL connection details.
- Add OpenSearch connection details.
The configuration should look like this:
mode: persistent
datasource: host: <postgrssql_host> port: <postgresql_port> username: <postgresql_username> password: <postgresql_password> database: <postgresql_database>
opensearch: host: <opensearch_host> port: <opensearch_port> username: <opensearch_username> password: <opensearch_password>
server: port: 8080Restart The Server
Section titled “Restart The Server”Restart manul server to apply the configuration changes:
manul restartTest The Configuration
Section titled “Test The Configuration”To verify that the persistent setup is working, repeat the example steps from the Quickstart.
After creating the data, reboot the server with manul restart and send the following request to check if the data survived the restart:
GET http://localhost:8080/quickstart/booksThe response will contain the book we have created if the configuration is correct.