在CentOs7上配置Mesos+Zookeeper
阿新 • • 發佈:2019-02-02
1.安裝jdk1.8並配置環境變數
export JAVA_HOME=/usr/local/opt/jdk1.8.0_51
PATH=$JAVA_HOME/bin:$PATH
2.zookeeper安裝與配置
a) 安裝zookeeper
$ wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
$ tar zxf zookeeper-3.4.6.tar.gz -C /usr/local/opt/
b) 啟動zookeeper
$ mv conf/zoo_sample.cfg conf/zoo.cfg(將zookeeper/conf/目錄下zoo_sample.cfg 更名為 zoo.cfg)
$ ./bin/zkServer.sh start
3.mesos安裝與配置
a) 安裝mesos
$ wget http://www.apache.org/dist/mesos/0.22.1/mesos-0.22.1.tar.gz
$ tar zxf mesos-0.22.1.tar.gz -C /usr/local/opt/
b) 安裝mesos依賴
$ sudo yum groupinstall -y "Development Tools"
$ sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
$ sudo yum install -y apache-maven python-devel zlib-devel libcurl-devel openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-util-devel
c) 配置mesos環境變數
export MESOS_NATIVE_JAVA_LIBRARY=/usr/local/lib/libmesos.so
export MESOS_NATIVE_LIBRARY=/usr/local/lib/libmesos.so
d) Build mesos
1. Add the WANdisco SVN repo file: '/etc/yum.repos.d/wandisco-svn.repo' with content:
[WANdiscoSVN]
name=WANdisco SVN Repo 1.9
enabled=1
baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
gpgcheck=1
gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
2. 構建mesos
$ cd mesos
$ mkdir build
$ cd build
$ ../configure
$ make
$ make check
$ make install
e) 啟動mesos
在mesos/build/目錄下執行 (log_dir,work_dir目錄自行修改):
$ ./bin/mesos-master.sh --zk=zk://localhost:2181/mesos --log_dir=/home/yaowang/WorkAndLog/mesos/log --work_dir=/home/yaowang/WorkAndLog/mesos/work --quorum=1
$ ./bin/mesos-slave.sh --master=zk://localhost:2181/mesos --log_dir=/home/yaowang/WorkAndLog/mesos/log --work_dir=/home/yaowang/WorkAndLog/mesos/work
localhost:5050檢視當前master與slave執行情況