我对码头很陌生。我以前用tomcat部署solr。但是我们搬到了solr6,我很难在jetty中配置资源,这是solr 6附带的。
如何在Solr 6中配置JNDI资源?
到目前为止,我一直在无缘无故地尝试着这样做。
在solr-6.4.0/server/etc/jetty.xml中添加了下面的配置
<New id="test" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/DSTest</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<Set name="Url">jdbc:mysql://localhost:3306/db</Set>
<Set name="User">root</Set>
<Set name="Password"></Set>
</New>
</Arg>
</New>在solr-6.4.0/server/solr-webapp/webapp/WEB-INF/web.xml中
<resource-ref>
<description>My DataSource Reference</description>
<res-ref-name>jdbc/DSTest</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>我在jetty-plus-9.3.14.v20161028.jar和mysql-connector-java-5.1.41-bin.jar中添加了两个jars
java -jar start.jar --list-modules说
Jetty All Available Modules:
----------------------------
[ ] Module: http
Depend: server
XML: etc/jetty-http.xml
Enabled: <not enabled in this configuration>
[ ] Module: https
Depend: ssl
XML: etc/jetty-https.xml
Enabled: <not enabled in this configuration>
[ ] Module: server
LIB: lib/*.jar
LIB: lib/ext/*.jar
LIB: resources/
XML: etc/jetty.xml
Enabled: <not enabled in this configuration>
[ ] Module: ssl
Depend: server
XML: etc/jetty-ssl.xml
Enabled: <not enabled in this configuration>
Jetty Selected Module Ordering:
------------------------------Solr 6文档没有讨论如何执行JNDI。任何指示都会有帮助。谢谢。
发布于 2017-03-13 10:58:41
我让Solr与JNDI一起工作,主要是做您所做的事情,但做了一些更改:
https://stackoverflow.com/questions/42751855
复制相似问题