简体   繁体   English

Odoo 容器:数据库连接失败:无法连接到服务器:连接被拒绝(将 odoo 与 localhost postgres 链接)

[英]Odoo container : Database connection failure: could not connect to server: Connection refused (linking odoo with localhost postgres)


I'm trying to run the odoo docker container and linking it with my local (not container) postgresql.我正在尝试运行 odoo docker 容器并将其与我的本地(非容器)postgresql 链接。
I tried this command (as suggest here ).我试过这个命令(如建议here )。

docker container run -p 8089:8069 -e HOST=127.0.0.1 -e USER=tux -e PASSWORD=tux --name odoo -t odoo

Ran it and got these errors :运行它并得到这些错误:

Database connection failure: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?

I tried to open up the port 5432 with ufw but got the same erros.我试图用 ufw 打开端口 5432 但得到了同样的错误。 I also tried to change 127.0.0.1 to 0.0.0.0 but nothing.我也尝试将 127.0.0.1 更改为 0.0.0.0 但什么也没有。
Could you help me?你可以帮帮我吗?

ps : the USER and PASSWORD are corrects, I use them when I run odoo instance in my local. ps:USER和PASSWORD是正确的,我在本地运行odoo实例时使用它们。

you might need to add the host network with a flag --network=host您可能需要使用标志--network=host添加主机网络

WARNING: Published ports are discarded when using host network mode that just means you cannot change the port bindings. WARNING: Published ports are discarded when using host network mode ,已WARNING: Published ports are discarded when using host network mode ,这意味着您无法更改端口绑定。 thats as secure as your machine is.这和你的机器一样安全。

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

相关问题 连接到主机 localhost 端口 22:连接被拒绝 - connect to host localhost port 22: Connection refused Raspbian中的OpenHAB:无法连接:连接被拒绝 - OpenHAB in Raspbian : Could not connect: Connection Refused SSh:Connection拒绝localhost - SSh: Connection refused to localhost Kafka 连接 - 无法连接到本地主机端口 8083:连接被拒绝 - Kafka connect - Failed to connect to localhost port 8083: Connection refused postgres 连接在 ubuntu 中被拒绝 - postgres connection refused in ubuntu Unix服务器客户端连接:连接被拒绝 - Unix server client Connect: Connection refused 无法连接到服务器:连接被拒绝 (0x0000274D/10061) PostgreSQL - could not connect to server: Connection refused (0x0000274D/10061) PostgreSQL Postgres无法连接到数据库postgres:无法连接到服务器:没有这样的文件或目录? - Postgres could not connect to database postgres: could not connect to server: No such file or directory? annot 与服务器通信:发布 http://localhost/v2/snaps/discord:拨打 unix /run/snapd.socket:连接:连接被拒绝 - annot communicate with server: Post http://localhost/v2/snaps/discord: dial unix /run/snapd.socket: connect: connection refused Rabbitmq连接被拒绝,在Linux服务器上的docker容器中运行 - Rabbitmq connection refused , runs inside docker container on a linux server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM