Categories

Versions

Run RapidMiner Server as a service

You can run RapidMiner Server as a service, so that it will start automatically when the system starts. The method depends on your operating system:

Creating a service on Windows

You had an opportunity, at installation, toregister RapidMiner Server as a Windows service(by checking a box in the installer process). If you did not checkRegister as a serviceor you did not have admin privileges when you started the installer, RapidMiner Server is not registered to run as a service. To change the configuration so that RapidMiner Server runs as a service in the future:

  1. As administrator, open a Windows command prompt.

  2. From the terminal window, change to thebinfolder in your RapidMiner Server installation folder.

  3. Enterservice.bat installat the prompt. This installs RapidMiner Server as a Windows service. (To uninstall the service later, enterservice.bat uninstallfrom the same location.)

  4. By default, the service is registered with the keyRMSSVC(for exampleRMS710SVCorRMSSVCin case of older versions than 7.1.0). (This can be modified in theservice.bat文件。)开始的服务取胜dows command prompt, enter the following command with the service name. For example:

    net start RMS710SVC

    Similarly, to stop the service, enter:

    net stop RMS710SVC

Alternatively, you canuse the Windows control panelto set, start, and monitor the service.

Creating a service on Linux

A modern Linux distribution will usesystemdto start and stop services, but if you are still usingSysVinit, see the link below.

You can autostart RapidMiner Server under UNIX, but the method is dependent on your UNIX distribution. The following instructions apply to Ubuntu.

Linux system startup scripts are contained in/etc/init.d/. To start RapidMiner Server when an Ubuntu system boots, follow these steps:

  1. Download the filerapidminerserver.shto your computer and open it in an editor:

    \#!/bin/bash \### BEGIN INIT INFO \# Provides: rapidminerserver \# Required-Start: $local_fs $remote_fs $network $syslog \# Required-Stop: $local_fs $remote_fs $network $syslog \# Default-Start: 3 4 5 \# Default-Stop: 0 1 2 6 \# Short-Description: Start/Stop RapidMiner Server \### END INIT INFO \# chkconfig: 345 85 15 RAPIDMINER-SERVER_HOME=/opt/rapidminer-server-2 RAPIDMINER-SERVER_USER=root case "$1" in start) echo "Starting RapidMiner Server..." start-stop-daemon --start --quiet --background --chuid ${RAPIDMINER-SERVER_USER} --exec ${RAPIDMINER-SERVER_HOME}/bin/standalone.sh ;; stop) echo "Stopping RapidMiner Server..." start-stop-daemon --start --quiet --background --chuid ${RAPIDMINER-SERVER_USER} --exec ${RAPIDMINER-SERVER_HOME}/bin/jboss-cli.sh -- --connect --command=:shutdown ;; *) echo "Usage: /etc/init.d/rapidminerserver {start|stop}"; exit 1; ;; esac exit 0
  2. Change theRAPIDMINER-SERVER_USERvariable to the Linux user who will run the service. The user you enter must already exist. To create the user, use theuseraddcommand.

  3. Change theRAPIDMINER-SERVER_HOMEvariable to point to your RapidMiner Server installation.

  4. Save the script file as/etc/init.d/rapidminerserver.

  5. Make the script file executable by calling:

    chmod 755 /etc/init.d/rapidminerserver
  6. To configure Ubuntu to execute the script at boot time and shutdown, call:

    chkconfig --add rapidminerserver

In what follows, we describe the procedure for creating a RapidMiner service on Linux, withsystemd. The following 3 files should be placed by root in/etc/systemd/system/:

  • rapidminer-server.service
  • rapidminer-jobagent-template.service
  • rapidminer-scoring-agent.service

If RapidMiner Server, theJob Agent, and theReal Time Scoringagent all live on the same host, then the latter two scripts are dependent on the first script, and should be started after RapidMiner Server has been started, as indicated by the following line:

After=rapidminer-server.service

In practice, your setup may be somewhat different. If the Job Agent isnoton the same host as RapidMiner Server, then the line above should remain commented out inrapidminer-jobagent-template.service. If you do not have a Real Time Scoring agent, then you will have no need for the third script.

In any case, you must customize the scripts to match your setup, by modifying the path to the executables, and by correctly identifying the user and group connected with each of the services.

You may also want to set theRestartoption toon-failureoralways. SettingRestart=on-failureis the recommended choice for long-running services, in order to increase reliability by attempting automatic recovery from errors.

Restart=on-failure

For additional information, see thesystemd service documentation.

rapidminer-server.service

If your database server is on the same host as RapidMiner Server, the script should include anAfterstatement, with the name of the service for that database. For example, if your database server is on the same host and it is running PostgreSQL, you would uncomment the line that saysAfter=postgresql.service.

[Unit] Description=RapidMiner Server After=network.target # If your database server is on the same host, enter it's unit name here # to make sure that RM Server is started after it. #After=postgresql.service [Service] Type=simple # Change the desired system user and group to start the service as User=rapidminersrv Group=rapidminersrv # Change the path to your RapidMiner Server installation ExecStart=/opt/rapidminer-server/bin/standalone.sh # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 # Restart= on-failure | always #Restart=on-failure [Install] WantedBy=multi-user.target

rapidminer-jobagent-template.service

[Unit] Description=RapidMiner Job Agent template # If the Job Agent is on the same host as RapidMiner Server, # uncomment the following line #After=rapidminer-server.service [Service] Type=simple # Change the desired system user and group to start the service as User=rmserver Group=rmserver # Change the path to your RapidMiner Server installation ExecStart=/opt/rapidminer-job-agents/jobagent-path/bin/rapidminer-jobagent ExecStop=/opt/rapidminer-job-agents/jobagent-path/bin/stop-job-agent # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 # Restart= on-failure | always #Restart=on-failure [Install] WantedBy=multi-user.target

rapidminer-scoring-agent.service

[Unit] Description=RapidMiner Scoring Agent # If the Real Time Scoring agent is on the same host as RapidMiner Server, # uncomment the following line #After=rapidminer-server.service [Service] Type=simple # Change the desired system user and group to start the service as User=my_user Group=my_group # Change the path to your RapidMiner Scoring Agent installation ExecStart=/opt/rapidminer-scoring-agent/bin/rapidminer-scoring-agent # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 # Restart= on-failure | always #Restart=on-failure [Install] WantedBy=multi-user.target