[英]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.