軟體需求:
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雲平台。
請參考 <code>http://mesos.apache.org/</code>和<code>http://mesosphere.com/</code>檢視詳細
2 Master節點安裝
192.168.1.110 master1
192.168.1.111 master2
192.168.1.112 master3
master1,master2,master3
master1
master2
master3
<code>vi /etc/zookeeper/conf/zoo.cfg</code>
添加
master1,master2,master3 <code>vi /etc/mesos/zk</code> 增加内容:<code>zk://192.168.1.110:2181,192.168.1.111:2181,192.168.1.112:2181/mesos</code>
master1,master2,master3 <code>vi /etc/mesos-master/quorum</code>
增加内容:<code>2</code>
3 Slave節點安裝
192.168.1.113 client1
增加
4 測試
通路 http://192.168.1.110:5050 mesos位址
通路 http://192.168.1.110:8080 marathon位址,可利用其釋出docker鏡像并可調整應用數量