You can follow the below steps to set up PostgreSQL and configure it as the backend store for MLflow.
Steps to Setup
- Install PostgreSQL.
On Ubuntu/Debian:
sudo apt updatesudo apt install postgresql postgresql-contribOn CentOS/RHEL:
sudo yum install postgresql-server postgresql-contribsudo postgresql-setup initdbsudo systemctl start postgresqlsudo systemctl enable postgresql- Switch to the Postgres user and enter the PostgreSQL shell.
sudo -i -u postgrespsql- Create a database and user for MLflow.
CREATE DATABASE mlflow;CREATE USER mlflow WITH ENCRYPTED PASSWORD 'mlflow';GRANT ALL PRIVILEGES ON DATABASE mlflow TO mlflow;\qReplace 'your_password' with a strong password.
- Configure PostgreSQL to allow remote connections (optional)
- Edit the PostgreSQL config file
postgresql.confto listen on all IPs:
sudo nano /etc/postgresql/<version>/main/postgresql.confFind the line:
Find the line:Uncomment and change it to:
listen_addresses = '*'- Edit
pg_hba.confto allow your MLflow server IP (or all IPs):
sudo nano /etc/postgresql/<version>/main/pg_hba.conf- Add this line at the end (replace
<mlflow_server_ip>with your MLflow server IP):
host mlflow_db mlflow_user <IP Address> md5- Restart PostgreSQL:
sudo systemctl restart postgresqlWas this page helpful?