接受与 Windows Server 2012 上的 Solr/Jetty 实例 运行 的远程连接
Accept remote connections to Solr/Jetty instance running on Windows Server 2012
我是 运行 Windows Server 2012 上的 Solr 4.10.1 Jetty 实例。
我正在使用下载附带的简单示例 Jetty 版本,并且通过 运行 java -jar start.jar
(来自 solr-4.10.1\example)我能够从 Windows 服务器通过 http://localhost:8983/solr
.
现在我想远程访问 Solr/Jetty 实例,即从另一台计算机。 IE。我希望能够通过从远程 client/computer 对 http://<server IP>:8080/solr
and/or http://<server_domain>:8080/solr
的 HTTP 调用来访问我的 Windows 服务器上的 Solr 实例 运行 .
我在我的 Windows 服务器上创建了一个入站防火墙规则,接受本地端口 8080 上的任何远程地址,并且我已经将 jetty.xml 上的码头端口更改为 8080,这工作正常(我可以从我的 Windows 服务器访问 http://localhost:8080/solr
上的 Solr 实例)。
但是当我尝试将码头主机更改为服务器的 IP 时,我无法再访问 Solr 核心集合 - 即核心选择器中没有集合,所以我无法对 'http://<server IP>/solr/#/collection1/'
执行任何查询- 我只看到一个 "blank" Solr 界面。
我修改的jetty.xml部分是这样的:
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.bio.SocketConnector">
<Set name="host"><SystemProperty name="jetty.host" default="<WINDOWS_SERVER_IP>"/></Set>
<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
<Set name="maxIdleTime">50000</Set>
<Set name="lowResourceMaxIdleTime">1500</Set>
<Set name="statsOn">false</Set>
</New>
</Arg>
</Call>
首先 - 这是正确的方法吗?如果是,我做错了什么?如果没有,我该如何实现?我试图寻找方法来做到这一点,但我似乎找不到任何好的资源。
已解决。我必须做另外两件事:
1. 让 Jetty 使用特殊 IP 0.0.0.0 让它监听所有接口:
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.bio.SocketConnector">
<Set name="host"><SystemProperty name="jetty.host" default="<0.0.0.0>"/></Set>
<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
<Set name="maxIdleTime">50000</Set>
<Set name="lowResourceMaxIdleTime">1500</Set>
<Set name="statsOn">false</Set>
</New>
</Arg>
</Call>
- 打开端口 8080 上的 HTTP 流量从 客户端到域防火墙上的 服务器。
现在 Solr 可以在 http://SERVER_DOMAIN_NAME:8080/solr
上访问此域中连接的所有计算机。
我是 运行 Windows Server 2012 上的 Solr 4.10.1 Jetty 实例。
我正在使用下载附带的简单示例 Jetty 版本,并且通过 运行 java -jar start.jar
(来自 solr-4.10.1\example)我能够从 Windows 服务器通过 http://localhost:8983/solr
.
现在我想远程访问 Solr/Jetty 实例,即从另一台计算机。 IE。我希望能够通过从远程 client/computer 对 http://<server IP>:8080/solr
and/or http://<server_domain>:8080/solr
的 HTTP 调用来访问我的 Windows 服务器上的 Solr 实例 运行 .
我在我的 Windows 服务器上创建了一个入站防火墙规则,接受本地端口 8080 上的任何远程地址,并且我已经将 jetty.xml 上的码头端口更改为 8080,这工作正常(我可以从我的 Windows 服务器访问 http://localhost:8080/solr
上的 Solr 实例)。
但是当我尝试将码头主机更改为服务器的 IP 时,我无法再访问 Solr 核心集合 - 即核心选择器中没有集合,所以我无法对 'http://<server IP>/solr/#/collection1/'
执行任何查询- 我只看到一个 "blank" Solr 界面。
我修改的jetty.xml部分是这样的:
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.bio.SocketConnector">
<Set name="host"><SystemProperty name="jetty.host" default="<WINDOWS_SERVER_IP>"/></Set>
<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
<Set name="maxIdleTime">50000</Set>
<Set name="lowResourceMaxIdleTime">1500</Set>
<Set name="statsOn">false</Set>
</New>
</Arg>
</Call>
首先 - 这是正确的方法吗?如果是,我做错了什么?如果没有,我该如何实现?我试图寻找方法来做到这一点,但我似乎找不到任何好的资源。
已解决。我必须做另外两件事: 1. 让 Jetty 使用特殊 IP 0.0.0.0 让它监听所有接口:
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.bio.SocketConnector">
<Set name="host"><SystemProperty name="jetty.host" default="<0.0.0.0>"/></Set>
<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
<Set name="maxIdleTime">50000</Set>
<Set name="lowResourceMaxIdleTime">1500</Set>
<Set name="statsOn">false</Set>
</New>
</Arg>
</Call>
- 打开端口 8080 上的 HTTP 流量从 客户端到域防火墙上的 服务器。
现在 Solr 可以在 http://SERVER_DOMAIN_NAME:8080/solr
上访问此域中连接的所有计算机。