-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Service Wrapper: A Java Service Wrapper integration, closes #154.
- Loading branch information
Showing
37 changed files
with
1,539 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
@echo off | ||
setlocal | ||
|
||
rem Java Service Wrapper command based script. | ||
|
||
rem ----------------------------------------------------------------------------- | ||
rem These settings can be modified to fit the needs of your application | ||
rem Optimized for use with version 3.4.0 of the Wrapper. | ||
|
||
rem SET ES_HOME | ||
set ES_HOME=%~dp0\..\.. | ||
|
||
rem The base name for the Wrapper binary. | ||
set _WRAPPER_BASE=\exec\elasticsearch | ||
|
||
rem The name and location of the Wrapper configuration file. | ||
rem (Do not remove quotes.) | ||
set _WRAPPER_CONF="..\elasticsearch.conf" | ||
|
||
rem Do not modify anything beyond this point | ||
rem ----------------------------------------------------------------------------- | ||
|
||
if "%OS%"=="Windows_NT" goto nt | ||
echo This script only works with NT-based versions of Windows. | ||
goto :eof | ||
|
||
:nt | ||
rem Find the application home. | ||
rem %~dp0 is location of current script under NT | ||
set _REALPATH=%~dp0 | ||
|
||
rem | ||
rem Decide on the specific Wrapper binary to use (See delta-pack) | ||
rem | ||
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 | ||
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 | ||
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe | ||
goto search | ||
:amd64 | ||
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe | ||
goto search | ||
:ia64 | ||
set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe | ||
goto search | ||
:search | ||
set _WRAPPER_EXE=%_WRAPPER_L_EXE% | ||
if exist "%_WRAPPER_EXE%" goto validate | ||
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe | ||
if exist "%_WRAPPER_EXE%" goto validate | ||
echo Unable to locate a Wrapper executable using any of the following names: | ||
echo %_WRAPPER_L_EXE% | ||
echo %_WRAPPER_EXE% | ||
pause | ||
goto :eof | ||
|
||
:validate | ||
rem | ||
rem Find the requested command. | ||
rem | ||
for /F %%v in ('echo %1^|findstr "^console$ ^start$ ^pause$ ^resume$ ^stop$ ^restart$ ^install$ ^remove$"') do call :exec set COMMAND=%%v | ||
|
||
if "%COMMAND%" == "" ( | ||
echo Usage: %0 { console : start : pause : resume : stop : restart : install : remove } | ||
pause | ||
goto :eof | ||
) else ( | ||
shift | ||
) | ||
|
||
rem | ||
rem Run the application. | ||
rem At runtime, the current directory will be that of wrapper.exe | ||
rem | ||
call :%COMMAND% | ||
if errorlevel 1 goto callerror | ||
goto :eof | ||
|
||
:callerror | ||
echo An error occurred in the process. | ||
pause | ||
goto :eof | ||
|
||
:console | ||
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF% | ||
goto :eof | ||
|
||
:start | ||
"%_WRAPPER_EXE%" -t %_WRAPPER_CONF% | ||
goto :eof | ||
|
||
:pause | ||
"%_WRAPPER_EXE%" -a %_WRAPPER_CONF% | ||
goto :eof | ||
|
||
:resume | ||
"%_WRAPPER_EXE%" -e %_WRAPPER_CONF% | ||
goto :eof | ||
|
||
:stop | ||
"%_WRAPPER_EXE%" -p %_WRAPPER_CONF% | ||
goto :eof | ||
|
||
:install | ||
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF% | ||
goto :eof | ||
|
||
:remove | ||
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF% | ||
goto :eof | ||
|
||
:restart | ||
call :stop | ||
call :start | ||
goto :eof | ||
|
||
:exec | ||
%* | ||
goto :eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
set.default.ES_HOME=<Path to ElasticSearch Home> | ||
|
||
#******************************************************************** | ||
# Wrapper Timeout Properties | ||
#******************************************************************** | ||
# How long to wait for the JVM to start (in seconds) | ||
wrapper.startup.timeout=300 | ||
# How long to wait for the JVM to stop (in seconds) | ||
wrapper.shutdown.timeout=300 | ||
# When a ping will timeout to consider the JVM hung (in seconds) | ||
wrapper.ping.timeout=300 | ||
|
||
#******************************************************************** | ||
# Wrapper Java Properties | ||
#******************************************************************** | ||
# Java Application | ||
wrapper.java.command=java | ||
|
||
# Tell the Wrapper to log the full generated Java command line. | ||
#wrapper.java.command.loglevel=INFO | ||
|
||
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp | ||
|
||
wrapper.working.dir=%ES_HOME% | ||
|
||
# Java Classpath (include wrapper.jar) Add class path elements as | ||
# needed starting from 1 | ||
wrapper.java.classpath.1=%ES_HOME%/bin/service/lib/wrapper.jar | ||
wrapper.java.classpath.2=%ES_HOME%/lib/*.jar | ||
|
||
# Java Library Path (location of Wrapper.DLL or libwrapper.so) | ||
wrapper.java.library.path.1=%ES_HOME%/bin/service/lib | ||
|
||
# Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode. | ||
wrapper.java.additional.auto_bits=TRUE | ||
|
||
# Java Additional Parameters | ||
wrapper.java.additional.1=-Delasticsearch-service | ||
wrapper.java.additional.2=-Des-foreground=yes | ||
wrapper.java.additional.3=-Des.path.home=%ES_HOME% | ||
wrapper.java.additional.4=-Djline.enabled=true | ||
wrapper.java.additional.5=-XX:+AggressiveOpts | ||
wrapper.java.additional.6=-XX:+UseParNewGC | ||
wrapper.java.additional.7=-XX:+UseConcMarkSweepGC | ||
wrapper.java.additional.8=-XX:+CMSParallelRemarkEnabled | ||
wrapper.java.additional.9=-XX:+HeapDumpOnOutOfMemoryError | ||
|
||
# Initial Java Heap Size (in MB) | ||
wrapper.java.initmemory=128 | ||
|
||
# Maximum Java Heap Size (in MB) | ||
wrapper.java.maxmemory=1024 | ||
|
||
# Application parameters. Add parameters as needed starting from 1 | ||
wrapper.app.parameter.1=org.elasticsearch.bootstrap.Bootstrap | ||
|
||
#******************************************************************** | ||
# Wrapper Logging Properties | ||
#******************************************************************** | ||
# Enables Debug output from the Wrapper. | ||
# wrapper.debug=TRUE | ||
|
||
# Format of output for the console. (See docs for formats) | ||
wrapper.console.format=PM | ||
|
||
# Log Level for console output. (See docs for log levels) | ||
wrapper.console.loglevel=INFO | ||
|
||
# Log file to use for wrapper output logging. | ||
wrapper.logfile=%ES_HOME%/work/logs/service.log | ||
|
||
# Format of output for the log file. (See docs for formats) | ||
wrapper.logfile.format=LPTM | ||
|
||
# Log Level for log file output. (See docs for log levels) | ||
wrapper.logfile.loglevel=INFO | ||
|
||
# Maximum size that the log file will be allowed to grow to before | ||
# the log is rolled. Size is specified in bytes. The default value | ||
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or | ||
# 'm' (mb) suffix. For example: 10m = 10 megabytes. | ||
wrapper.logfile.maxsize=0 | ||
|
||
# Maximum number of rolled log files which will be allowed before old | ||
# files are deleted. The default value of 0 implies no limit. | ||
wrapper.logfile.maxfiles=0 | ||
|
||
# Log Level for sys/event log output. (See docs for log levels) | ||
wrapper.syslog.loglevel=NONE | ||
|
||
#******************************************************************** | ||
# Wrapper General Properties | ||
#******************************************************************** | ||
# Allow for the use of non-contiguous numbered properties | ||
wrapper.ignore_sequence_gaps=TRUE | ||
|
||
# Title to use when running as a console | ||
wrapper.console.title=ElasticSearch | ||
|
||
#******************************************************************** | ||
# Wrapper Windows NT/2000/XP Service Properties | ||
#******************************************************************** | ||
# WARNING - Do not modify any of these properties when an application | ||
# using this configuration file has been installed as a service. | ||
# Please uninstall the service before modifying this section. The | ||
# service can then be reinstalled. | ||
|
||
# Name of the service | ||
wrapper.name=ElasticSearch | ||
|
||
# Display name of the service | ||
wrapper.displayname=ElasticSearch | ||
|
||
# Description of the service | ||
wrapper.description=Open Source, Distributed, RESTful Search Engine | ||
|
||
# Service dependencies. Add dependencies as needed starting from 1 | ||
wrapper.ntservice.dependency.1= | ||
|
||
# Mode in which the service is installed. AUTO_START, DELAY_START or DEMAND_START | ||
wrapper.ntservice.starttype=AUTO_START | ||
|
||
# Allow the service to interact with the desktop. | ||
wrapper.ntservice.interactive=false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! /bin/sh | ||
|
||
export DIST_BITS="32" | ||
`dirname $0`/elasticsearch $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! /bin/sh | ||
|
||
export DIST_BITS="64" | ||
`dirname $0`/elasticsearch $1 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters