Most of the code are borrowed from previous work done and an example Mesos module. This work is still under active development and may change on daily basis.
Etcd v3.0.3
Replicated log in Mesos is still coupled with Zookeeper. The work to modularize this part is still undergoing. For now, please clone Mesos from this branch. Refer to Mesos getting started for instructions to build Mesos.
Supply --enable-install-module-dependencies
to configure
. This installs 3rdparty libraries that modules depend on. If you don't want system-wide Mesos installation, supply --prefix=/path/to/install/location
as well. make install
when compilation is finished.
git clone https://github.com/guoger/mesos-etcd-module.git && cd mesos-etcd-module
./bootstrap
mkdir build && cd build
../configure --with-mesos=$MESOS_INSTALL CXXFLAGS="-I$MESOS_INSTALL/include -I$MESOS_INSTALL/lib/mesos/3rdparty/include -I$MESOS_INSTALL/lib/mesos/3rdparty/usr/local/include"
make
$MESOS_INSTALL
is the install path specified in previous step. Running above commands produces shared library libmesos_etcd_module-0.1.so in build/.libs/.
An example JSON config file etcd_module.json.sample
can be found in root directory of the project. Grab a copy, replace file
and url
value according to your environment.
The easiest way to try out the module is to have an etcd instance running locally. See this guide.
After etcd is started, run multiple Mesos master instances ./bin/mesos-master.sh
with flags:
--modules="file:///path/to/etcd_module.json"
, --master_contender=org_apache_mesos_EtcdMasterContender
, --master_detector=org_apache_mesos_EtcdMasterDetector
, --etcd://<host>:<post>/v2/keys/replicated_log
, --quorum=<number>
One of the masters will get elected as leader. Killing the leader will result in another round of contending until new leader being elected.
Run Mesos agent ./bin/mesos-agent.sh
with flags:
--modules="file:///path/to/etcd_module.json"
, --master_detector=org_apache_mesos_EtcdMasterDetector
.
work in progress
help needed