More
BigQuery Data Warehouse Connector Setup
Setup Google Cloud
Enable APIs
If not already done, enable the following APIs for the project where you want to install the Google BigQuery instance:
Get your API Key
- Go to Create Service Account.
- Give it the name
Lunary Data Warehouse Account
. - Click on Create and continue.
- Click on Select a role and choose the
Datastream Admin
role. - Click on Add another role.
- Click on Select a role and choose the
BigQuery Admin
role. - Click on Continue.
- Click on Done.
- Click on the
Lunary Data Warehouse Account
. - Click on Keys.
- Click on Add Key and select the
Create new key
option from the drop-down menu. - Make sure
JSON
is selected for the Key Type, and click on Create. - Your private key will be downloaded to your computer. Save this private key.
Setup PostgreSQL source
Cloud SQL
- Go to the Cloud SQL Instances page in the Google Cloud Console.
- Select the instance to which you want Datastream to connect.
- Click Edit.
- Scroll down to the Flags section.
- Click ADD FLAG.
- Choose the
cloudsql.logical_decoding
flag from the drop-down menu. - Set its flag value to
on
. - Click
SAVE
to save your changes. You’ll need to restart your instance to update it with the changes. Once your instance has been restarted, confirm your changes under Database flags on the Overview page.
Amazon RDS
- Launch your Amazon RDS Dashboard.
- In the Navigation Drawer, click Parameter Groups, and then click Create Parameter Group. The Create Parameter Group page appears.
- Select
PostgreSQL
for the database family, provide a name and description for the parameter group, and then click Create. - Select the check box to the left of your newly created parameter group, and then, under Parameter Group Actions, click Edit.
- Set
logical_replication
to1
. - Click Save changes.
- In the Navigation drawer, click Databases.
- Select your source, and then click Modify.
- Scroll down to the Additional configuration section.
- Select the parameter group that you created.
- Click Continue.
- Under Scheduling of modifications, select
Apply immediately
.
Because you’ve modified your source, you must wait until the changes to your parameter group are applied before proceeding.
- In the Navigation drawer, click Databases, and then select your database instance.
- Click the Configurations tab.
- Verify that you see the parameter group that you created, and that its status is
pending-reboot
. - From the Instance Actions menu, select
Reboot
.
Self-hosted PostgreSQL
- Add
wal_level=logical
to the postgresql.conf file, or do this on the server command line. - Restart the server.