d2iq-archive / mesos-rxjava

RxJava client for Apache Mesos HTTP APIs
Apache License 2.0
42 stars 27 forks source link

Update MesosClient to support Master Redirection #55

Closed BenWhitehead closed 8 years ago

BenWhitehead commented 8 years ago

Fixes #18

Testing

Manually tested against https://github.com/apache/mesos/commit/dfe62665df67162e4c1064f524d6c0180100a9d2

Compiled and ran on openSUSE Tumbleweed

Assumes a zookeeper server is listening on localhost:2181

Steps
  1. start master 1

    LIBPROCESS_IP=127.1.0.1 ~/mesos/build/bin/mesos-master.sh \
       --zk=zk://localhost:2181/mesos \
       --port=5050 \
       --log_dir=~/mesos/work/master_127.1.0.1_5050/log_dir \
       --work_dir=~/mesos/work/master_127.1.0.1_5050/work_dir \
       --quorum=2 \
       --cluster=testing
  2. start master 2

    LIBPROCESS_IP=127.1.0.2 ~/mesos/build/bin/mesos-master.sh \
       --zk=zk://localhost:2181/mesos \
       --port=5050 \
       --log_dir=~/mesos/work/master_127.1.0.2_5050/log_dir \
       --work_dir=~/mesos/work/master_127.1.0.2_5050/work_dir \
       --quorum=2 \
       --cluster=testing
  3. start master 3

    LIBPROCESS_IP=127.1.0.3 ~/mesos/build/bin/mesos-master.sh \
       --zk=zk://localhost:2181/mesos \
       --port=5050 \
       --log_dir=~/mesos/work/master_127.1.0.3_5050/log_dir \
       --work_dir=~/mesos/work/master_127.1.0.3_5050/work_dir \
       --quorum=2 \
       --cluster=testing
  4. start agent 1

    sudo USER=root LIBPROCESS_IP=0.0.0.0 ~/mesos/build/bin/mesos-slave.sh \
       --master=zk://localhost:2181/mesos \
       --port=5051 \
       --log_dir=~/mesos/work/agent_127.1.0.2_5050/log_dir \
       --work_dir=~/mesos/work/agent_127.1.0.2_5050/work_dir \
       --containerizers=docker,mesos \
       --isolation=cgroups/cpu,cgroups/mem \
       --cgroups_enable_cfs \
       --executor_registration_timeout=5mins
  5. build Sleepy framework

    mvn clean package
  6. Run Sleepy framework

    java -jar mesos-rxjava-example/mesos-rxjava-example-framework/target/mesos-rxjava-example-framework-0.1.0-SNAPSHOT-jar-with-dependencies.jar \
       http://127.1.0.3:5050/api/v1/scheduler \
       1 \
       '*'
egor-ryashin commented 7 years ago

Could we add ZK link support also? Like

 java -jar mesos-rxjava-example/mesos-rxjava-example-framework/target/mesos-rxjava-example-framework-0.1.0-SNAPSHOT-jar-with-dependencies.jar \
    zk://zk.host.com:2181/mesos
BenWhitehead commented 7 years ago

ZK integration falls outside the design of the http api and should not have to be integrated with per Master Detection

egor-ryashin commented 7 years ago

Makes sense, got it.