On 03/13/2010 09:07 PM, blargy wrote:
How are you guys solving the problem with managing all of your configuration
difference between development and production.
For example when deploying to production I need to change the
data-config.xml (DataImportHandler) database settings. I also have some ant
scripts to start/stop tomcat as well as symlinking a context docBase.
I was wondering if there were some way to interpolate variables in the
configuration files... similar to how you can in ant files... for example
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://${db.host}/${db.name}"
batchsize="-1"
readOnly="true"
user="${db.user}"
password="${db.password}"/>
Same question goes for all other Solr.xml files.. can I insert custom
variables?
You can do this for some files. I'm not seeing the ability with DIH though.
But for example, with solrconfig.xml, you can use properties like:
<dataDir>${solr.data.dir:/local/datadir}</dataDir>
ie ${propname:defaultvalue}
You can then specify the value either with a System property (eg
-Dname=value on the command line) or by adding a property node to
solr.xml eg
<solr persistent="false">
<property name="propName" value="propValue"/>
<property name="propName2" value="propValue2"/>
You can also include external xml snippets in solrconfig.xml:
http://wiki.apache.org/solr/SolrConfigXml?highlight=(xinclude)
<http://wiki.apache.org/solr/SolrConfigXml?highlight=%28xinclude%29>
I'm not really up on DIH, but it doesn't look to me like it supports
anything like this - you might open a feature request for it if this is
the case though.
--
- Mark
http://www.lucidimagination.com