Hi Team I am trying to enable the postgres in data...
# troubleshoot
n
Hi Team I am trying to enable the postgres in datahub. I am facing one error that postgres is trying to connect to mysql. Do we need to add new script in .values and .charts file? Please resolve it on priority. Please explain me how to enable postgres in datahub
g
Hi, Abhinav! You should add this to `values.yaml`:
Copy code
global:
  sql:
    datasource:
      host: "your.postgres.address:5432"
      hostForpostgresqlClient: "your.postgres.address"
      port: "5432"
      url: "jdbc:<postgresql://your.postgres.address:5432/your_db_name?sslmode=require>"
      driver: "org.postgresql.Driver"
      username: "your_db_username"
      password:
        secretRef: k8s_secret_with_password
        secretKey: password
This works for me.
n
but this is under sql right? should I change that to pgsql?
g
Nope. It’s under sql
n
ok sure I will try it today
Hi @great-account-95406 Will we be able to use MYSQL and Postgres together? I did some changes in the script but the postgres is connecting to 3306 port only. it is not connecting to 5432 Here is the script that I am using sql: datasource: host: "telco-datahub-prerequisites-mvp-mysql:3306" hostpostgres: "postgresql.telco-datastorage-mvp.svc.cluster.local:5432" hostForMysqlClient: "telco-datahub-prerequisites-mvp-mysql" hostForpostgresqlClient: "postgresql.telco-datastorage-mvp" port: "3306" portpostgres: "5432" url: "jdbc:mysql://telco-datahub-prerequisites-mvp-mysql:3306/datahub?verifyServerCertificate=false&amp;useSSL=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;enabledTLSProtocols=TLSv1.2" urlpostgres: "jdbc:postgresql://postgresql.telco-datastorage-mvp:5432/inventory_data" driver: "com.mysql.cj.jdbc.Driver" driverpostgres: "org.postgresql.Driver" username: "root" usernamepostgres: "postgresql" password: secretRefpostgres: postgres-secrets secretKeypostgres: postgres-root-password secretRef: mysql-secrets secretKey: mysql-root-password
g
Hi Abhinav! Can’t say for sure. It’s better to ask the guys from the DataHub Team. I’m just a DataHub user like you and just shared a case that works for my type of setup. But if you look at the helm chart code you’ll see that it doesn’t support both types of database at the same time.
n
Okay thanks! Do you know someone who can help me out?
@hundreds-photographer-13496 @dazzling-judge-80093 @little-megabyte-1074 @careful-pilot-86309 @better-orange-49102 Can someone please confirm the same?
it is not recommended to enable both at a time
n
Okay, thanks!
b
the config shared by roman is fair enough to setup postgres setup job
n
Yes but I want to ingest both the mysql and pgsql data
b
here, mysql/postgresql setup job is used to initialize backend database used internally by datahub . This config/setting are not for ingestion . You can follow below guide for ingestion once you have deployed datahub https://datahubproject.io/docs/generated/ingestion/sources/mysql/ https://datahubproject.io/docs/generated/ingestion/sources/postgres