marathon mesos zookeeper docker

Posted on Posted in docker

mesos

环境

三主三从

  • 192.168.27.130
  • 192.168.27.131
  • 192.168.27.132

zookeeper 安装

root@lhh:/usr/local/zookeeper# pwd
/usr/local/zookeeper
root@lhh:/usr/local/zookeeper# cd conf
root@lhh:/usr/local/zookeeper/conf# ls
configuration.xsl  log4j.properties  zoo_sample.cfg
root@lhh:/usr/local/zookeeper/conf# cp -rf zoo_sample.cfg zoo.cfg
root@lhh:/usr/local/zookeeper# mkdir ZooData/data -p
root@lhh:/usr/local/zookeeper# mkdir ZooData/logs -p
root@lhh:/usr/local/zookeeper# vim conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/usr/local/zookeeper/Zoodata/data
dataLogDir=/usr/local/zookeeper/Zoodata/logs
clientPort=2181
server.1=192.168.27.131:2888:38888
server.2=192.168.27.130:2888:38888
server.3=192.168.27.132:2888:38888

写 id, 3台机器

root@lhh:/usr/local/zookeeper# echo 1 > ZooData/data/myid
root@lhh:/usr/local/zookeeper# echo 2 > ZooData/data/myid
root@lhh:/usr/local/zookeeper# echo 3 > ZooData/data/myid

mesos 安装

源码编译安装

http://mesos.apache.org/documentation/latest/building/

apt-get install -y openjdk-8-jdk autoconf libtool build-essential python-dev python-six python-virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven libapr1-dev libsvn-dev zlib1g-dev iputils-ping libssl-dev

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
export JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

git clone https://gitbox.apache.org/repos/asf/mesos.git /usr/local/mesos

cd /usr/local/src/mesos
./bootstrap
mkdir -p build
cd build && ../configure

# make 使用-j参数来指定cpu 核数提高编译速度, V=0减少冗长日志输出

make -j4 V=0
make check -j4 V=0 && make install -j4 V=0

# 3台主启动
nohup /usr/local/mesos/build/bin/mesos-master.sh --zk=zk://192.168.27.131:2181/mesos --port=5050 --log_dir=/var/log/mesos --hostname=192.168.27.131 --hostname_lookup=false --ip=192.168.27.131 --quorum=1 --registry=replicated_log --work_dir=/var/lib/mesos/master --cluster=mesos >/dev/null 2>&1 &
nohup /usr/local/mesos/build/bin/mesos-master.sh --zk=zk://192.168.27.130:2181/mesos --port=5050 --log_dir=/var/log/mesos --hostname=192.168.27.130 --hostname_lookup=false --ip=192.168.27.130 --quorum=1 --registry=replicated_log --work_dir=/var/lib/mesos/master --cluster=mesos >/dev/null 2>&1 &
nohup /usr/local/mesos/build/bin/mesos-master.sh --zk=zk://192.168.27.132:2181/mesos --port=5050 --log_dir=/var/log/mesos --hostname=192.168.27.132 --hostname_lookup=false --ip=192.168.27.132 --quorum=1 --registry=replicated_log --work_dir=/var/lib/mesos/master --cluster=mesos >/dev/null 2>&1 &

# 3台从启动
nohup /usr/local/mesos/build/bin/mesos-slave.sh --master=zk://192.168.27.131:2181/mesos --containerizers=docker,mesos --work_dir=/var/lib/mesos/agent --hostname=192.168.27.131 --systemd_enable_support=false --log_dir=/var/log/agent >/dev/null 2>&1 &
nohup /usr/local/mesos/build/bin/mesos-slave.sh --master=zk://192.168.27.130:2181/mesos --containerizers=docker,mesos --work_dir=/var/lib/mesos/agent --hostname=192.168.27.130 --systemd_enable_support=false --log_dir=/var/log/agent >/dev/null 2>&1 &
nohup /usr/local/mesos/build/bin/mesos-slave.sh --master=zk://192.168.27.132:2181/mesos --containerizers=docker,mesos --work_dir=/var/lib/mesos/agent --hostname=192.168.27.132 --systemd_enable_support=false --log_dir=/var/log/agent >/dev/null 2>&1 &

# 启动框架
MESOS_NATIVE_JAVA_LIBRARY=/usr/local/lib/libmesos.so nohup /usr/local/marathon/bin/marathon --hostname 192.168.27.131 --master zk://192.168.27.131:2181,192.168.27.130:2181,192.168.132:2181/mesos --zk zk://192.168.27.131:2181,192.168.27.130:2181,192.168.132:2181/marathon >/dev/null 2>&1 &
» 转载请注明来源:若我若鱼 » marathon mesos zookeeper docker

Leave a Reply

Your email address will not be published. Required fields are marked *

three × 3 =