bc-agent
Server for executing jobs locally and or/remotely using ssh.
Usage
bc-agent [--host name] [--local] [--cluster name] [--discover | [server][:port] ...] bc-agent --version bc-agent --help
where
| --host name | of agent. Default is name returned by /bin/hostname. |
| --local | start as a local job executor only, and do not attempt to execure non-local jobs using ssh. Default is non-local , executing jobs using ssh. |
| --cluster name | of BeyondCron cluster to join. Default is beyondcron. |
| --discover | Automatically discover cluster servers. |
| --help | print the command options. |
| --version | print the command version. |
| server | server name/s within the cluster. Default, the value of the environment variable BEYONDCRON_SERVER_NAMES. |
| port | server port number. Default, the value of the environment variable BEYONDCRON_SERVER_PORT. |
Environment variables
| BEYONDCRON_ALERT_COMMAND | Operating system command which is called when bc-agent stops unexpectedly. This can be used for example to send an email or SMS message. When called, the following environment variables will be set:BEYONDCRON_ALERT_REASON – description of error. e.g. “bc-agent stopped unexpectedly” or “bc-agent stopped after receiving signal 15”.BEYONDCRON_DAEMON – bc-agentBEYONDCRON_EXIT_CODE – exit code of bc-agentBEYONDCRON_OS_USER – operating system user name which bc-agent was running under. |
| BEYONDCRON_CONFIG_SERVICE | Name of the configuration service. If not defined BeyondCron will read startup variables from operating system environment variables. |
| BEYONDCRON_HOST_NAME | Host name of agent. Default is the name returned by /bin/hostname. |
| JAVA_OPTS | One or more JVM options. e.g. -Xms2T -Xmx2M |
| JDBC_CLASSPATH | Location of one or more JDBC drivers, which are used when executing SQL jobs. BeyondCron includes drivers for MySQL and PostgreSQL databases. |
| LOG4J_CONFIGURATION_FILE | Location of the log4j configuration file. If this file is named …/log4j2.yaml and does not exist, bc-agent will create and populate it, with the bc-agent defaults. |
Startup variables
Startup variables can be set within a configuration service, or as operating systems environment variables. Startup variables will be read first from a configuration service if defined, and then from environment variables if not defined within the configuration service.
| BEYONDCRON_AGENT_LOCAL | Start as a local job executor only. Default is false. |
| BEYONDCRON_CLUSTER_NAME | Name of BeyondCron cluster to join. Default is beyondcron. |
| BEYONDCRON_CLUSTER_PASSWORD | Password of cluster. If password is in the format file:filename, then the password will be read from filename. Default is a cluster specific random string. |
| BEYONDCRON_SERVER_ADDRESS_IGNORE | Space separated list of IP address prefixes. When searching for an address, ignore any addresses that begin with one of these prefixes. This can be useful, on servers with one or more management interfaces. |
| BEYONDCRON_SERVER_ADDRESS_IPV6 | When searching for an address, prefer an IPv6 address. Default is false. |
| BEYONDCRON_SERVER_ADDRESS_PRIVATE | When searching for an address, only chose a private network address. Default is true. |
| BEYONDCRON_SERVER_DISCOVER | Automatically discover servers in the BeyondCron cluster, using Hazelcast discovery mechanisms. Default is false. |
| Note: only bc-server supports multicast discovery. | |
| BEYONDCRON_SERVER_NAMES | One or more space separated server[:port]s to connect to. |
Default is a plumbed IP address that best matches the rules defined by the environment variables BEYONDCRON_SERVER_ADDRESS_PRIVATE, BEYONDCRON_SERVER_ADDRESS_IPV6 & BEYONDCRON_SERVER_ADDRESS_IGNORE, and BEYONDCRON_SERVER_DISCOVER is not true. |
|
| BEYONDCRON_SERVER_PORT | the server port number. Default is 5701. |
where a parameter is defined on both the command line and as an environment/startup variable, the command line value will be used.
Configuration variables
Configuration variables are set within BeyondCron using the config commands.
| beyondcron.agent.ssl.threads | number of ssl commands that agent will try to execute simultaneously. If set too high, jobs are likely to fail due bc-agent being unable to fork. Default is 100. |
| beyondcron.check.hosts.reachable | check that command job hosts are reachable before starting the job, by attemting to open a TCP connection to it. This can avoid long default timeouts when ssh’ing to a host that is down or does not exist. Default is true. |
| beyondcron.host.reachable.port | reachable port to attempt to open. Default is SSH port 22. |
| beyondcron.host.reachable.timeout | reachable timout period. Default is 100 ms. |
| beyondcron.echo | enable/disable the echo command and url. Default is true, enabled. |
| beyondcron.echo.command | path to the echo command. Default is bc-echo, with the directory being set at run time to the directory containing bc-agent. |
| beyondcron.echo.url | URL to the echo url. Default is http://localhost:8080/echo. |
| beyondcron.environment.path | value of PATH environment variable which is set when executing command jobs. Default = /usr/local/bin:/usr/bin:/bin |
Exit status
bc-agent exits with 0 when shutdown/killed with the WINCH signal, 1 if an internal error occurred, or 2 if killed by a signal other than WINCH.