Solr配置,加密数据配置文件 [英] Solr config, encrypting data config file

查看:663
本文介绍了Solr配置,加密数据配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在这里加密数据配置部分?

How can I encrypt the data config portion here?:

<dataConfig> 
<dataSource type="JdbcDataSource"  driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"  
url="jdbc:sqlserver://127.0.0.1;databaseName=emp" user="user" password="user"/> 
<document name="reviews"> 
   <entity name="COMMON" query="select id,name from users" > 
       <field column="id" name="id"/> 
       <field column="name" name="name"/>
  </entity> 
</document> 
</dataConfig>

基本上,我不想公开用户和密码。

Basically, I don't want to expose the user and password.

另外,如果数据配置文件无法加密(部分或全部),我可以使用SolrJ对数据库进行索引,这样我就不必配置数据配置文件了吗?也就是说,我使用SolrJ apis传递url和验证参数?

Alternately, if data config files cannot be encrypted (partly or completely), can I do indexing of a database using SolrJ such that I do not have to configure a data config file? That is, I pass the url and authentication parameters using SolrJ apis?

推荐答案

一个更安全的选项,我建议是配置您的网络服务器中的 JNDI

A more secure option, I would suggest is to configure a JNDI in your webserver.

如何配置JNDI? 此页解释了如何做到与Tomcat。您可以在数据配置文件中使用JNDI名称,如下所示:

How to configure a JNDI? This Page explains how to do so with Tomcat. It can be done for other popular webservers as well.


$ b

$ b

You can use the JNDI name in your data config file as follows:

< dataSource name="xyz" jndiName="jdbc/xyz" type="JdbcDataSource"/>

这篇关于Solr配置,加密数据配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆