telnet 到端口失败:基本网络理论模糊

发布于 2024-12-16 16:58:05 字数 335 浏览 0 评论 0原文

当某些网络连接无法正常工作时,我的一招就是尝试打开与其连接的 telnet 连接。我不期望能够通过此连接做任何有用的事情,但是知道我是否可以连接有助于诊断问题。

今天我们遇到了一个问题,我们的应用程序服务器无法打开与数据库的 JDBC 连接。但是,当应用程序服务器与数据库位于同一物理机器上时,它可以正常工作。啊哈,我想,一定有防火墙阻止了该端口。所以我尝试远程登录到该端口,但无法连接。不过,作为控制,我还远程登录到我们可以连接的机器上的数据库,但也失败了。因此,情况是,不知何故,该端口上侦听的任何内容都接受来自 JBoss 的 JDBC 连接,但拒绝来自 telnet 的连接。它如何区分这两种连接?不同的协议?连接请求中嵌入的密码?

When some network connection isn't working right, one thing in my bag of tricks is to try opening a telnet connection to it. I don't expect to be able to do anything useful with this connection, but knowing if I can or can't connect is helpful in diagnosing the problem.

So today we had a problem where our app server couldn't open the JDBC connection to our database. However, it works fine when the app server is on the same physical box as the database. Aha, I thought, there must be a firewall blocking that port. So I tried to telnet to that port, and couldn't connect. As a control though, I also telnetted to a database on a box we could connect to and that failed as well. So, the situation is, somehow whatever is listening on that port accepts a JDBC connection from JBoss, but rejects a connect from telnet. How does it distinguish these two connections? Different protocol? Password embedded in the connection request?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

往事随风而去 2024-12-23 16:58:05

听起来数据库只接受本地接口上的连接。您的应用程序服务器是否配置为通过其 IP、localhost 或 127.0.0.1 连接到数据库?

Sounds like the database is only accepting connections on the local interface. Is your app server configured to connect to the database via its IP or via either localhost or 127.0.0.1?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文