telnet 到端口失败:基本网络理论模糊
当某些网络连接无法正常工作时,我的一招就是尝试打开与其连接的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来数据库只接受本地接口上的连接。您的应用程序服务器是否配置为通过其 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?