UPDATE: As of Elasticsearch release 0.90.5, there is a default Windows service included in elastic search. So, instead of following this guide... upgrade!!!
Windows 2003 ServerThe steps outlined in this section involve editing the registry on your server. If you are not comfortable editing the registry then look elsewhere. See this article for information on backing up and restoring the registry.
- Download and extract Elasticsearch to C:\elasticsearch. Make sure you have a Java Runtime Environment (JRE) installed on your system and that you have the JAVA_HOME environment variable configured correctly on your machine and that you can actually get Elasticsearch running before continuing to the next step.
- We need srvany.exe on the machine. So, to get that, install Windows Resource Kits if it's not already installed (default installation is C:\Program Files\Windows Resource Kits)
- From a command prompt do the following:
cd "C:\Program Files\Windows Resource Kit\Tools"
instsrv.exe elasticsearch "C:\Program Files\Windows Resource Kits\Tools\srvany.exe"
- Now you should have the registry editor open. In the registry editor go to: HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services
- Find elasticsearch in the list and right-click on it. Choose New > Key and name the key Parameters
- Right-click on the Parameters key and choose New > String Value. Change the name of this value to Application.
- Right-click on the Application value and choose Modify, then in the Value data field enter C:\elasticsearch\bin\elasticsearch.bat
- Open the Services control panel (Start > Control Panel > Services) and find the elasticsearch service. You will notice that the service is by default set to start automatically when the system starts. Start the service.
Windows 2008 ServerAs I mentioned above, I didn't have a Windows 2008 Server license available to tinker with, but from what I can tell you can use the sc create command to achieve the same results. I would be interested to know if this works, so feel free to leave a comment and let me know what you find.
- Follow step 1 above
- From the command line type the following (note that the command should be all on one line):
sc create elasticsearch binpath=C:\elasticsearch\bin\elasticsearch.bat start=auto
- Follow step 8 above