Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Update readme to reflect ZooKeeper changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobilg committed Dec 9, 2016
1 parent d7c61e5 commit 72f3768
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ The option properties you can specify to create a `Scheduler` are the following:

* `masterUrl`: The URL of the leading Mesos master (**mandatory**).
* `port`: The port of the leading Mesos master (**mandatory**).
* `frameworkName`: The desired framework name (will choose a standard name if not specified).
* `useZk`: Should be set to `true` if you want to use ZooKeeper to persist the task information. Default is `false`.
* `zkUrl`: The ZooKeeper connection url. Default is `master.mesos:2181`.
* `zkPrefix`: The prefix of the ZooKeeper node where the data for this framework shall be stored. Default is `/dcos-service-`.
* `frameworkName`: The desired framework name (will choose a standard name if not specified). Default is `mesos-framework.` concatented with a unique UUID.
* `restartStates`: An array of [TaskStates](https://github.com/apache/mesos/blob/c6e9ce16850f69fda719d4e32be3f2a2e1d80387/include/mesos/v1/mesos.proto#L1310) which should trigger a restart of a task. For example, regularly finished tasks (in state `TASK_FINISHED`) are not restarted by default.
* `masterConnectionTimeout`: The number of seconds to wait before a connection to the leading Mesos master is considered as timed out (default: `10`).
* `frameworkFailoverTimeout`: The number of seconds to wait before a framework is considered as `failed` by the leading Mesos master, which will then terminate the existing tasks/executors (default: `604800`).
Expand All @@ -68,11 +71,15 @@ A `tasks` sub-object can contain objects with task information:
#### High availability

Currently, `mesos-framework` doesn't support HA setups for the scheduler instances, meaning that you can only run one instance at once. If you run the scheduler application via Marathon, you should be able to make use of the health checks to let them restart the scheduler application once it fails.
See also the example implementation of a framework at [mesos-framework-boilerplate](https://github.com/tobilg/mesos-framework-boilerplate).

You can use ZooKeeper though to be able to recover from scheduler restarts. This is done by setting `useZk` to `true` and specifying a `zkUrl` connection string (optionally, if you don't want to use the default `master.mesos:2181`, which should work inside clusters using Mesos DNS).

`mesos-framework` has support for the detection of the leading master via Mesos DNS. You can use `leader.mesos` as the `masterUrl`, enabling that upon re-registration of the scheduler, the correct master address will be used (Mesos DNS lookup). If you just provided an IP address or a hostname, `mesos-framework` will try to establish a new connection to the given address and look for redirection information (the "leader change" case). If this request times out, there is no way to automatically determine the current leader, so the scheduler stops itsef (the "failed Master" case).

#### Sample framework implementation

See also the example implementation of a framework at [mesos-framework-boilerplate](https://github.com/tobilg/mesos-framework-boilerplate).

#### Events

**Events from Master**
Expand Down Expand Up @@ -185,8 +192,10 @@ scheduler.on("error", function (error) {
scheduler.logger.info(error.stack);
});

// Start framework scheduler
scheduler.subscribe();
scheduler.on("ready", function () {
// Start framework scheduler
scheduler.subscribe();
});
```

### Executor
Expand Down

0 comments on commit 72f3768

Please sign in to comment.