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 Hugo Angel Rodriguez <Hu...@sas.com> on 2019/06/12 15:05:05 UTC
Is it possible configure a single data-config.xml file for all the
environments?
Hi
I need to configure a single data-config.xml file in solr for SAS AML 7.1. I have three environments: Development, quality and production, and you know the first lines in a data-config.xml file is for connection to a database (database name, database server, port, user, password, etc). According to this, is it possible to configure only one file (data.config.xml) that dinamically connects for each of the databases in all environments?
Thanks for all your answers
Best regards
Cordialmente,
Hugo Rodríguez Rodríguez
Sr Associate Technical Consultant | Professional Services
Tel: + (571) 658-0888 extensión 1858 ▪ hugoangel.rodriguez@sas.com<ma...@sas.com>
SAS Institute Colombia S.A.S. ▪ Calle 7 Sur No. 42- 70 Bloque 2 Oficina 916 Edificio Forum ▪ Medellin.
www.sas.com/colombia<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.sas.com%2Fcolombia&data=01%7C01%7Cejalzate%40bancolombia.com.co%7C24ddc22c16364075e42c08d48bde4b97%7Cb5e244bdc492495b8b1061bfd453e423%7C0&sdata=E0biJdCaGTQFEZ0ke0mKNrjRJYdeXuHz74kFBzsrWrg%3D&reserved=0> - Síganos en [cid:image001.png@01D2BDE9.074D45E0] <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fsas-colombia&data=01%7C01%7Cejalzate%40bancolombia.com.co%7C24ddc22c16364075e42c08d48bde4b97%7Cb5e244bdc492495b8b1061bfd453e423%7C0&sdata=dn1%2Bf8G7%2B0qHSES1YcUSTP6OeL5KxAoSgQT5ixIHCoU%3D&reserved=0> [cid:image002.png@01D2BDE9.074D45E0] <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FSas_Colombia&data=01%7C01%7Cejalzate%40bancolombia.com.co%7C24ddc22c16364075e42c08d48bde4b97%7Cb5e244bdc492495b8b1061bfd453e423%7C0&sdata=6Nej3TxX%2BdnJblCxXn2UjviWHbEEwlzgIlVlhqd%2FXJY%3D&reserved=0> [cid:image003.png@01D2BDE9.074D45E0] <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.youtube.com%2FSASSoftware&data=01%7C01%7Cejalzate%40bancolombia.com.co%7C24ddc22c16364075e42c08d48bde4b97%7Cb5e244bdc492495b8b1061bfd453e423%7C0&sdata=HjwrwmBOyv0KgSM8qZ%2Fn3oWInk9m4UoQlJhL7oRM5N8%3D&reserved=0>
[20-años-SAS-Opc-3]<http://www.sas.com/>
RE: Is it possible configure a single data-config.xml file for all
the environments?
Posted by Hugo Angel Rodriguez <Hu...@sas.com>.
Thank you very much for your response. Sorry I did not answer before. I am validating the suggestions indicated
Cordialmente,
Hugo Rodríguez Rodríguez
Sr Associate Technical Consultant | Professional Services
Tel: + (571) 658-0888 extensión 1858 ▪ hugoangel.rodriguez@sas.com
SAS Institute Colombia S.A.S. ▪ Calle 7 Sur No. 42- 70 Bloque 2 Oficina 916 Edificio Forum ▪ Medellin.
www.sas.com/colombia - Síganos en
-----Original Message-----
From: Shawn Heisey <ap...@elyograg.org>
Sent: Thursday, June 13, 2019 6:03 AM
To: solr-user@lucene.apache.org
Subject: Re: Is it possible configure a single data-config.xml file for all the environments?
EXTERNAL
On 6/12/2019 7:46 PM, Hugo Angel Rodriguez wrote:
> Thanks Shawn for your answers
>
> Regarding your question: " Are these environments on separate Solr instances, separate servers, or are they on the same Solr instance?"
> My answers is: These environments are on separate solr instances,
> separate servers
>
> Are we dealing with SolrCloud (which is Solr + ZooKeeper), or standalone Solr instances?
> We are dealing with standalone solr instances
I think JNDI is probably your best bet to have the same DIH config everywhere. The only documentation I can find about the JNDI method is on the Solr wiki. If it's still valid, we should get it in the ref guide.
https://wiki.apache.org/solr/DataImportHandlerFaq#How_do_I_use_a_JNDI_DataSource.3F
You define the JNDI datasource in Jetty, probably in jetty.xml, according to Jetty documentation ... and then reference the datasource name in the DIH config.
Here's an eclipse wiki page about setting up a JNDI datasource. I hope it's enough -- Jetty is not something I'm super familiar with:
https://wiki.eclipse.org/Jetty/Howto/Configure_JNDI_Datasource
I checked Solr's master codebase, and jndiName is still in the source code, so I think it should still work.
Thanks,
Shawn
Re: Is it possible configure a single data-config.xml file for all
the environments?
Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/12/2019 7:46 PM, Hugo Angel Rodriguez wrote:
> Thanks Shawn for your answers
>
> Regarding your question: " Are these environments on separate Solr instances, separate servers, or are they on the same Solr instance?"
> My answers is: These environments are on separate solr instances, separate servers
>
> Are we dealing with SolrCloud (which is Solr + ZooKeeper), or standalone Solr instances?
> We are dealing with standalone solr instances
I think JNDI is probably your best bet to have the same DIH config
everywhere. The only documentation I can find about the JNDI method is
on the Solr wiki. If it's still valid, we should get it in the ref guide.
https://wiki.apache.org/solr/DataImportHandlerFaq#How_do_I_use_a_JNDI_DataSource.3F
You define the JNDI datasource in Jetty, probably in jetty.xml,
according to Jetty documentation ... and then reference the datasource
name in the DIH config.
Here's an eclipse wiki page about setting up a JNDI datasource. I hope
it's enough -- Jetty is not something I'm super familiar with:
https://wiki.eclipse.org/Jetty/Howto/Configure_JNDI_Datasource
I checked Solr's master codebase, and jndiName is still in the source
code, so I think it should still work.
Thanks,
Shawn
RE: Is it possible configure a single data-config.xml file for all
the environments?
Posted by Hugo Angel Rodriguez <Hu...@sas.com>.
Thanks Shawn for your answers
Regarding your question: " Are these environments on separate Solr instances, separate servers, or are they on the same Solr instance?"
My answers is: These environments are on separate solr instances, separate servers
Are we dealing with SolrCloud (which is Solr + ZooKeeper), or standalone Solr instances?
We are dealing with standalone solr instances
Cordialmente,
Hugo Rodríguez Rodríguez
Sr Associate Technical Consultant | Professional Services
Tel: + (571) 658-0888 extensión 1858 ▪ hugoangel.rodriguez@sas.com
SAS Institute Colombia S.A.S. ▪ Calle 7 Sur No. 42- 70 Bloque 2 Oficina 916 Edificio Forum ▪ Medellin.
www.sas.com/colombia - Síganos en
-----Original Message-----
From: Shawn Heisey <ap...@elyograg.org>
Sent: Wednesday, June 12, 2019 5:23 PM
To: solr-user@lucene.apache.org
Subject: Re: Is it possible configure a single data-config.xml file for all the environments?
EXTERNAL
On 6/12/2019 9:05 AM, Hugo Angel Rodriguez wrote:
> I need to configure a single data-config.xml file in solr for SAS AML
> 7.1. I have three environments: Development, quality and production,
> and you know the first lines in a data-config.xml file is for
> connection to a database (database name, database server, port, user, password, etc).
> According to this, is it possible to configure only one file
> (data.config.xml) that dinamically connects for each of the databases
> in all environments?
Are these environments on separate Solr instances, separate servers, or are they on the same Solr instance?
If they're separate instances/servers, you could define the database with JNDI in Jetty (which is included and used to run Solr), and reference that JNDI definition by name in the DIH config in Solr. I do not know how to use JNDI, I just know that it is possible.
If they're all on the same Solr instance, then things are harder. You could define multiple JNDI settings in Jetty with each one named after the Solr core, and use ${solr.core.name} in the DIH config. Or you could pass information into DIH using URL parameters, and then you'd have to include the information every time you started an import.
Are we dealing with SolrCloud (which is Solr + ZooKeeper), or standalone Solr instances?
Thanks,
Shawn
Re: Is it possible configure a single data-config.xml file for all
the environments?
Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/12/2019 9:05 AM, Hugo Angel Rodriguez wrote:
> I need to configure a single data-config.xml file in solr for SAS AML
> 7.1. I have three environments: Development, quality and production, and
> you know the first lines in a data-config.xml file is for connection to
> a database (database name, database server, port, user, password, etc).
> According to this, is it possible to configure only one file
> (data.config.xml) that dinamically connects for each of the databases in
> all environments?
Are these environments on separate Solr instances, separate servers, or
are they on the same Solr instance?
If they're separate instances/servers, you could define the database
with JNDI in Jetty (which is included and used to run Solr), and
reference that JNDI definition by name in the DIH config in Solr. I do
not know how to use JNDI, I just know that it is possible.
If they're all on the same Solr instance, then things are harder. You
could define multiple JNDI settings in Jetty with each one named after
the Solr core, and use ${solr.core.name} in the DIH config. Or you
could pass information into DIH using URL parameters, and then you'd
have to include the information every time you started an import.
Are we dealing with SolrCloud (which is Solr + ZooKeeper), or standalone
Solr instances?
Thanks,
Shawn