軟件需求:
g++(gcc-c++)
gcc
sun-jdk6
python2.6
python26-devel
git
subversion
環境變量JAVA_HOME也需要設置下
環境一定要乾淨
安裝:
./configure.template.centos-5.4-64 基本上就差不多了,但是configure.template.centos-5.4-64中的第一行export LDFLAGS=-lunwind-x86_64 需要去掉,否則在配置的時候會出錯。
$(dirname $0)/configure \
--with-python-headers=/usr/include/python2.6 \
--with-java-home=$JAVA_HOME\
--with-java-headers=$JAVA_HOME/include\
--with-webui \
--with-included-zookeeper $@
然後就make, make install
make的時候不能爲了圖速度就使用並行編譯,有時候會出錯的。
mesos就安裝在/usr/local/mesos/ 下
可以用三種方式配置mesos
1. 啓動參數,直接在MESOS_HOME/bin/mesos-master –conf=”….” –failover_timeout=…. …..
2. 環境變量,使用MESOS_*作爲開頭
3. 使用配置文件MESOS_HOME/conf是配置目錄。將配置文件寫在這個文件夾中。
運行:
啓動Master:
–conf 指定配置目錄,默認使用 <install location>/conf
–failover_timeout failover 的超時時間,單位秒。默認 86400秒
–ip 偵聽ip地址
–log_buf_secs 緩衝多少秒的日誌消息
–log_dir 日誌存放目錄(默認: MESOS_HOME/logs)
–port or -p 偵聽端口,默認5050
–[no-]quiet (or [no-]q) 不打印標準錯誤輸出stderr (默認: false)
–[no-]root_submissions root用戶能啓動mesosr(默認: true)
–slaves Initial slaves that should be considered part of this cluster (or if using ZooKeeper a URL) (default: *)
–url or -u URL used for leader election
–webui_port or -w Web UI port (default: 8080)
eg:
bin/mesos-master –log_dir=/home/yuquan.nq/dev/log/mesos &
啓動slave:
bin/mesos-slave –help
Usage: bin/mesos-slave –master=URL [...]
URL may be one of:
mesos://id@host:port
zoo://host1:port1,host2:port2,…
zoofile://file where file contains a host:port pair per line
Supported options:
–attributes=VAL Attributes of machine
–conf=VAL Specifies a config directory from which to read Mesos config files. The Mesos binaries use <install location>/conf by default
–executor_shutdown_timeout_seconds=VAL Amount of time (in seconds) to wait for an executor to shut down (default: 5)
–frameworks_home=VAL Directory prepended to relative executor paths (default: MESOS_HOME/frameworks)
//--------------------------------
1 Apache Mesos簡介
Apache Mesos據說是雲計算的未來,利用Mesos可輕易實現一個PaaS雲平臺。
請參考 http://mesos.apache.org/
和http://mesosphere.com/
查看詳細
2 Master節點安裝
規劃
192.168.1.110 master1
192.168.1.111 master2
192.168.1.112 master3
關閉防火牆
master1,master2,master3
systemctl stop firewalld && systemctl disable firewalld
添加 mesos的yum源
master1,master2,master3
sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
安裝mesos及相關軟件
master1,master2,master3
yum -y install mesos marathon yum -y install mesosphere-zookeeper
配置zookeeper
master1
touch /var/lib/zookeeper/myid echo 1 > /var/lib/zookeeper/myid
master2
touch /var/lib/zookeeper/myid echo 2 > /var/lib/zookeeper/myid
master3
touch /var/lib/zookeeper/myid echo 3 > /var/lib/zookeeper/myid
master1,master2,master3
vi /etc/zookeeper/conf/zoo.cfg
添加
server.1=192.168.1.110:2888:3888 server.2=192.168.1.111:2888:3888 server.3=192.168.1.112:2888:3888
master1,master2,master3
vi /etc/mesos/zk
增加內容:zk://192.168.1.110:2181,192.168.1.111:2181,192.168.1.112:2181/mesos
master1,master2,master3
vi /etc/mesos-master/quorum
增加內容:2
配置mesos和marathon
master1
echo 192.168.1.110 | sudo tee /etc/mesos-master/hostname mkdir -p /etc/marathon/conf/ && touch hostname echo 192.168.1.110 | sudo tee /etc/marathon/conf/hostname
master2
echo 192.168.1.111 | sudo tee /etc/mesos-master/hostname mkdir -p /etc/marathon/conf/ && touch hostname echo 192.168.1.111 | sudo tee /etc/marathon/conf/hostname
master3
echo 192.168.1.112 | sudo tee /etc/mesos-master/hostname mkdir -p /etc/marathon/conf/ && touch hostname echo 192.168.1.112 | sudo tee /etc/marathon/conf/hostname
啓動zookeeper mesos-master marathon
master1,master2,master3
systemctl start zookeeper && systemctl start mesos-master && systemctl start marathon systemctl disable mesos-slave
3 Slave節點安裝
規劃
192.168.1.113 client1
關閉防火牆
systemctl stop firewalld && systemctl disable firewalld
添加 mesos的yum源
sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
安裝mesos
yum -y install mesos
配置master信息
vi /etc/mesos/zk
增加
zk://192.168.1.110:2181,192.168.1.111:2181,192.168.1.112:2181/mesos
cd /etc/mesos-slave/ touch hostname echo 192.168.1.113 | sudo tee /etc/mesos-slave/hostname
啓動mesos-slave
systemctl start mesos-slave && systemctl enable mesos-slave systemctl disable mesos-master
4 測試
訪問 http://192.168.1.110:5050 mesos地址
訪問 http://192.168.1.110:8080 marathon地址,可利用其發佈docker鏡像並可調整應用數量