SMF: Solr
Setting up Solr was a bit different then the others. Solr’s distribution is multifaceted, containing multiple server examples, client code, as well as, a simple production ready server. So let me start off with a few steps I took in setting up Solr.
- Download and extract latest binary from solr website.
- Within solr folder is examples/
- Remove example-DIH/
- Remove exampledocs/
- Create directory /opt/local/share/solr-VERSION (solr-1.4 at time of this writing)
- Copy contents of examples to /opt/local/share/solr-VERSION
- Create a symlink /opt/local/share/solr-VERSION -> solr
And here is the SMF:
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <service_bundle type='manifest' name='Solr'> <service name='network/solr' type='service' version='1'> <create_default_instance enabled='false'/> <single_instance/> <dependency name='fs' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local'/> </dependency> <dependency name='net' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/loopback'/> </dependency> <dependent name='solr_multi-user' grouping='optional_all' restart_on='none'> <service_fmri value='svc:/milestone/multi-user'/> </dependent> <exec_method name='start' type='method' exec='/opt/local/lib/svc/method/svc-solr' timeout_seconds='60'> <method_context working_directory='/opt/local/share/solr'> <method_credential user='root' group='root' /> </method_context> </exec_method> <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'> </exec_method> <template> <common_name> <loctext xml:lang='C'> solr </loctext> </common_name> </template> </service> </service_bundle>
And the very short script it calls to start Solr:
svc-solr:
#!/bin/sh nohup java -Dsolr.data.dir=/opt/local/share/solr/data -jar start.jar &
That’s about it.
No comments yet, be the first.