You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Shyamsunder Reddy <sj...@yahoo.com> on 2009/03/19 17:09:22 UTC

DIH - read datasource param values from property file or configure JNDI datasource

I am looking for a implementation of DIH feature: It also takes in a properties file for the data source configuration (http://issues.apache.org/jira/browse/SOLR-469)

I want to externalize the data source parameters like driver, url, user and password to property file outside the solr. My aim to hide the parameters from developer code in Production environment. So that admin can enter these values.

Or else can DIH read JNDI data source from server environment.

Let me know the best practice to follow in production environment?

Thanks
Shyamsunder




      

Re: DIH - read datasource param values from property file or configure JNDI datasource

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Thu, Mar 19, 2009 at 11:39 PM, Erik Hatcher
<er...@ehatchersolutions.com>wrote:

>
> I don't believe it is the case that all parameters to DIH can be controlled
> dynamically on a request.  Isn't it the case that the init of a DIH config
> is required to pick up some settings?  Like the JDBC URL?   I just recall
> that in my previous code perusals, correct me if I'm off base.
>

Yes, you are right. The JdbcDataSource does not currently resolve variables
for jdbc url, username and password. I'll open an issue.

-- 
Regards,
Shalin Shekhar Mangar.

Re: DIH - read datasource param values from property file or configure JNDI datasource

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Mar 19, 2009, at 1:59 PM, Fergus McMenemie wrote:
>> I am looking for a implementation of DIH feature: It also takes in  
>> a properties file for the data source configuration (http://issues.apache.org/jira/browse/SOLR-469 
>> )
>>
>> I want to externalize the data source parameters like driver, url,  
>> user and password to property file outside the solr. My aim to hide  
>> the parameters from developer code in Production environment. So  
>> that admin can enter these values.
>>
>> Or else can DIH read JNDI data source from server environment.
>>
>> Let me know the best practice to follow in production environment?
>>
>> Thanks
>> Shyamsunder
>>
>
> This is an idea rather than a recommendation.
>
> But, as per the DIH FAQ, you can pass in extra arguments on the URL
> used to invoke DIH and use these arguments within data-config.xml.
> Not too sure the extent they can be used with the various  
> dataSource's.
> But  if you are happy to pass the information in via the URL or even
> solconfig.xml then this may the route to go down.

I don't believe it is the case that all parameters to DIH can be  
controlled dynamically on a request.  Isn't it the case that the init  
of a DIH config is required to pick up some settings?  Like the JDBC  
URL?   I just recall that in my previous code perusals, correct me if  
I'm off base.

	Erik


Re: DIH - read datasource param values from property file or configure JNDI datasource

Posted by Fergus McMenemie <fe...@twig.me.uk>.
>I am looking for a implementation of DIH feature: It also takes in a properties file for the data source configuration (http://issues.apache.org/jira/browse/SOLR-469)
>
>I want to externalize the data source parameters like driver, url, user and password to property file outside the solr. My aim to hide the parameters from developer code in Production environment. So that admin can enter these values.
>
>Or else can DIH read JNDI data source from server environment.
>
>Let me know the best practice to follow in production environment?
>
>Thanks
>Shyamsunder
>

This is an idea rather than a recommendation.

But, as per the DIH FAQ, you can pass in extra arguments on the URL
used to invoke DIH and use these arguments within data-config.xml.
Not too sure the extent they can be used with the various dataSource's.
But  if you are happy to pass the information in via the URL or even 
solconfig.xml then this may the route to go down.

Fergus.
-- 

Re: DIH - read datasource param values from property file or configure JNDI datasource

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Thu, Mar 19, 2009 at 9:39 PM, Shyamsunder Reddy <sj...@yahoo.com> wrote:

>
> I am looking for a implementation of DIH feature: It also takes in a
> properties file for the data source configuration (
> http://issues.apache.org/jira/browse/SOLR-469)
>
> I want to externalize the data source parameters like driver, url, user and
> password to property file outside the solr. My aim to hide the parameters
> from developer code in Production environment. So that admin can enter these
> values.
>
> Or else can DIH read JNDI data source from server environment.
>
> Let me know the best practice to follow in production environment?
>

There's an issue open for JNDI support with a patch. Look at
https://issues.apache.org/jira/browse/SOLR-1058

Fergus's suggestion also applies.
-- 
Regards,
Shalin Shekhar Mangar.