<@U04S8PLJWMT> how to setup the RDS as external d...
# ask-ai
r
@kapa.ai how to setup the RDS as external database for airbyte
@kapa.ai
k
Sorry @Renu Fulmali, I'm not sure what you mean. Please try again. 👋
To set up AWS RDS as an external database for Airbyte, follow these steps: ### 1. Prepare Your RDS Postgres Instance - Create a PostgreSQL instance on AWS RDS. - Manually create the required databases:
Copy code
sql     CREATE DATABASE airbyte WITH OWNER = <your_user>;     CREATE DATABASE temporal WITH OWNER = <your_user>;     CREATE DATABASE temporal_visibility WITH OWNER = <your_user>;
Replace
<your_user>
with the username you will use for Airbyte. Make sure this user has the necessary privileges on these databases. ### 2. Create Kubernetes Secret for Database Credentials Create a Kubernetes secret (if deploying on Kubernetes) to store your database credentials. For example:
Copy code
yaml apiVersion: v1 kind: Secret metadata:   name: airbyte-config-secrets type: Opaque stringData:   database-user: <your_user>   database-password: <your_password>
Replace
<your_user>
and
<your_password>
with your actual credentials. This secret must be created before installing Airbyte with Helm. ### 3. Configure Airbyte to Use the External Database In your
values.yaml
file (for Helm deployments), disable the internal Postgres and provide your RDS details:
Copy code
yaml postgresql:   enabled: false  global:   database:     type: external     secretName: "airbyte-config-secrets"     host: "<rds-endpoint>"     port: "5432"     database: "airbyte"     userSecretKey: "database-user"     passwordSecretKey: "database-password"
Replace
<rds-endpoint>
with your RDS instance endpoint. Make sure the port and database name match your setup. The
userSecretKey
and
passwordSecretKey
should match the keys in your secret. ### 4. Additional Notes - Ensure your RDS security group allows inbound connections from your Airbyte deployment (e.g., your Kubernetes cluster or EC2 instance). - If you encounter Helm install timeouts, try increasing the timeout, e.g.:
Copy code
bash   helm install release-1 airbyte/airbyte -f values.yaml --timeout 10m0s
- The database password must be set in the
airbyte-config-secrets
secret, not directly in
values.yaml
for security reasons. - Supported Postgres versions for RDS include 12.19, 13.15, 14.12, 15.7, 16.3, and 17.1, as tested by the community [Minimal Postgres Version Supported as External Database](https://github.com/airbytehq/airbyte/issues/48542). ### References - [Airbyte Docs: External Database Setup](https://docs.airbyte.com/platform/1.7/deploying-airbyte/integrations/database) - [Helm Chart Example and Troubleshooting](https://github.com/airbytehq/airbyte/issues/48542) If you need to set up Airbyte with Docker Compose, you must update the
.env
file with your RDS credentials and remove the internal db service from
docker-compose.yaml
as described in the forum posts. The process is similar, but the configuration is done via environment variables instead of Helm values files. If you encounter issues, double-check: - Database user permissions - RDS network/security group settings - That the required databases exist and are accessible Let me know if you need Docker Compose-specific instructions!
r
@kapa.ai Message: Driver org.postgresql.Driver claims to not accept jdbcUrl, jdbc:postgresql://http//ct qa cloudutil02.cluster ck1fj82zm8pb.us east 1.rds.amazonaws.com5432/L1_Airbyte
k
A message from kapa.ai
The error message:
Copy code
Driver org.postgresql.Driver claims to not accept jdbcUrl, jdbc:postgresql://http://ct-qa-cloudutil02.cluster-ck1fj82zm8pb.us-east-1.rds.amazonaws.com:5432/L1_Airbyte
indicates that the JDBC URL you provided is incorrectly formatted. The correct format for a PostgreSQL JDBC URL is:
Copy code
jdbc:postgresql://<host>:<port>/<database>
In your message, the URL is:
Copy code
jdbc:postgresql://http://ct-qa-cloudutil02.cluster-ck1fj82zm8pb.us-east-1.rds.amazonaws.com:5432/L1_Airbyte
This is invalid because of the extra
postgresql://http
part. It should be:
Copy code
jdbc:postgresql://ct-qa-cloudutil02.cluster-ck1fj82zm8pb.us-east-1.rds.amazonaws.com:5432/L1_Airbyte
How to fix: - Update your configuration to use the correct JDBC URL format as shown above. - Make sure there are no extra characters or protocols in the URL. This format is confirmed in multiple Airbyte setup examples and documentation, such as:
Copy code
DATABASE_URL=jdbc:postgresql://<HOST_NAME>.eu-west-1.rds.amazonaws.com:5432/airbyte
[source](https://discuss.airbyte.io/t/1544) If you continue to see issues after correcting the URL, double-check that your
.env
or configuration files do not have typos or extra characters. Let me know if you need further help!
r
@kapa.ai Error getting connection from data source HikariDataSource (HikariPool-1) at org.jooq_3.19.18.POSTGRES.debug(Unknown Source) at org.jooq.impl.DataSourceConnectionProvider.acquire(DataSourceConnectionProvider.java:90) at org.jooq.impl.DefaultExecuteContext.connection(DefaultExecuteContext.java:651) at org.jooq.impl.AbstractQuery.connection(AbstractQuery.java:388) at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:308) at org.jooq.impl.AbstractResultQuery.fetchLazy(AbstractResultQuery.java:301) at org.jooq.impl.AbstractResultQuery.fetchLazyNonAutoClosing(AbstractResultQuery.java:322) at org.jooq.impl.SelectImpl.fetchLazyNonAutoClosing(SelectImpl.java:3256) at org.jooq.impl.ResultQueryTrait.fetchOne(ResultQueryTrait.java:509) at org.jooq.impl.Tools.attach(Tools.java:1687) at org.jooq.impl.DefaultDSLContext.fetchOne(DefaultDSLContext.java:5019) at org.jooq.impl.DefaultDSLContext.lambda$fetchValue$55(DefaultDSLContext.java:5039) at org.jooq.impl.Tools.attach(Tools.java:1687) at org.jooq.impl.DefaultDSLContext.fetchValue(DefaultDSLContext.java:5039) at org.jooq.impl.DefaultDSLContext.fetchValue(DefaultDSLContext.java:5058) at org.jooq.impl.DefaultDSLContext.fetchExists(DefaultDSLContext.java:5150) at io.airbyte.db.check.DatabaseAvailabilityCheck$DefaultImpls.isDatabaseConnected$lambda$6$lambda$4(DatabaseAvailabilityCheck.kt:99) at io.airbyte.db.Database.query(Database.kt:13) at io.airbyte.db.check.DatabaseAvailabilityCheck$DefaultImpls.isDatabaseConnected$lambda$6(DatabaseAvailabilityCheck.kt:98) at io.airbyte.db.check.DatabaseAvailabilityCheck$DefaultImpls.check(DatabaseAvailabilityCheck.kt:72) at io.airbyte.db.check.ConfigsDatabaseAvailabilityCheck.check(ConfigsDatabaseAvailabilityCheck.kt:18) at io.airbyte.db.init.DatabaseInitializer$DefaultImpls.initialize(DatabaseInitializer.kt:86) at io.airbyte.db.init.ConfigsDatabaseInitializer.initialize(ConfigsDatabaseInitializer.kt:20) at io.airbyte.bootloader.Bootloader.initializeDatabases(Bootloader.kt:263) at io.airbyte.bootloader.Bootloader.load(Bootloader.kt:80) at io.airbyte.bootloader.ApplicationKt.main(Application.kt:25) Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms (total=0, active=0, idle=0, waiting=1) at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:710) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:189) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:147) at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:99) at org.jooq.impl.DataSourceConnectionProvider.acquire(DataSourceConnectionProvider.java:87) ... 24 common frames omitted Caused by: org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:364) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:273) at org.postgresql.Driver.makeConnection(Driver.java:446) at org.postgresql.Driver.connect(Driver.java:298) at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:139) at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:367)
k
A message from kapa.ai
The error message you are seeing:
Copy code
Error getting connection from data source HikariDataSource (HikariPool-1) ... Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms (total=0, active=0, idle=0, waiting=1) ... Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
indicates that Airbyte is unable to establish a connection to your PostgreSQL database. This is a common issue and can be caused by several factors: 1. Incorrect Database Host/Port/URL: Double-check that your
host
,
port
, and JDBC URL are correct. The JDBC URL should follow the format:
Copy code
jdbc:postgresql://<host>:<port>/<database>
An incorrectly formatted URL or wrong host/port will cause connection failures, as seen in similar issues where the URL was malformed or the host was unreachable [Forum Post: Failed to connect to external postgres DB](https://discuss.airbyte.io/t/1264). 2. Network Connectivity: Ensure that the machine running Airbyte can reach the database host and port. If you are using AWS RDS, make sure the RDS security group allows inbound connections from your Airbyte deployment environment [Forum Post: Error deploying Airbyte with an external Postgres database (AWS RDS)](https://discuss.airbyte.io/t/2179). 3. Database Availability: The database must be running and accepting connections. If the database is still initializing or not ready, you may see similar timeout errors [Forum Post: Failed to connect to external postgres DB](https://discuss.airbyte.io/t/1264). 4. Authentication Issues: If the credentials are incorrect, you may see a different error, but it's still worth verifying your username and password. 5. Firewall/Security Group: Ensure there are no firewalls or security groups blocking the connection between Airbyte and the database. 6. Database Exists: Make sure the database you are trying to connect to actually exists. If not, you may see errors like "database does not exist" [Github Issue: Unable to install Airbyte locally - Unable to connect to the database](https://github.com/airbytehq/airbyte/issues/45456). Troubleshooting Steps: - Verify the JDBC URL format and credentials. - Test connectivity to the database from the Airbyte host (e.g., using
psql
or
telnet
). - Check RDS or database logs for connection attempts or errors. - Ensure the database is up and accepting connections. If you have checked all of the above and the issue persists, please provide the exact configuration you are using (with sensitive information redacted) for further assistance. If you need more specific guidance, please let me know your deployment method (Docker, Kubernetes, etc.) and how you are configuring the database connection.