Launching Aspire

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

Starting Up Aspire

To start Aspire, execute the "startup" script in the "bin" directory.

Linux

Set your working directory to your Aspire distribution and then execute "bin/startup.sh":

$ cd my-aspire/target/my-aspire-1.0-SNAPSHOT-distribution.dir
$ bin/startup.sh
Removing Felix-Cache and AppBundle-Cache directories
-> Starting bundle: 9 - file:bundles/aspire/aspire-application-1.0-SNAPSHOT.jar
Settings (org.apache.felix.webconsole.internal.servlet.OsgiManager):  {password=admin, manager.root=/osgi, username=admin}
Started component factory: aspire-application (bundle 9)
Set update policy to always
AUTOSTART: No applications to start

Microsoft Windows from the Command Prompt

Set your working directory to your Aspire distribution and then execute "bin\startup.bat":

$ cd my-aspire\target\my-aspire-1.0-SNAPSHOT-distribution.dir
$ bin\startup.bat
Removing Felix-Cache and AppBundle-Cache directories
-> Starting bundle: 9 - file:bundles/aspire/aspire-application-1.0-SNAPSHOT.jar
Settings (org.apache.felix.webconsole.internal.servlet.OsgiManager):  {password=admin, manager.root=/osgi, username=admin}
Started component factory: aspire-application (bundle 9)
Set update policy to always
AUTOSTART: No applications to start


When to Re-Start Aspire

Once Aspire is running, only changes to base configuration settings or the Aspire launcher require a restart. The following rules apply:

  • Changes to anything in the ‘bin’ folder, or changes in config/felix.properties or config/settings.xml require an Aspire restart to take effect.
  • Anything else shouldn’t require a whole system restart, but may require a reload of specific components.

This is thanks to OSGi, and one of the nicest features of Aspire. You can change the configuration of components and just reload them dynamically.



Shutting Down Aspire

There are five different methods for shutting down Aspire.

Shutdown by URL

To shutdown your server you can execute the following URL in a browser:

http://localhost:50505/aspire?cmd=shutdown

Shutdown using the Admin Interface

Stop Server

Every server in the admin interface has a stop button. Click on this button to stop that server.

  1. Go to http://localhost:50505/.
  2. Click on the red stop button for the server that you wish to shutdown.
    • This will work even for the server which is hosting the admin interface.


Shutdown using the Debug Interface

Shutdown on Debug Interface

There is also a shutdown link on the debug interface.

  1. Go to http://localhost:50505/aspire.
  2. Click on the shutdown link.


Shutdown at the Console

If you started Aspire at a console window, you can shut it down by simply typing "shutdown" in the console window.

This works because the default installation of Aspire starts up a Felix console command prompt, and "shutdown" is a Felix console command for shutting down.

> bin\startup.bat
Removing Felix-Cache and AppBundle-Cache directories
-> Starting bundle: 9 - file:bundles/aspire/aspire-application-1.0-SNAPSHOT.jar
Settings (org.apache.felix.webconsole.internal.servlet.OsgiManager):  {password=admin, manager.root=/osgi, username=admin}
Started component factory: aspire-application (bundle 9)
Set update policy to always
AUTOSTART: No applications to start
shutdown
-> Stopping bundle: 9 - file:bundles/aspire/aspire-application-1.0-SNAPSHOT.jar
Stopped component factory: aspire-application (bundle 9)
>

Shutdown using the Windows Service

And finally, if you have Aspire installed as a Windows Service, you can shut it down using the Service "Stop" command.

Installing Aspire as a Service

Once you have Aspire running in production, you can install it as a service in a server. This way, any restarts of the server will bring Aspire up as well.

When run as a service, Aspire will run in the background, so it doesn’t require a user to be logged into the server all the time. It allows for more secure environments, as the account running Aspire is normally restricted from all non-Aspire related tasks (not even remote login to the server).

Installing Aspire as a Windows Service

See Running Aspire as a Windows Service for step-by-step instructions for running Aspire as a Windows Service.

Installing Aspire as a Linux Service

See Running Aspire as a Linux Service for instructions.


Setting Aspire Home

The Aspire Home is the file system directory where the Aspire installation is installed. This directory should contain several sub-directories such as "bin", "bundles", "resources", etc.

What is Aspire Home Used For?

Aspire Home is used for:

  • Locating configuration files
  • Locating XSL and other resources from the "resources" directory
  • Locating the "log" directory

Aspire Home is used anytime a relative path to a file inside the Aspire installation is required. The Aspire Home directory will be prepended to all such paths.

By default, the settings.xml file loads from "config/settings.xml" located in the Aspire Home directory. The settings.xml file holds environmental information and properties about the Aspire installation as a whole. For more information about the settings.xml file, see Settings Configuration.

Be aware that there is also a Java System property which can be used to set the location of the settings.xml file as well. It is "com.searchtechnologies.aspire.settings". For example:

  java -Dcom.searchtechnologies.aspire.settings=/test/settings.xml ...

On Microsoft Windows

On Windows, there are several ways to set the Aspire Home directory.

  1. Set the environment variable ASPIRE_HOME to the full path of the Aspire Home directory.
  2. Set your working directory to either the Aspire Home directory or the binary directory before executing "bin/startup.bat"
    • If no environment variable is set, the startup script will try and validate that your working directory (or the parent of your working directory) is a valid Aspire installation. If it is, it automatically sets Aspire Home to that directory.
  3. Edit the "bin/startup.bat" and change the "java" call so it passes the correct directory to the Java JVM.

The Java JVM System property which specifies the Aspire Home directory is com.searchtechnologies.aspire.home. This can be set with a command-line argument when executing the "java" command as follows:

  "-Dcom.searchtechnologies.aspire.home={home-directory}"

On Linux

In a bash shell on Linux, Aspire Home may be set by placing commands similar to the following in a script used to start Felix, or the user's profile:

if [ "${ASPIRE_HOME}" = "" ]
then
   # Set ASPIRE_HOME
   export ASPIRE_HOME=/home/aspire
 fi