Start and Stop Fusion

This topic explains how to start and stop Fusion Server and its services using the scripts in the bin directory below the Fusion home directory:

  • /opt/fusion/4.0.x/bin (Unix)

  • C:\lucidworks\fusion\4.0.x\bin (Windows)

Command summary

You can control all Fusion services at once under the management of the Fusion agent, or you can control services individually.

To control all services using the Fusion agent:
  • Unix: /opt/fusion/4.0.x/bin/fusion <command>

  • Windows: C:\lucidworks\fusion\4.0.x\bin\fusion.cmd <command>

To control individual services:
  • Unix: /opt/fusion/4.0.x/bin/<servicename> <command>

    For example: /opt/fusion/4.0.x/bin/proxy restart

  • Windows: C:\lucidworks\fusion\4.0.x\bin\<servicename>.cmd <command>

    For example: C:\lucidworks\fusion\4.0.x\bin\proxy.cmd restart

Tip
When starting services individually, start Zookeeper first.

The commands below can be issued to the fusion/fusion.cmd script to issue the command to all services in the correct sequence, or they can be issued to an individual service.

start

Start one or all Fusion services.

status

Display the status of one or all Fusion services.

restart

Restart one or all Fusion services.

stop

Stop one or all Fusion services.

run

Start one or all Fusion services in the foreground.

Define groups of services

The fusion.properties file includes the property definition group.default. This property defines the Fusion services to start and stop by default (if no property is named in the start or stop command).

The default list of services out-of-the-box is also the minimum set of services, with the exception of the log-shipper service, which you can remove if you don’t use it.

Here is the group.default definition in fusion.properties:

group.default = zookeeper, solr, api, connectors-rpc, connectors-classic, admin-ui, proxy, webapps

Even if only using RPC connectors, the connectors-classic service is required.

To modify the default list of services

Edit the group.default property, for example, to include Spark related services:

group.default = zookeeper, solr, api, connectors-classic, connectors-rpc, proxy, webapps, admin-ui, spark-master, spark-worker
To define other lists of services (Unix)

You can define other lists of services by defining other group properties. For example, define this group property to start and stop services for Spark together:

group.spark-only = spark-master, spark-worker

Define this group property to start and stop services for classic and RPC connectors together:

group.connectors = connectors-classic, connectors-rpc

Unix

Start and stop Fusion on Unix.

Start Fusion

All Fusion start scripts must be executed by a user who has permissions to read and write to the directories where Fusion is installed. These scripts don’t need to be run as root (or sudo), nor should they be. Use a suitable user, or create a new one, and then ensure that it owns the directory where Fusion resides, (for example, C:\lucidworks).

Give the commands that follow from the directory fusion/4.0.x/bin.

Start required services

Start the required services that are defined in the group.default property.

To start all required services

./fusion start

Tip
This is equivalent to ./fusion start default. You can omit the group name default.

Start a group of services

You can start a group of services together. Reference the property in fusion.properties that defines the group.

Examples of when this is useful are:

  • Spark and SQL – The spark-master, spark-worker, and sql services are interdependent and should be started and stopped together.

    ./fusion start spark-master spark-worker sql
  • Classic and RPC connectors – RPC connectors require both the connectors-classic and connectors-rpc services to be running.

    ./fusion start connectors-classic connectors-rpc

Start services individually

You can start services individually.

To start services individually
  • Fusion UI service:

    ./admin-ui start

  • API services:

    ./api start

  • Classic Connectors services:

    ./connectors-classic start

  • RPC Connectors services:

    ./connectors-rpc start

  • Proxy:

    ./proxy start

  • Solr:

    ./solr start

  • Spark Master:

    ./spark-master start

  • Spark Worker:

    ./spark-worker start

  • SQL service:

    ./sql start

  • Web Apps:

    ./webapps start

  • ZooKeeper:

    ./zookeeper start

For information about default ports, see Default Ports.

Run Fusion in the foreground

To run Fusion or any of its services in the foreground, use the run command-line argument in place of start.

Stop Fusion

To stop Fusion services

To stop Fusion or any of its services, use the command above with the stop command-line argument in place of start, for example:

./solr stop

Using systemd to manage processes

On Red Hat Enterprise Linux, CentOS 7 and newer, and Ubuntu 15.04 LTS and newer, we support using the operating system-provided systemd for process management.

Launching Fusion at system start

You can configure systemd to launch Fusion when your system starts.

To launch Fusion at system start:
  1. Change your working directory to Fusion’s systemd directory, for example:

    cd /opt/fusion/4.0.x/init/systemd
  2. Edit fusion.service to provide correct values for the FUSION_HOME and JAVA_HOME environment variables.

  3. Stop Fusion if it is already running:

    /opt/fusion/4.0.x/bin/fusion stop
  4. Create the systemd management file, which launches Fusion under systemd management:

    sudo bash install.sh

Starting and stopping Fusion

You can use the systemctl command to start and stop Fusion:

sudo systemctl start fusion
sudo systemctl stop fusion

Log files for Fusion services are found in directories under fusion/4.0.x/var/log.

Using Ubuntu Upstart to manage processes

Under Ubuntu 12.04 LTS through Ubuntu 14.10, we support using Upstart for process management. This requires Fusion to be installed in the /opt/lucidworks/ directory.

To configure upstart, run the following commands:

$ cd /opt/lucidworks/fusion/{version}/init/upstart
$ sudo bash install.sh

If this complains with no JAVA_HOME set, replace sudo with sudo -E. Then you can use the service command to control the server:

$ sudo service fusion-solr start
$ sudo service fusion-api start
$ sudo service fusion-connectors start
$ sudo service fusion-ui start

and similarly use stop and status.

Log files for Fusion services are found in directories under fusion/4.0.x/var/log.

Windows

Start and stop Fusion on Windows.

Start Fusion

All Fusion start scripts must be executed by a user who has permissions to read and write to the directories where Fusion is installed. Ensure that the user owns the directory where Fusion resides (for example, C:\lucidworks).

Give the commands that follow from the directory fusion{version}.x\bin.

Start required services

To start all required Fusion services as Java processes
fusion.cmd start
To start all required Fusion services as Windows services
start-services.cmd

Start services individually

To start specific services as Java processes
  • UI service:

    admin-ui.cmd start

  • API services:

    api.cmd start

  • Classic Connectors services:

    connectors-classic.cmd start

  • RPC Connectors services:

    connectors-rpc.cmd start

  • Proxy:

    proxy.cmd start

  • Solr:

    solr.cmd start

  • Spark Master:

    spark-master.cmd start

  • Spark Worker:

    spark-worker.cmd start

  • SQL service:

    sql.cmd start

  • Web Apps:

    webapps.cmd start

  • ZooKeeper:

    zookeeper.cmd start

For information about default ports, see Default Ports.

Run Fusion in the foreground

To run Fusion or any of its services in the foreground, use the run command-line argument in place of start, for example:

connectors.cmd run

Stop Fusion

To stop all Fusion services
  • fusion.cmd stop (Stop all Fusion services, if they are running as Java processes)

  • stop-services.cmd (Stop all Fusion services, if they are running as Windows services)

To stop a specific service running as a Java process

To stop a specific Fusion service that is running as a Java process, use the command above with the stop command-line argument in place of start, for example:

connectors.cmd stop

Run Fusion with a service account

This example assumes the following:

Field Value

Account

FUSION_SVC

Domain

qe

Installation directory

C:\fusion\<version>

Server

EC2AMAZ-79FD9JL

  1. As an administrator, create the service account, and install it to the server you want to use for Fusion:

    C:\Users\Administrator>New-ADServiceAccount -Name "FUSION_SVC" -RestrictToSingleComputer
    C:\Users\Administrator>Add-ADComputerServiceAccount -Identity EC2AMAZ-79FD9JL -ServiceAccount "FUSION_SVC"
    C:\Users\Administrator>Install-ADServiceAccount -Identity "FUSION_SVC"
    C:\Users\Administrator>Test-ADServiceAccount "FUSION_SVC"
    C:\Users\Administrator>Get-ADServiceAccount "FUSION_SVC"
  2. Run install-services.cmd as a local administrator:

    C:\Users\Administrator> C:\fusion\4.2.2\bin\install-services.cmd
    ECHO is off.
                  Thank you for choosing
     ====================================================
    "  _            _     _                    _         "
    " | |          (_)   | |                  | |        "
    " | |_   _  ___ _  __| |_      _____  _ __| | _____  "
    " | | | | |/ __| |/ _` \ \ /\ / / _ \| '__| |/ / __| "
    " | | |_| | (__| | (_| |\ V  V / (_) | |  |   <\__ \ "
    " |_|\__._|\___|_|\__._| \_/\_/ \___/|_|  |_|\_\___/ "
     ====================================================
    You will now be prompted for the username and password of the Windows account that will launch Fusion.
    IMPORTANT NOTE 1: When prompted 'Set Account rights to allow log on as a service', enter 'Y'
    IMPORTANT NOTE 2: You must enter the username in domain\username format.
    .... Starting winsw (https://github.com/kohsuke/winsw) service wrapper utility ...
    2019-06-12 17:37:21,737 INFO  - Starting ServiceWrapper in the CLI mode
    Username: EC2AMAZ-79FD9JL\Administrator
    Password: ************
    Set Account rights to allow log on as a service (y/n)?: n
    2019-06-12 17:38:02,970 INFO  - Completed. Exit code is 0
  3. Grant the service account full access to Fusion:

    C:\Users\Administrator>$path = "C:\fusion"
    $Acl = Get-Acl "$path"
    $permission = "qe\FUSION_SVC$", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
    $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
    $Acl.SetAccessRule($accessRule)
    Set-Acl "$path" $Acl
    Get-Acl "$path" | fl
  4. Modify the Lucidworks Fusion service to use the service account.

    1. Open Administrative Tools > Services on your Windows server.

    2. Select the Lucidworks Fusion service.

    3. Open the Properties > Log On dialog.

    4. Change the service user account to the FUSION_SVC user account.

      Note
      Only the account name is required. The password is managed by Windows.

Access Fusion after startup

After Fusion services have started, you can open the Fusion UI in a web browser at http://localhost:8764/ (replace localhost with your server name or IP address if necessary).

The first time you access Fusion, you must set the password for the user admin and agree to the Fusion Licensing Agreement (which contains terms of service). This is followed by an optional registration step. After this, Fusion displays the Fusion launcher (the page from which you can open apps).

If you can’t access the system, see the Troubleshooting topic. Checking System State shows how to inspect Fusion services.