Adrian,

Do you know if this script creates a config file somewhere? Would it be
possible/helpful to have a script in Solr's /bin to run it as a service?

e.g.:

bin\install_solr_service.cmd 

It would assume these defaults: 
   -nssm "c:\Program Files\nssm\win64\nssm"
   -servicename "Solr"
   -start true

The rest of the parameters would be the same as bin\solr.cmd

It would, behind the scenes, run:

nssm install Solr bin/solr.cmd -f %*
nssm set Solr AppDirectory .

And possibly:

nssm start Solr

I don't have a Windows setup to try this on right now, but I'd like to
see such a script inside the bin/ directory.

Would this work?

Upayavira

On Tue, Jul 14, 2015, at 02:53 AM, Adrian Liew wrote:
> Hi Edwin,
> 
> Sorry for the late reply. Was caught up yesterday. 
> 
> Yes I did not use the start.jar command and followed this article using
> solr.cmd -
> http://www.norconex.com/how-to-run-solr5-as-a-service-on-windows/. I am
> using a Windows Server 2012 R2 Server.
> 
> The article example shows that it passes the start -f -p 8983 as
> arguments to the service. I believe it is important to have the -f. Did
> you try this example?
> 
> If it didn't work for you, have you tried to remove the service via nssm
> and add it again? 
> 
> Best regards,
> Adrian
> 
> 
> -----Original Message-----
> From: Zheng Lin Edwin Yeo [mailto:edwinye...@gmail.com] 
> Sent: Monday, July 13, 2015 10:51 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Running Solr 5.2.1 on WIndows using NSSM
> 
> Hi Adrian,
> 
> I got this to work for Solr 5.1, but when I tried this in Solr 5.2.1, it
> gives the error "Windows could not start the solr5.2.1 service on Local
> Computer. The service did not return an error. This could be an internal
> Windows error or an internal service error."
> 
> As Solr 5.2.1 is not using the start.jar command to run Solr, are we
> still able to use the same arguments to set up the nssm?
> 
> Regards,
> Edwin
> 
> 
> On 8 July 2015 at 17:38, Adrian Liew <adrian.l...@avanade.com> wrote:
> 
> > Answered my own question. :) It seems to work great for me by 
> > following this article.
> >
> > http://www.norconex.com/how-to-run-solr5-as-a-service-on-windows/
> >
> > Regards,
> > Adrian
> >
> > -----Original Message-----
> > From: Adrian Liew [mailto:adrian.l...@avanade.com]
> > Sent: Wednesday, July 8, 2015 4:43 PM
> > To: solr-user@lucene.apache.org
> > Subject: Running Solr 5.2.1 on WIndows using NSSM
> >
> > Hi guys,
> >
> > I am looking to run Apache Solr v5.2.1 on a windows machine. I tried 
> > to setup a windows service using NSSM (Non-Sucking-Service-Manager) to 
> > install the windows service on the machine pointing to the solr.cmd 
> > file path itself and installing the service.
> >
> > After installation, I tried to start the windows service but it gives 
> > back an alert message. It says \Windows could not start the 
> > SolrService service on Local Computer. The service  did not return an 
> > error. This could be an internal Windows error or an internal service error.
> >
> > Most of the examples of older Apache Solr uses the java -start 
> > start.jar command to run Solr and seem to run okay with nssm. I am not 
> > sure if this could be the solr.cmd issue or NSSM's issue.
> >
> > Alternatively, I have tried to use Windows Task Scheduler to configure 
> > a task to point to the solr.cmd as well and run task whenever the 
> > computer starts (regardless a user is logged in or not). The task 
> > scheduler seems to report back 'Task Start Failed' with Level of 'Error'.
> >
> > Additionally, after checking Event Viewer, it returns the error with 
> > nssm Failed to open process handle for process with PID 3640 when 
> > terminating service Solr Service : The parameter is incorrect.
> >
> > Chances this can point back to the solr.cmd file itself.
> >
> > Thoughts?
> >
> > Regards,
> > Adrian
> >
> >

Reply via email to