solr jetty #7

Supports: precise
Add to new model

Description

Solr is an open source enterprise search server based on the Lucene Java
search library, with XML/HTTP and JSON APIs, hit highlighting, faceted
search, caching, replication, and a web administration interface. It
runs in a Java servlet container such as Tomcat. This package
provides the Jetty integration files for Solr.


Juju charm solr-jetty

Solr is an open source enterprise search server based on the Lucene Java
search library, with XML/HTTP and JSON APIs, hit highlighting, faceted
search, caching, replication, and a web administration interface. This
charm deploys Solr in the Java servlet container Jetty.

This charm is designed to be deployed as the backend to a second charm,
its interface should not be exposed directly as there are no controls over
who can update the stored data.

How to deploy the charm

juju deploy solr-jetty

How to configure the charm

Load custom solr schema

juju set solr-jetty "schema=$(base64 < my-schema.xml)"

Set number of Jetty acceptors

juju set solr-jetty "acceptors=20"

Explicitly set JVM min heap and max heap size

juju set solr-jetty java-min-heap-mb=256 java-max-heap-mb=512

Loading the example mem.xml from apache-solr-1.4.1.tgz

curl http://:8080/solr/update --data-binary @mem.xml -H 'Content-type:text/xml; charset=utf-8'
curl http://:8080/solr/update --data-binary '' -H 'Content-type:text/xml; charset=utf-8'

... and querying it

curl http://:8080/solr/select?q=memory

Example:

Define schema

echo '<?xml version="1.0" encoding="UTF-8" ?>












<fields>
    <field name="id" type="string" indexed="true" stored="true" required="true" /> 
    <field name="name" type="string" indexed="true" stored="true"/>
    <field name="description" type="textgen" indexed="true" stored="true" default="" /> 
</fields>

<uniqueKey>id</uniqueKey>
<defaultSearchField>description</defaultSearchField>

' > snack-schema.xml

Load schema

juju set solr-jetty "schema=$(base64 < snack-schema.xml)"

Define data

echo '

1
Chococapers
Delicious caper flavoured chocolate snack


2
Chillimilk
All the goodness of milk with a chilli twist


3
Caperyogurt
Thick yogurt infused with caper goodness

' > snack-data.xml

Loading the snack data

curl http://:8080/solr/update --data-binary @snack-data.xml -H 'Content-type:text/xml; charset=utf-8'
curl http://:8080/solr/update --data-binary '' -H 'Content-type:text/xml; charset=utf-8'

You're craving capers but what snack will satisfy you?

curl 'http://:8080/solr/select?q=caper'


Configuration

acceptors
(int) The number of threads dedicated to accepting incoming connections.
check_regex
(string) Health check regex on output from check_url
check_url
(string) Health check URL
instance_type
(string) Instance type. Used by nrpe-external-master. i.e. production or staging
production
java-max-heap-mb
(int) Java options Max heap size (-Xmx)
java-min-heap-mb
(int) Java options min heap size (-Xms)
nagios_context
(string) Staging or Production. Used by nrpe-external-master.
nagios_service_group
(string) Name of nagios service group. Used by nrpe-external-master.
schema
(string) Solr XML schema (base64 encoded).
volume-ephemeral
(boolean) If false, the /var/lib/solr will be symlinked to persistent storage. A configure-error state will be raised if volume-map[$JUJU_UNIT_NAME] is not set (see "volume-map" below). If true, solr-jetty will run from its default directory /var/lib/solr/. All data will be destroyed with the instance. Note volumes require charmsupport to be installed
True
volume-map
(string) YAML map as e.g. "{ solr-jetty/0: /dev/vdb, solr-jetty/1: /dev/vdb}". Service units will raise a configure-error if volume-persistent is 'true' and no volume-map value is set. Use 'juju set' to set a value and 'juju resolved' to complete configuration.
{}