[英]Windows - jboss on docker, connection refused to local oracle database
I have Jboss running in a docker container.我有Jboss在docker容器中运行。 On jboss I have defined a connection to the xa-datasource database as the ip address of my computer and not localhost because I work in Windows 10 .在 jboss 上,我将与 xa-datasource 数据库的连接定义为我的计算机的 ip 地址,而不是 localhost,因为我在Windows 10工作。 Despite the correct ip and port to the database ( oracle ) I keep getting the connection refused error .尽管正确的 ip 和数据库端口 ( oracle ) 我不断收到连接被拒绝错误。 I run jboss with the command我用命令运行 jboss
docker run -d -p 8080:8080 -p 9990:9990 myjboss
Can anyone help me, or do I need any additional settings in my docker.谁能帮助我,或者我需要在我的 docker 中进行任何其他设置。 I will add that I also test alpine and in the container ( exec
) I can ping my ip address.我要补充一点,我还测试了 alpine,并且在容器( exec
)中我可以 ping 我的 ip 地址。
Thanks a lot for all the answers.非常感谢所有的答案。 I would like to add that I tested all other solutions contained in similar questions, but unfortunately I did not get the expected results.我想补充一点,我测试了类似问题中包含的所有其他解决方案,但不幸的是我没有得到预期的结果。
If you can ping your host IP, but you can't connect to the database, granted that the DB is running and the listener is up...如果您可以 ping 您的主机 IP,但您无法连接到数据库,前提是数据库正在运行并且侦听器已启动...
I'd advise you to check the Windows Firewall
settings.我建议您检查Windows Firewall
设置。
Maybe try disabling it to check if you can actually connect to the database, if so, add an Inbound Rule
to the firewall to allow connections on port 1521
(or whatever port your listener is running on)也许尝试禁用它以检查您是否可以实际连接到数据库,如果可以,请向防火墙添加一个Inbound Rule
以允许端口1521
(或您的侦听器正在运行的任何端口)上的连接
I solved this problem by using not ip/localhost but host.docker.internal
as described here -> https://docs.docker.com/docker-for-windows/networking/我通过使用不是 ip/localhost 而是使用host.docker.internal
解决了这个问题,如此处所述-> https://docs.docker.com/docker-for-windows/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.