【发布时间】:2015-12-27 12:59:40
【问题描述】:
我有一个运行 elasticsearch 的 e2 ubuntu 实例,虽然它在本地运行良好,但我无法使用 curl http://ipaddress:9200/ 从 Windows pc 连接(错误是“无法连接到远程服务器”)。
我已经在同一个 ubuntu 实例上设置了 Apache,curl http://ipaddress:80/ 在同一个 Windows 机器上工作,我可以毫无问题地 ping 实例。
我的亚马逊安全组允许从所有 IP 地址对所有端口进行 tcp 访问。
我认为这是一个 ES 配置问题,尽管我添加到 elasticsearch.yml 的唯一行是:
http.cors.enabled: true
http.cors.allow-origin: "*"
我在运行 netstat 时注意到一些奇怪的事情,端口 9200 和 9300(ES 端口)的本地地址中有一个 1 - 这会阻止我的外部请求,如果是,我该如何更改?
ubuntu@ESServer$ netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 448 (AWS PRIVATE IP):22 (MY IP):63572 ESTABLISHED
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:9200 :::* LISTEN
tcp6 0 0 127.0.0.1:9200 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 ::1:9300 :::* LISTEN
tcp6 0 0 127.0.0.1:9300 :::* LISTEN
【问题讨论】:
-
您可以上网吗?你有外网IP吗?
-
上网没问题,我可以访问80端口。我在curl命令中使用外部IP
-
您是否启用了 IPTables?你能显示
iptables -L的输出吗? -
sudo iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
-
对格式化表示歉意。基本上,iptables 是空的
标签: ubuntu elasticsearch amazon-ec2 netstat