21.2. Installing job agents

21.2.1. BASE application server side setup
21.2.2. Database server setup
21.2.3. Job agent client setup
21.2.4. Configuring the job agent

It is important to understand that the BASE application can be spread on to several computers. The main BASE application is serving HTTP requests, the underlying database engine is providing storage and persistence of data, and job agents can be installed on computers that will serve the BASE installation with computing power and perform analysis and run plug-in. In a straight forward setup one computer provides all services needed for running BASE. From this starting point it is easy to add computers to shares load from the BASE server by installing job agents on these additional computers.

A job agent is a program running on a computer regularly checking the BASE job queue for jobs awaiting execution. When the job agent finds a job that it is enabled to execute, it loads the plug-in and executes it. Job agents will in this way free up resources on the BASE application server, and thus allow the BASE server to concentrate on serving web pages. Job agents are optional and must be installed and setup separately. However, BASE is prepared for job agent setup and to utilize the agents, but the agent are not required.

A job agent supports many configuration options that are not supported by the internal job queue. For example, you can

All these options make it possible to create a very flexible setup. For example one job agent can be assigned for importing data only, another job agent can be assigned for running analysis plug-ins for specific project only, and a third may be a catch-all job agent that performs all low-priority jobs.

21.2.1. BASE application server side setup

Make sure the internal job queue doesn't execute all plug-ins

The setting jobqueue.internal.runallplugins should be set to false for the BASE server. This setting is found in the <base-dir>/www/WEB-INF/classes/base.config file. The changes will not take effect until the application server is restarted.

[Note] Note
Prior to BASE 2.5 the internal job queue had to be disabled completely. This is no longer the case since it is possible to enable/disable the internal job queue separately for each plug-in.
Enable the job agent user account

During installation of BASE a user account is created for the job agent. This account is used by the job agents to log on to BASE. The account is disabled by default and must be enabled. Enable the account and set a password using the BASE web interface. The same password must also be set in the jobagent.properties file, see item Edit the jobagent.properties file below.

21.2.2. Database server setup

Create a user account on the database

This is the similar to granting database access for the BASE server user in the in the regular BASE installation, cf. BASE (database engine). You must create an account in the database that is allowed to connect from the job agent server. MySQL example:

GRANT ALL ON base2.* TO db_user@job.agent.host IDENTIFIED BY 'db_password';
GRANT ALL ON base2dynamic.* TO db_user@job.agent.host;

Replace job.agent.host with the host name of the server that is going to run the job agent. You should also set password. This password is used in item Edit the base.config file below in job agent server setup. You can use the same database user and password as in the regular database setup.

21.2.3. Job agent client setup

Download and unpack a regular BASE distribution

You must use the same version on the web server and all job agents. You find the downloads at http://base.thep.lu.se/wiki/DownloadPage

Edit the base.config file

The <base-dir>/www/WEB-INF/classes/base.config file must be configured as in regular BASE installation, cf. BASE (configuration), to use the same database as the web server application. The most important settings are

  • db.username: The database user you created in item Create a user account on the database above.

  • db.password: The password for the user.

  • db.url: The connection url to the database.

  • userfiles: The path to the directory where user files are located. This directory must be accessible from all job agents, i.e., by nfs or other file system sharing method.

See the Appendix C, base.config reference for more information about the settings in the base.config file.

Edit the jobagent.properties file

The <base-dir>/www/WEB-INF/classes/jobagent.properties file contains settings for the job agent. The most important ones to specify value for are

  • agent.password: The password you set for the job agent user account in item Enable the job agent user account above.

  • agent.id: An ID that must be unique for each job agent accessing the BASE application.

  • agent.remotecontrol: The name/ip address of the web server if you want it to be able to display info about running jobs. The job agent will only allow connections from computers specified in this setting.

The jobagent.properties file contains many more configuration options. See the Appendix G, jobagent.properties reference for more information.

Register the job agent

From the bin directory, register the job agent with

./jobagent.sh register

Start the job agent

From the bin directory, start the job agent with

./jobagent.sh start &

See the Appendix H, jobagent.sh reference for more information about what you can do with the job agent command line interface.

21.2.4. Configuring the job agent

Before the job agent starts executing jobs for you it must be configured. The configuration is done through the BASE web interface. See Section 22.3, “Job agents”

Configure the plug-ins the job agent should handle

  • Go to the AdministratePluginsJob agents menu.

  • Select the job agent and click on the Edit… button.

  • On the Plugins tab you can specify which plug-ins the job agent should handle. Note that if you have installed external plug-ins on the web server, those plug-ins must be installed on the job agent as well. It is possible to specify different paths to the JAR file for each job agent.

Grant users access to the job agent

Use the regular Share functionality to specify which users/groups/projects should be able to use the job agent. You must give them at least USE permission.