首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在solr6中添加JNDI

如何在solr6中添加JNDI
EN

Stack Overflow用户
提问于 2017-03-12 19:10:44
回答 1查看 894关注 0票数 1

我对码头很陌生。我以前用tomcat部署solr。但是我们搬到了solr6,我很难在jetty中配置资源,这是solr 6附带的。

如何在Solr 6中配置JNDI资源?

到目前为止,我一直在无缘无故地尝试着这样做。

solr-6.4.0/server/etc/jetty.xml中添加了下面的配置

代码语言:javascript
复制
<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

代码语言:javascript
复制
<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.jarmysql-connector-java-5.1.41-bin.jar中添加了两个jars

java -jar start.jar --list-modules

代码语言:javascript
复制
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。任何指示都会有帮助。谢谢。

EN

回答 1

Stack Overflow用户

发布于 2017-03-13 10:58:41

我让Solr与JNDI一起工作,主要是做您所做的事情,但做了一些更改:

  1. 将配置添加到上下文/solr-jetty-context.xml,而不是服务器/etc/jetty.xml
  2. 对以下每一个: jndi/plus/ext替换'jaas‘(一些组合不存在,所以忽略它们):
    1. 将模块/jaas.mod复制到解压缩的solr目录服务器/模块
    2. 将etc/jetty-jaas.xml复制到server/etc
    3. 将lib/jetty-jaas-..jar复制到server/lib

  1. 跑 java -jar start.jar --=plus java -jar start.jar --=ext
  2. 核实可用模块: java -jar start.jar --列表-模块
  3. 您可能需要向lib/ext添加其他jars,如番石榴或bonecp。
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42751855

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档