This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from annaken/master
Add notes on how to run mesos-consul without Docker
- Loading branch information
Showing
1 changed file
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,26 +39,26 @@ Benefits of using Consul: | |
* Multi-DC DNS lookups | ||
* Configurable health checks that run on each system | ||
|
||
|
||
### [Registrator](https://github.com/gliderlabs/registrator) | ||
|
||
Registrator is another tool that populates Consul (and other backends like etcd) with the status of Docker containers. However, Registrator is currently limited to reporting on Docker containers and does not track Mesos tasks. | ||
|
||
## Building | ||
``` | ||
docker build -t mesos-consul . | ||
``` | ||
|
||
## Running | ||
Mesos-consul can be run in a Docker container via Marathon. If your Zookeeper and Marathon services are registered in consul, you can use `.service.consul` to find them, otherwise change the vaules for your environment: | ||
## Building and running mesos-consul | ||
|
||
### Building and running in Docker | ||
Mesos-consul can be run in a Docker container via Marathon. | ||
|
||
To build the Docker image, do: | ||
``` | ||
docker build -t mesos-consul . | ||
``` | ||
To run mesos-consul, start the docker image within Mesos. If your Zookeeper and Marathon services are registered in consul, you can use `.service.consul` to find them, otherwise change the vaules for your environment: | ||
``` | ||
curl -X POST [email protected] -H "Content-Type: application/json" http://marathon.service.consul:8080/v2/apps' | ||
``` | ||
|
||
Where `mesos-consul.json` is similar to (replacing the image with your image): | ||
|
||
``` | ||
{ | ||
"args": [ | ||
|
@@ -76,12 +76,22 @@ Where `mesos-consul.json` is similar to (replacing the image with your image): | |
"cpus": 0.1, | ||
"mem": 256 | ||
} | ||
``` | ||
|
||
You can add options to authenticate via basic http or Consul token. | ||
|
||
### Building and running as a service on the Marathon instance | ||
|
||
If you don't want to use Docker, it is possible to compile the binary and run it on a Marathon / Mesos master server. | ||
|
||
To build it: | ||
* ensure that Go is installed on the build server | ||
* make sure GOPATH is set | ||
* clone this repository and cd into it | ||
* run `make` | ||
* the binary will be created at bin/mesos-consul | ||
* copy this to the Marathon server and start it with `mesos-consul --zk=zk://zookeeper.service.consul:2181/mesos` | ||
|
||
|
||
## Usage | ||
|
||
|