Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 86DE1200B36 for ; Wed, 6 Jul 2016 23:23:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 853DB160A7D; Wed, 6 Jul 2016 21:23:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2F7E8160A79 for ; Wed, 6 Jul 2016 23:22:58 +0200 (CEST) Received: (qmail 17317 invoked by uid 500); 6 Jul 2016 21:22:57 -0000 Mailing-List: contact commits-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.apache.org Delivered-To: mailing list commits@aurora.apache.org Received: (qmail 17261 invoked by uid 99); 6 Jul 2016 21:22:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2016 21:22:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C74861A047E for ; Wed, 6 Jul 2016 21:22:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.375 X-Spam-Level: X-Spam-Status: No, score=0.375 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426, WEIRD_PORT=0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id vTedYP9LxwuK for ; Wed, 6 Jul 2016 21:22:46 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 2348F5F2F0 for ; Wed, 6 Jul 2016 21:22:45 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 3C1D3E4894 for ; Wed, 6 Jul 2016 21:22:43 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 2E9A63A023B for ; Wed, 6 Jul 2016 21:22:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1751733 [7/18] - in /aurora/site: data/ publish/ publish/blog/ publish/blog/aurora-0-15-0-released/ publish/documentation/0.10.0/ publish/documentation/0.10.0/build-system/ publish/documentation/0.10.0/client-cluster-configuration/ publish... Date: Wed, 06 Jul 2016 21:22:40 -0000 To: commits@aurora.apache.org From: maxim@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160706212243.2E9A63A023B@svn01-us-west.apache.org> archived-at: Wed, 06 Jul 2016 21:23:00 -0000 Added: aurora/site/publish/documentation/0.15.0/operations/configuration/index.html URL: http://svn.apache.org/viewvc/aurora/site/publish/documentation/0.15.0/operations/configuration/index.html?rev=1751733&view=auto ============================================================================== --- aurora/site/publish/documentation/0.15.0/operations/configuration/index.html (added) +++ aurora/site/publish/documentation/0.15.0/operations/configuration/index.html Wed Jul 6 21:22:35 2016 @@ -0,0 +1,520 @@ + + + + + + Apache Aurora + + + + + + +
+
+ +
+
+ +
+
+
+ +

Scheduler Configuration

+ +

The Aurora scheduler can take a variety of configuration options through command-line arguments. +Examples are available under examples/scheduler/. For a list of available Aurora flags and their +documentation, see Scheduler Configuration Reference.

+ +

A Note on Configuration

+ +

Like Mesos, Aurora uses command-line flags for runtime configuration. As such the Aurora +“configuration file” is typically a scheduler.sh shell script of the form.

+
#!/bin/bash
+AURORA_HOME=/usr/local/aurora-scheduler
+
+# Flags controlling the JVM.
+JAVA_OPTS=(
+  -Xmx2g
+  -Xms2g
+  # GC tuning, etc.
+)
+
+# Flags controlling the scheduler.
+AURORA_FLAGS=(
+  # Port for client RPCs and the web UI
+  -http_port=8081
+  # Log configuration, etc.
+)
+
+# Environment variables controlling libmesos
+export JAVA_HOME=...
+export GLOG_v=1
+# Port used to communicate with the Mesos master and for the replicated log
+export LIBPROCESS_PORT=8083
+
+JAVA_OPTS="${JAVA_OPTS[*]}" exec "$AURORA_HOME/bin/aurora-scheduler" "${AURORA_FLAGS[@]}"
+
+ +

That way Aurora’s current flags are visible in ps and in the /vars admin endpoint.

+ +

Replicated Log Configuration

+ +

Aurora schedulers use ZooKeeper to discover log replicas and elect a leader. Only one scheduler is +leader at a given time - the other schedulers follow log writes and prepare to take over as leader +but do not communicate with the Mesos master. Either 3 or 5 schedulers are recommended in a +production deployment depending on failure tolerance and they must have persistent storage.

+ +

Below is a summary of scheduler storage configuration flags that either don’t have default values +or require attention before deploying in a production environment.

+ +

-native_log_quorum_size

+ +

Defines the Mesos replicated log quorum size. In a cluster with N schedulers, the flag +-native_log_quorum_size should be set to floor(N/2) + 1. So in a cluster with 1 scheduler +it should be set to 1, in a cluster with 3 it should be set to 2, and in a cluster of 5 it +should be set to 3.

+ + + + + + + + + + + + + + + + + + + + + + + +
Number of schedulers (N)-native_log_quorum_size setting (floor(N/2) + 1)
11
32
53
74
+ +

Incorrectly setting this flag will cause data corruption to occur!

+ +

-native_log_file_path

+ +

Location of the Mesos replicated log files. Consider allocating a dedicated disk (preferably SSD) +for Mesos replicated log files to ensure optimal storage performance.

+ +

-native_log_zk_group_path

+ +

ZooKeeper path used for Mesos replicated log quorum discovery.

+ +

See code for +other available Mesos replicated log configuration options and default values.

+ +

Changing the Quorum Size

+ +

Special care needs to be taken when changing the size of the Aurora scheduler quorum. +Since Aurora uses a Mesos replicated log, similar steps need to be followed as when +changing the Mesos quorum size.

+ +

As a preparation, increase -native_log_quorum_size on each existing scheduler and restart them. +When updating from 3 to 5 schedulers, the quorum size would grow from 2 to 3.

+ +

When starting the new schedulers, use the -native_log_quorum_size set to the new value. Failing to +first increase the quorum size on running schedulers can in some cases result in corruption +or truncating of the replicated log used by Aurora. In that case, see the documentation on +recovering from backup.

+ +

Backup Configuration

+ +

Configuration options for the Aurora scheduler backup manager.

+ +

-backup_interval

+ +

The interval on which the scheduler writes local storage backups. The default is every hour.

+ +

-backup_dir

+ +

Directory to write backups to.

+ +

-max_saved_backups

+ +

Maximum number of backups to retain before deleting the oldest backup(s).

+ +

Process Logs

+ +

Log destination

+ +

By default, Thermos will write process stdout/stderr to log files in the sandbox. Process object configuration +allows specifying alternate log file destinations like streamed stdout/stderr or suppression of all log output. +Default behavior can be configured for the entire cluster with the following flag (through the -thermos_executor_flags +argument to the Aurora scheduler):

+
--runner-logger-destination=both
+
+ +

both configuration will send logs to files and stream to parent stdout/stderr outputs.

+ +

See Configuration Reference for all destination options.

+ +

Log rotation

+ +

By default, Thermos will not rotate the stdout/stderr logs from child processes and they will grow +without bound. An individual user may change this behavior via configuration on the Process object, +but it may also be desirable to change the default configuration for the entire cluster. +In order to enable rotation by default, the following flags can be applied to Thermos (through the +-thermosexecutorflags argument to the Aurora scheduler):

+
--runner-logger-mode=rotate
+--runner-rotate-log-size-mb=100
+--runner-rotate-log-backups=10
+
+ +

In the above example, each instance of the Thermos runner will rotate stderr/stdout logs once they +reach 100 MiB in size and keep a maximum of 10 backups. If a user has provided a custom setting for +their process, it will override these default settings.

+ +

Thermos Executor Wrapper

+ +

If you need to do computation before starting the thermos executor (for example, setting a different +--announcer-hostname parameter for every executor), then the thermos executor should be invoked + inside a wrapper script. In such a case, the aurora scheduler should be started with + -thermos_executor_path pointing to the wrapper script and -thermos_executor_resources + set to a comma separated string of all the resources that should be copied into + the sandbox (including the original thermos executor).

+ +

For example, to wrap the executor inside a simple wrapper, the scheduler will be started like this +-thermos_executor_path=/path/to/wrapper.sh -thermos_executor_resources=/usr/share/aurora/bin/thermos_executor.pex

+ +

Custom Executor



+ +

If the need arises to use a Mesos executor other than the Thermos executor, the scheduler can be +configured to utilize a custom executor by specifying the -custom_executor_config flag. +The flag must be set to the path of a valid executor configuration file.


+ +

The configuration file must be valid JSON and contain, at minimum, the name, command and resources fields.

+ +

executor

+ + + + + + + + + + + + + + + + + + + +
PropertyDescription
name (required)Name of the executor.
command (required)How to run the executor.
resources (required)Overhead to use for each executor instance.
+ +

command

+ + + + + + + + + + + + + + + + + + + +
PropertyDescription
value (required)The command to execute.
arguments (optional)A list of arguments to pass to the command.
uris (optional)List of resources to download into the task sandbox.
+ +
uris (list)
+ + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
value (required)Path to the resource needed in the sandbox.
executable (optional)Change resource to be executable via chmod.
extract (optional)Extract files from packed or compressed archives into the sandbox.
cache (optional)Use caching mechanism provided by Mesos for resources.
+ +

resources (list)

+ + + + + + + + + + + + + + + + + + + +
PropertyDescription
name (required)Name of the resource: cpus or mem.
type (required)Type of resource. Should always be SCALAR.
scalar (required)Value in float for cpus or int for mem (in MBs)
+ +

volume_mounts (list)

+ + + + + + + + + + + + + + + + + + + +
PropertyDescription
host_path (required)Host path to mount inside the container.
container_path (required)Path inside the container where host_path will be mounted.
mode (required)Mode in which to mount the volume, Read-Write (RW) or Read-Only (RO).
+ +

A sample configuration is as follows:
 + + { + "executor": { + "name": "myExecutor", + "command": { + "value": "myExecutor.sh", + "arguments": [ + "localhost:2181", + "-verbose", + "-config myConfiguration.config" + ], + "uris": [ + { + "value": "/dist/myExecutor.sh", + "executable": true, + "extract": false, + "cache": true + }, + { + "value": "/home/user/myConfiguration.config", + "executable": false, + "extract": false, + "cache": false + } + ] + }, + "resources": [ + { + "name": "cpus", + "type": "SCALAR", + "scalar": { + "value": 1.00 + } + }, + { + "name": "mem", + "type": "SCALAR", + "scalar": { + "value": 512 + } + } + ] + }, + "volume_mounts": [ + { + "mode": "RO", + "container_path": "/path/on/container", + "host_path": "/path/to/host/directory" + }, + { + "mode": "RW", + "container_path": "/container", + "host_path": "/host" + } + ] + } +

+ +

It should be noted that if you do not use thermos or a thermos based executor, links in the scheduler’s +Web UI for tasks
 will not work (at least for the time being). +Some information about launched tasks can still be accessed via the Mesos Web UI or via the Aurora Client. +Furthermore, this configuration replaces the default thermos executor. +Work is in progress to allow support for multiple executors to co-exist within a single scheduler.

+ +

Docker containers

+ +

In order for Aurora to launch jobs using docker containers, a few extra configuration options +must be set. The docker containerizer +must be enabled on the Mesos agents by launching them with the --containerizers=docker,mesos option.

+ +

By default, Aurora will configure Mesos to copy the file specified in -thermos_executor_path +into the container’s sandbox. If using a wrapper script to launch the thermos executor, +specify the path to the wrapper in that argument. In addition, the path to the executor pex itself +must be included in the -thermos_executor_resources option. Doing so will ensure that both the +wrapper script and executor are correctly copied into the sandbox. Finally, ensure the wrapper +script does not access resources outside of the sandbox, as when the script is run from within a +docker container those resources will not exist.

+ +

A scheduler flag, -global_container_mounts allows mounting paths from the host (i.e the agent machine) +into all containers on that host. The format is a comma separated list of hostpath:containerpath[:mode] +tuples. For example -global_container_mounts=/opt/secret_keys_dir:/mnt/secret_keys_dir:ro mounts +/opt/secret_keys_dir from the agents into all launched containers. Valid modes are ro and rw.

+ +

If you would like to run a container with a read-only filesystem, it may also be necessary to +pass to use the scheduler flag -thermos_home_in_sandbox in order to set HOME to the sandbox +before the executor runs. This will make sure that the executor/runner PEX extractions happens +inside of the sandbox instead of the container filesystem root.

+ +

If you would like to supply your own parameters to docker run when launching jobs in docker +containers, you may use the following flags:

+
-allow_docker_parameters
+-default_docker_parameters
+
+ +

-allow_docker_parameters controls whether or not users may pass their own configuration parameters +through the job configuration files. If set to false (the default), the scheduler will reject +jobs with custom parameters. NOTE: this setting should be used with caution as it allows any job +owner to specify any parameters they wish, including those that may introduce security concerns +(privileged=true, for example).

+ +

-default_docker_parameters allows a cluster operator to specify a universal set of parameters that +should be used for every container that does not have parameters explicitly configured at the job +level. The argument accepts a multimap format:

+
-default_docker_parameters="read-only=true,tmpfs=/tmp,tmpfs=/run"
+
+ +
+ +
+
+