oracle telnet : 无法打开与主机的连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22665428/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
telnet : could not open connection to host
提问by user3098992
I am trying to remotely access oracle DB using jdbc but got problems, after searching through i learned that ports might be blocked by the firewall.
I am getting the following error when i am executing the command to test if port is opened or not,
我正在尝试使用 jdbc 远程访问 oracle DB 但遇到了问题,经过搜索后我了解到端口可能被防火墙阻止。当我执行命令来测试端口是否打开时,我收到以下错误,
telnet MyIP 1521
Connecting to MyIP...Could not open connection to the host, on port 1521 : Connect failed
I tried opening the ports by making new inbound rule but still the error exists.
Atlast i turned my firewall off but it's still the same.
If i try the same command for localhost, i.e.,
我尝试通过制定新的入站规则来打开端口,但仍然存在错误。
Atlast 我关闭了我的防火墙,但它仍然是一样的。
如果我为本地主机尝试相同的命令,即,
telnet localhost 1521
It works, but using my ip address it's not. How can i resolve this ?
它有效,但使用我的 IP 地址却无效。我该如何解决这个问题?
回答by Cammisuli
Some ISP's block certain ports that might be targets for certain attacks. I know with MSSQL it uses port 1433 or something similar, and my service provider blocks connections to that port.
某些 ISP 会阻止某些可能成为某些攻击目标的端口。我知道 MSSQL 使用端口 1433 或类似端口,而我的服务提供商会阻止与该端口的连接。
Try setting up your dB to use a different port than the standard and see if that works. You could also call your provider to see if they're actually blocking the port.
尝试将 dB 设置为使用与标准不同的端口,看看是否有效。您也可以致电您的提供商,看看他们是否真的阻止了端口。
回答by Mohamed Fayek
Configuring the connection between client and server Oracle 10g
In a comment you have an extract from lsnrctl status:
在评论中,您有来自 lsnrctl status 的摘录:
Listening Endpoints summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) Services summary... Your listener is only listening on 127.0.0.1, so connections can only be made from the server. There is nothing listening on your external address 10.0.2.39, so connections to port 1521 on that address fail.
侦听端点摘要... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) 服务摘要...您的侦听器仅侦听 127.0.0.1,因此连接只能由服务器制作。没有任何内容侦听您的外部地址 10.0.2.39,因此与该地址上的端口 1521 的连接失败。
Your listener.ora presumably has something either a single ADDRESS, or no ADDRESS at all, which will default to localhost:1521. You need to modify it to something like:
您的 listener.ora 可能有一个地址,或者根本没有地址,默认为 localhost:1521。您需要将其修改为:
LISTENER = ... (ADDRESS_LIST = ... (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.39)(PORT = 1521)) ) or your machine's host name if that's resolvable to that address. Ideally this would be done through netca rather than by editing the file by hand.
LISTENER = ... (ADDRESS_LIST = ... (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.39)(PORT = 1521) ) ) 或您机器的主机名(如果可以解析为该地址)。理想情况下,这将通过 netca 完成,而不是手动编辑文件。