4 Replies Latest reply on Feb 16, 2016 12:46 AM by Tejas Shah

    Infinispan Server as Windows Service

    Imtiaz Sattar Newbie

      Has anyone tried creating infinispan as windows service ?

       

      We are planning to use Infinispan under client/server model having .NET client accessing cache using Memcached protocol.

        • 1. Re: Infinispan Server as Windows Service
          Imtiaz Sattar Newbie

          Did some research and used open source java service wrapper: http://yajsw.sourceforge.net/

           

          It worked fine and was able to create service running on Windows 2012 R2.

          Just for information ...It's a two server development cluster running Infinispan on two VMs in Windows Azure Cloud.

          • 2. Re: Infinispan Server as Windows Service
            Tristan Tarrant Master

            If you could be so kind to describe the procedure or, even better, contribute with scripts/etc, that would be great !

            • 3. Re: Infinispan Server as Windows Service
              Imtiaz Sattar Newbie

              Installing Infinispan as Windows Service:

               

              Following are the steps to install Inifinispan as a Windows service. Pretty much all the instructions are from the wrapper website with few updates. Kudos to YAJSW team to make this wrapper available for the community.

               

              • Download YAJSW
              • Unpack the zip file to a folder <yajsw>.
              • Do not remove or copy files from this folder to any another folder. Do not rename any folders within <yajsw>. For this you may have to change the manifest in the jar files.
              • Call java -version and make sure that your default java installation is 1.5 or higher
              • If this is not the case make sure that java 1.5 or higher is installed and adapt the environment variable java_exe in bat/setenv.bat.
              • Start the application you would like to wrap. For example start ./clustered.bat to run Infinispan. Check the process id of your application (look in Task Manager/Process Details). NOTE: we need the pid of the application not the batch file which started the application.
              • Goto yajsw/bat folder and execute: 
                • genConfig.bat <pid>
                • This generates the file yajsw/conf/wrapper.conf which is the configuration file for wrapping your application
                • Stop your application (infinispan)
                • Open conf/wrapper.conf with a text editor and set the password for wrapper.app.password or comment out wrapper.app.account (#).
                • Update the values in wrapper.conf file as follow (choose your preferred service name, the auto generated name by wrapper is not going to work)

                                       # Name of the service
                                       wrapper.ntservice.name=infinispan_service


                                       # Display name of the service
                                       wrapper.ntservice.displayname=infinispan_service

                                       # Description of the service
                                       wrapper.ntservice.description=infinispan_service


              • Execute your wrapped application as console application by calling
                • runConsole.bat
                • check that your application (infinispan) is running. This will verify wrapper worked correctly.
              • To Install the application as service call
                • installService.bat
              • To start the service: (You can also start/stop from Services panel)
                • startService.bat
              • To stop the service:
                • stopService.bat
              • To uninstall the service:
                • uninstallService.bat

               

              If you need any help just post on this thread and I will try to help.

              • 4. Re: Infinispan Server as Windows Service
                Tejas Shah Novice

                login4imtiaz

                 

                 

                I Following ur steps to install Inifinispan as a Windows service. when I am going to execute runConsole.bat.its gives me below error

                 

                 

                INFO|15176/4|yajsw|16-02-16 11:08:36|[INFO] StandardFileSystemManager - Using "C

                :\Users\CHIRAG~1.ADM\AppData\Local\Temp\vfs_cache" as temporary files store.

                INFO|15176/4|yajsw|16-02-16 11:08:36|org.jboss.modules.ModuleNotFoundException:D:\\Java\\jdk1.8.0_51\\bin\\java

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:236)

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at org.jboss.modules.Main.main(Main.java:384)checkRemainConc scripts/trayMessage.gv 1

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                INFO|wrapper|yajsw|16-02-16 11:08:36|executed script: scripts/trayMessage.gv 1

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at java.lang.reflect.Method.invoke(Method.java:497)

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)

                INFO|15176/4|yajsw|16-02-16 11:08:36|   at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)

                INFO|wrapper|yajsw|16-02-16 11:08:37|restart process due to default exit code rule

                INFO|wrapper|yajsw|16-02-16 11:08:37|restart internal RUNNING

                INFO|wrapper|yajsw|16-02-16 11:08:37|stopping process with pid/timeout 15176 45000

                INFO|wrapper|yajsw|16-02-16 11:08:37|process exit code: 1

                WARNING|wrapper|yajsw|16-02-16 11:08:43|working directory  not foundsystem.env 49

                INFO|wrapper|yajsw|16-02-16 11:08:43|started process with pid 15220

                INFO|15220/5|yajsw|16-02-16 11:08:43|[INFO] StandardFileSystemManager - Using "C:\Users\CHIRAG~1.ADM\AppData\Local\Temp\vfs_cache" as temporary files store.

                INFO|15220/5|yajsw|16-02-16 11:08:43|org.jboss.modules.ModuleNotFoundException:D:\\Java\\jdk1.8.0_51\\bin\\javacheckRemainConc scripts/trayMessage.gv 1

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:236)

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at org.jboss.modules.Main.main(Main.java:384)

                INFO|wrapper|yajsw|16-02-16 11:08:43|executed script: scripts/trayMessage.gv 1

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at java.lang.reflect.Method.invoke(Method.java:497)

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)

                INFO|15220/5|yajsw|16-02-16 11:08:43|   at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)