diff --git a/README.md b/README.md index 13e9c97..6f8e89a 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,26 @@ -OpenShift ElasticSearch Cartridge -================================= -Downloadable ElasticSearch cartridge for OpenShift. - -To create your scalable ElasticSearch app, run: - - rhc app create http://cartreflect-claytondev.rhcloud.com/github/ncdc/openshift-elasticsearch-cartridge -s - -**NOTE:** your app currently must be a scalable app or this cartridge will not run. - - -Adding additional cluster nodes -=============================== -To add more nodes to the cluster, simply add more gears: - - rhc cartridge scale -a elasticsearch - - -Plugins -======= -To install ElasticSearch plugins, edit the `plugins.txt` file, commit, and push your changes. - - -License -======= -This project is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). +OpenShift ElasticSearch Cartridge +================================= +Downloadable ElasticSearch cartridge for OpenShift. + +To create your scalable ElasticSearch app, run: + + rhc app create http://cartreflect-claytondev.rhcloud.com/github/ncdc/openshift-elasticsearch-cartridge -s + +**NOTE:** your app currently must be a scalable app or this cartridge will not run. + + +Adding additional cluster nodes +=============================== +To add more nodes to the cluster, simply add more gears: + + rhc cartridge scale -a elasticsearch + + +Plugins +======= +To install ElasticSearch plugins, edit the `plugins.txt` file, commit, and push your changes. + + +License +======= +This project is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). diff --git a/bin/control b/bin/control index 9a64be0..d9eefd9 100755 --- a/bin/control +++ b/bin/control @@ -53,7 +53,7 @@ function start() { export PUBLISH_HOST=$(python -c "import socket; print socket.gethostbyname('$OPENSHIFT_GEAR_DNS')") - $OPENSHIFT_ELASTICSEARCH_DIR/usr/bin/elasticsearch -p $PID_FILE + $OPENSHIFT_ELASTICSEARCH_DIR/usr/bin/elasticsearch -d -p $PID_FILE } function stop() { diff --git a/env/ELASTICSEARCH_VERSION b/env/ELASTICSEARCH_VERSION index 2ea9377..524cb55 100644 --- a/env/ELASTICSEARCH_VERSION +++ b/env/ELASTICSEARCH_VERSION @@ -1 +1 @@ -0.90.11 +1.1.1 diff --git a/metadata/manifest.yml b/metadata/manifest.yml index 8c49883..8b21368 100644 --- a/metadata/manifest.yml +++ b/metadata/manifest.yml @@ -1,6 +1,6 @@ Name: elasticsearch Cartridge-Short-Name: ELASTICSEARCH -Display-Name: ElasticSearch 0.90.11 +Display-Name: ElasticSearch 1.1.1 Description: "ElasticSearch" Version: 1.0.0 License: Apache @@ -14,7 +14,7 @@ Categories: Provides: - elasticsearch - - elasticsearch-0.90.11 + - elasticsearch-1.1.1 Publishes: publish-unicast-host: diff --git a/usr/bin/elasticsearch b/usr/bin/elasticsearch index 7a7e01c..805e01d 100755 --- a/usr/bin/elasticsearch +++ b/usr/bin/elasticsearch @@ -1,7 +1,7 @@ #!/bin/sh # OPTIONS: -# -f: start in the foreground +# -d: daemonize, start in the background # -p : log the pid to a file (useful to kill it later) # CONTROLLING STARTUP: @@ -46,6 +46,20 @@ # Be aware that you will be entirely responsible for populating the needed # environment variables. + +# Maven will replace the project.name with elasticsearch below. If that +# hasn't been done, we assume that this is not a packaged version and the +# user has forgotten to run Maven to create a package. +IS_PACKAGED_VERSION='elasticsearch' +if [ "$IS_PACKAGED_VERSION" != "elasticsearch" ]; then + cat >&2 << EOF +Error: You must build the project with Maven or download a pre-built package +before you can run Elasticsearch. See 'Building from Source' in README.textile +or visit http://www.elasticsearch.org/download to get a pre-built package. +EOF + exit 1 +fi + CDPATH="" SCRIPT="$0" @@ -89,7 +103,7 @@ fi if [ -x "$JAVA_HOME/bin/java" ]; then JAVA="$JAVA_HOME/bin/java" else - JAVA=$(which java) + JAVA=`which java` fi if [ ! -x "$JAVA" ]; then @@ -113,7 +127,7 @@ esac launch_service() { pidpath=$1 - foreground=$2 + daemonized=$2 props=$3 es_parms="-Delasticsearch" @@ -123,27 +137,39 @@ launch_service() es_parms="$es_parms -Des.pidfile=$pidpath" fi - if [ "${ELASTICSEARCH_VERSION%%.*}" == '1' ]; then - class_name=org.elasticsearch.bootstrap.Elasticsearch - else - class_name=org.elasticsearch.bootstrap.ElasticSearch - fi - - # The es-foreground option will tell ElasticSearch not to close stdout/stderr, but it's up to us not to background. - if [ "x$foreground" != "x" ]; then + # The es-foreground option will tell Elasticsearch not to close stdout/stderr, but it's up to us not to daemonize. + if [ "x$daemonized" = "x" ]; then es_parms="$es_parms -Des.foreground=yes" - exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props $class_name + exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \ + org.elasticsearch.bootstrap.Elasticsearch # exec without running it in the background, makes it replace this shell, we'll never get here... # no need to return something else - # Startup ElasticSearch, background it, and write the pid. - exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props $class_name <&- & + # Startup Elasticsearch, background it, and write the pid. + exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \ + org.elasticsearch.bootstrap.Elasticsearch <&- & return $? fi } +# Parse any long getopt options and put them into properties before calling getopt below +# Be dash compatible to make sure running under ubuntu works +ARGV="" +while [ $# -gt 0 ] +do + case $1 in + --*=*) properties="$properties -Des.${1#--}" + shift 1 + ;; + --*) properties="$properties -Des.${1#--}=$2" + shift 2 + ;; + *) ARGV="$ARGV $1" ; shift + esac +done + # Parse any command line options. -args=`getopt vfhp:D:X: "$@"` +args=`getopt vdhp:D:X: $ARGV` eval set -- "$args" while true; do @@ -157,12 +183,12 @@ while true; do pidfile="$2" shift 2 ;; - -f) - foreground="yes" + -d) + daemonized="yes" shift ;; -h) - echo "Usage: $0 [-f] [-h] [-p pidfile]" + echo "Usage: $0 [-d] [-h] [-p pidfile]" exit 0 ;; -D) @@ -185,6 +211,6 @@ while true; do done # Start up the service -launch_service "$pidfile" "$foreground" "$properties" +launch_service "$pidfile" "$daemonized" "$properties" exit $? diff --git a/usr/bin/elasticsearch.in.sh b/usr/bin/elasticsearch.in.sh index 7b01030..cd8f8d5 100755 --- a/usr/bin/elasticsearch.in.sh +++ b/usr/bin/elasticsearch.in.sh @@ -1,6 +1,6 @@ #!/bin/sh -ES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/elasticsearch-*.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/* +ES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/elasticsearch-1.1.1.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/* if [ "x$ES_MIN_MEM" = "x" ]; then ES_MIN_MEM=256m diff --git a/usr/bin/plugin b/usr/bin/plugin index 1cabad2..a8c796a 100755 --- a/usr/bin/plugin +++ b/usr/bin/plugin @@ -46,4 +46,3 @@ while [ $# -gt 0 ]; do done exec $JAVA $JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginManager $args - diff --git a/usr/lib/elasticsearch-0.90.11.jar b/usr/lib/elasticsearch-1.1.1.jar similarity index 64% rename from usr/lib/elasticsearch-0.90.11.jar rename to usr/lib/elasticsearch-1.1.1.jar index 49a4be8..100c9ee 100644 Binary files a/usr/lib/elasticsearch-0.90.11.jar and b/usr/lib/elasticsearch-1.1.1.jar differ diff --git a/usr/lib/jts-1.12.jar b/usr/lib/jts-1.12.jar deleted file mode 100644 index 1941da5..0000000 Binary files a/usr/lib/jts-1.12.jar and /dev/null differ diff --git a/usr/lib/jts-1.13.jar b/usr/lib/jts-1.13.jar new file mode 100644 index 0000000..bbaa20b Binary files /dev/null and b/usr/lib/jts-1.13.jar differ diff --git a/usr/lib/lucene-analyzers-common-4.6.1.jar b/usr/lib/lucene-analyzers-common-4.7.2.jar similarity index 80% rename from usr/lib/lucene-analyzers-common-4.6.1.jar rename to usr/lib/lucene-analyzers-common-4.7.2.jar index 81ee7fb..be62643 100644 Binary files a/usr/lib/lucene-analyzers-common-4.6.1.jar and b/usr/lib/lucene-analyzers-common-4.7.2.jar differ diff --git a/usr/lib/lucene-codecs-4.6.1.jar b/usr/lib/lucene-codecs-4.7.2.jar similarity index 56% rename from usr/lib/lucene-codecs-4.6.1.jar rename to usr/lib/lucene-codecs-4.7.2.jar index 8090921..502df56 100644 Binary files a/usr/lib/lucene-codecs-4.6.1.jar and b/usr/lib/lucene-codecs-4.7.2.jar differ diff --git a/usr/lib/lucene-core-4.6.1.jar b/usr/lib/lucene-core-4.7.2.jar similarity index 65% rename from usr/lib/lucene-core-4.6.1.jar rename to usr/lib/lucene-core-4.7.2.jar index b987497..a44674d 100644 Binary files a/usr/lib/lucene-core-4.6.1.jar and b/usr/lib/lucene-core-4.7.2.jar differ diff --git a/usr/lib/lucene-grouping-4.6.1.jar b/usr/lib/lucene-grouping-4.7.2.jar similarity index 81% rename from usr/lib/lucene-grouping-4.6.1.jar rename to usr/lib/lucene-grouping-4.7.2.jar index 2350f68..e7206f9 100644 Binary files a/usr/lib/lucene-grouping-4.6.1.jar and b/usr/lib/lucene-grouping-4.7.2.jar differ diff --git a/usr/lib/lucene-highlighter-4.6.1.jar b/usr/lib/lucene-highlighter-4.7.2.jar similarity index 53% rename from usr/lib/lucene-highlighter-4.6.1.jar rename to usr/lib/lucene-highlighter-4.7.2.jar index 107ea71..df6548f 100644 Binary files a/usr/lib/lucene-highlighter-4.6.1.jar and b/usr/lib/lucene-highlighter-4.7.2.jar differ diff --git a/usr/lib/lucene-join-4.6.1.jar b/usr/lib/lucene-join-4.7.2.jar similarity index 69% rename from usr/lib/lucene-join-4.6.1.jar rename to usr/lib/lucene-join-4.7.2.jar index a65827f..014f4c4 100644 Binary files a/usr/lib/lucene-join-4.6.1.jar and b/usr/lib/lucene-join-4.7.2.jar differ diff --git a/usr/lib/lucene-memory-4.6.1.jar b/usr/lib/lucene-memory-4.6.1.jar deleted file mode 100644 index 5a30c45..0000000 Binary files a/usr/lib/lucene-memory-4.6.1.jar and /dev/null differ diff --git a/usr/lib/lucene-memory-4.7.2.jar b/usr/lib/lucene-memory-4.7.2.jar new file mode 100644 index 0000000..fda0021 Binary files /dev/null and b/usr/lib/lucene-memory-4.7.2.jar differ diff --git a/usr/lib/lucene-misc-4.6.1.jar b/usr/lib/lucene-misc-4.7.2.jar similarity index 72% rename from usr/lib/lucene-misc-4.6.1.jar rename to usr/lib/lucene-misc-4.7.2.jar index d8af447..5241141 100644 Binary files a/usr/lib/lucene-misc-4.6.1.jar and b/usr/lib/lucene-misc-4.7.2.jar differ diff --git a/usr/lib/lucene-queries-4.6.1.jar b/usr/lib/lucene-queries-4.7.2.jar similarity index 53% rename from usr/lib/lucene-queries-4.6.1.jar rename to usr/lib/lucene-queries-4.7.2.jar index 2268733..0f72a66 100644 Binary files a/usr/lib/lucene-queries-4.6.1.jar and b/usr/lib/lucene-queries-4.7.2.jar differ diff --git a/usr/lib/lucene-queryparser-4.6.1.jar b/usr/lib/lucene-queryparser-4.7.2.jar similarity index 82% rename from usr/lib/lucene-queryparser-4.6.1.jar rename to usr/lib/lucene-queryparser-4.7.2.jar index 7b9ed99..0e00a0e 100644 Binary files a/usr/lib/lucene-queryparser-4.6.1.jar and b/usr/lib/lucene-queryparser-4.7.2.jar differ diff --git a/usr/lib/lucene-sandbox-4.6.1.jar b/usr/lib/lucene-sandbox-4.7.2.jar similarity index 76% rename from usr/lib/lucene-sandbox-4.6.1.jar rename to usr/lib/lucene-sandbox-4.7.2.jar index 5075049..264a7cc 100644 Binary files a/usr/lib/lucene-sandbox-4.6.1.jar and b/usr/lib/lucene-sandbox-4.7.2.jar differ diff --git a/usr/lib/lucene-spatial-4.6.1.jar b/usr/lib/lucene-spatial-4.7.2.jar similarity index 62% rename from usr/lib/lucene-spatial-4.6.1.jar rename to usr/lib/lucene-spatial-4.7.2.jar index 6a50333..a70c0d6 100644 Binary files a/usr/lib/lucene-spatial-4.6.1.jar and b/usr/lib/lucene-spatial-4.7.2.jar differ diff --git a/usr/lib/lucene-suggest-4.6.1.jar b/usr/lib/lucene-suggest-4.6.1.jar deleted file mode 100644 index 988df08..0000000 Binary files a/usr/lib/lucene-suggest-4.6.1.jar and /dev/null differ diff --git a/usr/lib/lucene-suggest-4.7.2.jar b/usr/lib/lucene-suggest-4.7.2.jar new file mode 100644 index 0000000..1b2865a Binary files /dev/null and b/usr/lib/lucene-suggest-4.7.2.jar differ diff --git a/usr/lib/sigar/libsigar-amd64-freebsd-6.so b/usr/lib/sigar/libsigar-amd64-freebsd-6.so new file mode 100644 index 0000000..3e94f0d Binary files /dev/null and b/usr/lib/sigar/libsigar-amd64-freebsd-6.so differ diff --git a/usr/lib/sigar/libsigar-amd64-solaris.so b/usr/lib/sigar/libsigar-amd64-solaris.so new file mode 100644 index 0000000..6396482 Binary files /dev/null and b/usr/lib/sigar/libsigar-amd64-solaris.so differ diff --git a/usr/lib/sigar/libsigar-sparc-solaris.so b/usr/lib/sigar/libsigar-sparc-solaris.so new file mode 100644 index 0000000..aa847d2 Binary files /dev/null and b/usr/lib/sigar/libsigar-sparc-solaris.so differ diff --git a/usr/lib/sigar/libsigar-sparc64-solaris.so b/usr/lib/sigar/libsigar-sparc64-solaris.so new file mode 100644 index 0000000..6c4fe80 Binary files /dev/null and b/usr/lib/sigar/libsigar-sparc64-solaris.so differ diff --git a/usr/lib/sigar/libsigar-universal-macosx.dylib b/usr/lib/sigar/libsigar-universal-macosx.dylib new file mode 100644 index 0000000..27ab107 Binary files /dev/null and b/usr/lib/sigar/libsigar-universal-macosx.dylib differ diff --git a/usr/lib/sigar/libsigar-universal64-macosx.dylib b/usr/lib/sigar/libsigar-universal64-macosx.dylib new file mode 100644 index 0000000..0c721fe Binary files /dev/null and b/usr/lib/sigar/libsigar-universal64-macosx.dylib differ diff --git a/usr/lib/sigar/libsigar-x86-freebsd-5.so b/usr/lib/sigar/libsigar-x86-freebsd-5.so new file mode 100644 index 0000000..8c50c61 Binary files /dev/null and b/usr/lib/sigar/libsigar-x86-freebsd-5.so differ diff --git a/usr/lib/sigar/libsigar-x86-freebsd-6.so b/usr/lib/sigar/libsigar-x86-freebsd-6.so new file mode 100644 index 0000000..f080027 Binary files /dev/null and b/usr/lib/sigar/libsigar-x86-freebsd-6.so differ diff --git a/usr/lib/sigar/libsigar-x86-solaris.so b/usr/lib/sigar/libsigar-x86-solaris.so new file mode 100644 index 0000000..c6452e5 Binary files /dev/null and b/usr/lib/sigar/libsigar-x86-solaris.so differ diff --git a/usr/lib/sigar/sigar-amd64-winnt.dll b/usr/lib/sigar/sigar-amd64-winnt.dll new file mode 100644 index 0000000..1ec8a03 Binary files /dev/null and b/usr/lib/sigar/sigar-amd64-winnt.dll differ diff --git a/usr/lib/sigar/sigar-x86-winnt.dll b/usr/lib/sigar/sigar-x86-winnt.dll new file mode 100644 index 0000000..6afdc01 Binary files /dev/null and b/usr/lib/sigar/sigar-x86-winnt.dll differ diff --git a/usr/lib/sigar/sigar-x86-winnt.lib b/usr/lib/sigar/sigar-x86-winnt.lib new file mode 100644 index 0000000..04924a1 Binary files /dev/null and b/usr/lib/sigar/sigar-x86-winnt.lib differ diff --git a/usr/lib/spatial4j-0.3.jar b/usr/lib/spatial4j-0.3.jar deleted file mode 100644 index 56f68b4..0000000 Binary files a/usr/lib/spatial4j-0.3.jar and /dev/null differ diff --git a/usr/lib/spatial4j-0.4.1.jar b/usr/lib/spatial4j-0.4.1.jar new file mode 100644 index 0000000..e62c0b4 Binary files /dev/null and b/usr/lib/spatial4j-0.4.1.jar differ