centos7部署PaaS平台环境(mesos+marathon)

假如有5台主机可以使用,ip地址如下

规划(2master+3slave)

master:

192.168.248.205 ---master1

192.168.248.206 ---master2

slave:

192.168.248.207---slave1

192.168.248.208---slave2

192.168.248.209---slave3

配置master节点(master1master2

1、关闭防火墙与selinux

systemctl stop firewalld && systemctl disable firewalld

   Redhat应用了SELinux去加强平安,永久封闭的举措为:

   修改 /etc/selinux/config 文件中的 SELINUX=”” disabled ,然后重启服务器。

2、安装配置jdkntp时间同步,hostname主机映射

 yum install java-1.8.0-openjdk* -y

3、添加mesos的yum源

sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm

4、安装mesos,marathon,zookeeper

    yum -y install mesos marathon mesosphere-zookeeper

5、配置zookeeper

   1)#设置文件[/var/lib/zookeeper/myid]为当前mesos-master节点的id,id必须为1-255之中的整数,例如:

master1  #echo 1 > /var/lib/zookeeper/myid

master2 #echo 2 > /var/lib/zookeeper/myid

   2)配置zoo.cfg

#master_node_id为master节点id同该节点[/var/lib/zookeeper/myid]文件的配置,master_node_ip为master节点的ip地址:server.$master_node_id=$master_node_ip:2888:3888

其中第一个端口2888用来集群成员的信息交换,第二个端口3888是在leader挂掉时专门用来进行选举leader所用。

master1 master2

#vim /etc/zookeeper/conf/zoo.cfg

tickTime=2000

initLimit=10

syncLimit=5

dataDir=/var/lib/zookeeper

clientPort=2181

autopurge.snapRetainCount=500

autopurge.purgeInterval=24

server.1=192.168.248.205:2888:3888

server.2=192.168.248.206:2888:3888

server.3=192.168.248.207:2888:3888

server.4=192.168.248.208:2888:3888

server.5=192.168.248.209:2888:3888

 

  3)修改/etc/mesos/zk文件

 

#vim /etc/mesos/zk

完全替换原来内容:

zk://192.168.248.205:2181,192.168.248.206:2181,192.168.248.207:2181,192.168.248.208:2181,192.168.248.209:2181/mesos

  4)设置文件[/etc/mesos-master/quorum]内容为一个大于(master节点数除以2)的整数。注意特例,当master节点数目为2时,quorum文件的值为1。

#echo 1 >/etc/mesos-master/quorum

6、配置mesos和marathon

master1

   mkdir -p /etc/marathon/conf

   echo 192.168.248.205  > /etc/mesos-master/hostname

   echo 192.168.248.205 > /etc/marathon/conf/hostname

   hostnamectl --static set-hostname paas205

master2 

   mkdir -p /etc/marathon/conf

   echo 192.168.248.206  > /etc/mesos-master/hostname

   echo 192.168.248.206 > /etc/marathon/conf/hostname

   hostnamectl --static set-hostname paas206

master1 master2

   cp  /etc/mesos/zk   /etc/marathon/conf/master

   cp  /etc/mesos/zk   /etc/marathon/conf/zk

   sed -i  's|mesos|marathon|g'   /etc/marathon/conf/zk

7、启动mesos,marathon,zookeeper

 systemctl start zookeeper && systemctl enable zookeeper && systemctl start mesos-master && systemctl enable mesos-master && systemctl start marathon && systemctl enable marathon && systemctl disable mesos-slave

 

配置slave节点(slave1 slave2 slave3

1、关闭防火墙与selinux

systemctl stop firewalld && systemctl disable firewalld

   Redhat应用了SELinux去加强平安,永久封闭的举措为:

   修改 /etc/selinux/config 文件中的 SELINUX=”” disabled ,然后重启

2、安装配置jdkntp时间同步,hostname主机映射

3、添加mesosyum

sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm

4、安装mesosmesosphere-zookeeper

  #yum -y install mesos mesosphere-zookeeper

 

 

5、配置zookeeper,步骤参考mesos-master

6、配置mesos-slave信息

slave1

echo 192.168.248.207 > /etc/mesos-slave/hostname

hostnamectl --static set-hostname paas207

slave2

echo 192.168.248.208 > /etc/mesos-slave/hostname

hostnamectl --static set-hostname paas208

slave3

echo 192.168.248.209 > /etc/mesos-slave/hostname

hostnamectl --static set-hostname paas209

7#vim /etc/mesos/zk

zk://192.168.248.205:2181,192.168.248.206:2181,192.168.248.207:2181,192.168.248.208:2181,192.168.248.209:2181/mesos

8、 可用的容器实现机制

vim /etc/mesos-slave/containerizers

     docker,mesos

PS:mesos配置项解析参http://blog.csdn.net/yeasy/article/details/46683297

      常用:--work_dir=VALUE framework 的工作目录,默认为 /tmp/mesos

 

9、启动zookeeper,slave

#systemctl start zookeeper && systemctl enablezookeeper

#systemctl start mesos-slave && systemctl enable mesos-slave

#systemctl disable mesos-master

10、slave上面安装docker

 查看具体服务后台日志信息如mesos-slave:journalctl -f -u  mesos-slave

11、mrathon-lb监控界面

ip:9090/haproxy?stats

展开阅读全文

mesosmarathon搭配使用,marathon无法启动

10-28

n下面是版本信息:nmesos version : mesos-0.25.0-0.2.70.centos701406.x86_64nmarathon version : marathon-0.11.1-1.0.432.el7.x86_64nchronos version : chronos-2.4.0-0.1.20151007110204.el7.x86_64nzookeeper version: mesosphere-zookeeper-3.4.6-0.1.20141204175332.centos7.x86_64nn我通过下面命令在 Centos7上装了mesos,zookeeper,marathon等.nn sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpmn sudo yum install mesos marathon chronos mesosphere-zookeepernn我配置了2个master, ip分别是192.168.253.129 and 192.168.253.130.我也在 [/etc/marathon/conf]目录下创建了master,zk,hostname文件.下面是这3个文件的详情nn1.master>>zk://192.168.253.129:2181,192.168.253.130:2181/mesosn2.zk>>zk://192.168.253.129:2181,192.168.253.130:2181/marathonn3.hostname>>192.168.253.129nn启动mesoso-master服务之后,我可以访问 url [http://192.168.253.129:5050] and http://192.168.253.130:5050,并且看到leader master被成功选举出来.nn但是却无法打开marathon的url[http://192.168.253.129:8080]。n下面是我 [service marathon status -l] 我查看marathon的状态n+++++++++++++++++++++++++++++++++++++++++++++++++++++#localhost]# service marathon status -lnRedirecting to /bin/systemctl status -l marathon.servicenmarathon.service - MarathonnLoaded: loaded (/usr/lib/systemd/system/marathon.service; enabled)nActive: activating (auto-restart) (Result: exit-code) since Sun 2015-10-25 03:03:44 PDT; 1s agonProcess: 6777 ExecStart=/usr/bin/marathon (code=exited, status=1/FAILURE)nMain PID: 6777 (code=exited, status=1/FAILURE)nnOct 25 03:03:44 develop-mesos-master1n#localhost.localdomain systemd[1]: marathon.service: main process exited, code=exited, status=1/FAILUREnOct 25 03:03:44 develop-mesos-master1n#localhost.localdomain systemd[1]: Unit marathon.service entered failed state.nn++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++nn下面是我用命令 [journalctl -o verbose _PID=6777] 查看marathon进程的详细信息。n+++++++++++++++++++++++++++++++++++++++++++++++++++++nn#localhost conf]# journalctl -o verbose _PID=6777n-- Logs begin at Sun 2015-10-25 02:48:41 PDT, end at Sun 2015-10-25 03:18:55 PDT. --nSun 2015-10-25 03:03:44.168930 PDT [s=5827ad02b7164cdeb1947da2c9a80cc6;i=208c;b=8cdffcc7c1c849b887266e94d8cbe621;m=36175ff3;t=522eaf5bed3e2;nPRIORITY=6n_UID=0n_GID=0n_SYSTEMD_SLICE=system.slicen_BOOT_ID=8cdffcc7c1c849b887266e94d8cbe621n_MACHINE_ID=e485efeafe934ce99407be78a4ed3aacnSYSLOG_FACILITY=3n_CAP_EFFECTIVE=1fffffffffn_TRANSPORT=stdoutn_EXE=/usr/bin/bashn_HOSTNAME=develop-mesos-master1n#localhost.localdomainnSYSLOG_IDENTIFIER=marathonnMESSAGE=run_jar --master zk://192.168.253.129:2181,192.168.253.130:2181/mesos --zk zk://192.168.253.129:2181,192.168.253.130:2181/marathn_COMM=marathonn_CMDLINE=/bin/bash /usr/bin/marathonn_SYSTEMD_CGROUP=/system.slice/marathon.servicen_SYSTEMD_UNIT=marathon.servicen_PID=6777n+++++++++++++++++++++++++++++++++++++++++++++++++++++nn有高手能给解答一下吗? 问答

没有更多推荐了,返回首页