简体   繁体   English

使用 docker 连接托管在 azure 存储中的 Postgres 数据库

[英]Connect Postgres db hosted in azure storage using docker

I am trying to connect the postgres database hosted in azure storage account from within the flyway, flyway is running as docker image in docker container我正在尝试从 flyway 连接托管在 azure 存储帐户中的 postgres 数据库,flyway 在 docker 容器中作为 docker 图像运行

docker run --rm flyway/flyway -url=jdbc:postgresql://postgres-azure-db:5432/postgres -user=user -password=password info but I am getting the error ERROR: Unable to obtain connection from database docker run --rm flyway/flyway -url=jdbc:postgresql://postgres-azure-db:5432/postgres -user=user -password=password info但我收到错误错误:无法从数据库获取连接

Any idea/doc-link would be helpful任何想法/文档链接都会有所帮助

You have a similar error (different context, same general solution) in this flyway issue您在此飞路问题中遇到类似的错误(不同的上下文,相同的通用解决方案)

my missing piece for reaching private Cloud SQL instances from private worker pools in Cloud Build was a missing.network route.我从 Cloud Build 中的私有工作池到达私有云 SQL 实例的缺失部分是 missing.network 路由。
The fix is ensuring the Service Networking VPC peer has the "Export custom routes" setting enabled, and that the Cloud Router advertises the route.解决方法是确保服务网络 VPC 对等点启用了“导出自定义路由”设置,并且 Cloud Router 通告路由。

In your context (Azure), see " Quickstart: Use Azure Data Studio to connect and query PostgreSQL "在您的上下文 (Azure) 中,请参阅“ 快速入门:使用 Azure Data Studio 连接和查询 PostgreSQL

You can also try with a local Postgres instance first, and Azure Data Studio , for testing.您也可以先尝试使用本地 Postgres 实例,然后使用 Azure Data Studio进行测试。

After exploring few option, I implemented the flyway using the Azure container instance.在探索了几个选项之后,我使用 Azure 容器实例实现了 flyway。 Create an ACI to store the flyway docker image and to execute the commands inside ACI, Also created a file share to keep the config file and sql scripts.创建一个 ACI 来存储 flyway docker 图像并在 ACI 中执行命令,还创建一个文件共享来保存配置文件和 sql 脚本。

All these resource (Storage, ACI, file share) I created via the terraform scripts which is being triggered from Jenkins.我通过 Jenkins 触发的 terraform 脚本创建的所有这些资源(存储、ACI、文件共享)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Docker 中的 Python 使用 Azure AD MFA 连接到 SQL 服务器数据库 - Connect to SQL Server db with Azure AD MFA using Python in Docker 如何使用 RBAC 连接到 Azure 表存储 - How to connect to Azure Table Storage using RBAC 将 aws postgres db 连接到 vercel - Connect aws postgres db to the vercel 如何使用 azure function 中的 powershell 脚本将存储帐户连接到 AAS - how to connect storage account to AAS using powershell script in azure function 无法从 Azure aks 连接到 Azure Postgres - unable to connect to Azure Postgres from Azure aks 需要从 Azure 数据工厂连接 Azure Sql db,使用 userManagedIdentity 作为身份验证方法限制在模式级别 - Need to Connect Azure Sql db from Azure Data Factory,restricted at Schema Level using userManagedIdentity as Authentication Method 如何使用Spring数据JPA访问Azure AD集成Postgres DB? - How to access Azure AD integrated Postgres DB using Spring Data JPA? 如何将 Postgres 数据库连接到 Google Data Studio - How to connect Postgres DB to Google Data Studio 无法连接到 Azure Postgres 服务器 11 - Unable to connect to Azure Postgres Server 11 从 Azure Devops Hosted Agents 访问私有存储帐户 - Accessing a private storage account from Azure Devops Hosted Agents
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM