Bluemix平台打造DC/OS云计算平台(二)

9 篇文章 0 订阅
7 篇文章 0 订阅

上篇文章(http://blog.csdn.net/rapheler/article/details/52528609)介绍了DC/OS软件的基本组件,概念,相信大家对DC/OS已经有了一个大概的理解了,今天实战安装一下DC/OS,来看看大名鼎鼎的DC/OS的容貌。


官方推荐的安装需求是一个节点2核CPU,16GB RAM,60GB HDD。

对于Bootstrap节点要求:

  • Python, pip must be installed for DC/OS CLI.

  • A High-availability (HA) TCP/Layer 3 load balancer, such as HAProxy, to balance the following TCP ports to all master nodes: 80, 443, 8080, 8181, 2181, 5050. (If applicable)

  • An unencrypted SSH key that can be used to authenticate with the cluster nodes over SSH. Encrypted SSH keys are not supported.


以下是对Master节点的硬件要求:


Minimum Recommended
Nodes: 1
OS: RHEL/CentOS 7.2
Processor: 4 cores
Memory: 32 GB RAM
Hard disk space: 120 GB
Nodes: 3
OS: RHEL/CentOS 7.2
Processor: 4 cores
Memory: 32 GB RAM
Hard disk space: 120 GB

There are many mixed workloads on the masters, for example Mesos replicated log and ZooKeeper. Some of these require fsync()ing every so often, and this can generate a lot of very expensive random I/O. We recommend the following:

  • Solid-state drive (SSD)
  • RAID controllers with a BBU
  • RAID controller cache configured in writeback mode

Agent nodes

Here are the agent node hardware requirements.

Minimum Recommended
Nodes: 1
OS: RHEL/CentOS 7.2
Processor: 2 cores
Memory: 16 GB RAM
Hard disk space: 60 GB
Nodes: 6 or more
OS: RHEL/CentOS 7.2
Processor: 2 cores
Memory: 16 GB RAM
Hard disk space: 60 GB
The agent nodes must also have:
  • /var directory with 10 GB or more of free space. This directory is used by the sandbox for both Docker and Mesos Containerizer.
  • Network Access to a public Docker repository or to an internal Docker registry.

根据官方文档介绍,至少需要三个节点来运行一整套DC/OS系统,因为我只能从Bluemix 英国区申请到2台高性能的虚拟机,所以就用2台机器来安装,由于机器有限,Bootstrap就跟Master用一台了:


Nmae IP OS Role Mem CPU
ukcent1 192.168.0.22 CentOS7.2 DC/OS Master 4GB Intel Xeon E312xx
ukcent2 192.168.0.23 CentOS7.2 DC/OS Slave 4GB Intel Xeon E312xx
在安装之前先要做一些系统环境准备:

1.升级系统到最新版本

yum -y update

2.关闭防火墙

systemctl stop firewalld && systemctl mask firewalld

在Github上已经有一个open的issue https://github.com/docker/docker/issues/16137

Docker与firewalld 一起工作的效果会很差https://docs.docker.com/v1.6/installation/centos/#firewalld

3.开启SSHD,ICMP,NTP服务


软件环境准备:

1.Docker 1.9.* - 1.11.* 

!!!Docker 1.12目前暂不支持

2.不要使用DeviceMapper localhost存储方式, 推荐使用DeviceMapper 附加裸设备LVM的方式,或者使用OverlayFS

可以这篇文章来更改DeviceMapper为OverlayFS:http://blog.csdn.net/rapheler/article/details/52094095

3.用户root用户运行Docker服务

4.普通用户开启sudo 免密码认证

visudo %wheel ALL=(ALL) NOPASSWD: ALL

5.在所有节点安装xz unzip curl ipset

6.禁用selinux,添加nogroup组到所有节点

7.所有的Master节点提前pull nginx镜像

docker pull nginx


准备好以上条件后,开启我们的正式安装之旅。

官方文档介绍的是有一个bootstrap node,专门用来做bootstrap的,由于我只有2台机器,就直接用Master做bootstrap了,在Master节点上下载安装脚本:


1
$ curl -O https: //downloads .dcos.io /dcos/EarlyAccess/dcos_generate_config .sh

脚本有500多MB,下载时间基于你的网络环境,好在Bluemix英国是基于Softlayer的网络,记得IBM销售提过,Softlayer全球的各个节点的最大延迟是200ms,并且各个节点之间有高速网络带宽,具体数字记不清楚了,有知道的,请留言相告,谢谢。


DC/OS提供两种的安装方式,一个是基于command line的,一个是基于web GUI的,今天就做基于web GUI的方式安装DC/OS:


1
sudo  bash  dcos_generate_config.sh --web


会开启本机的9000端口,信息如下:


1
2
3
Running mesosphere /dcos-genconf  docker with BUILD_DIR  set  to  /home/centos/genconf
16:36:09 dcos_installer.action_lib.prettyprint:: ====> Starting DC /OS  installer  in  web mode
16:36:09 root:: Starting server ( '0.0.0.0' , 9000)

打开我的Master公网ip:9000就会看到安装界面了:


dcos-gui-install.png


点击完"Begin Installation"之后就会跳到如下界面,


dcos-gui-preflight.png


需要填写的信息:

  • Master Private IP List

  • Agent Private IP List

  • Master Public IP

  • SSH Username, Port and Private Key

  • Upstream DNS Servers

  • IP Dect Script

需要注意的就是最后的IP Dect Script,里面预留的是有AWS、GCE、Azure环境的脚本,但是如果是Custom Install的话,就是咱们今天的安装方式,

就需要自己写脚本来取出系统的ip:


1
2
3
4
#!/usr/bin/env bash
set  -o nounset -o errexit
export  PATH= /usr/sbin : /usr/bin :$PATH
echo  $(ip addr show eth0 |  grep  -Eo  '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'  head  -1)



然后点击“Run Pre-Flight”,如果没有什么问题,会看到:



dcos-gui-deploy.png


因为我只使用的2台机器,第一次安装的时候Master节点内存不够用了,重新安装了一次在成功,如果需要重新安装,就需要完全删除/opt/mesosphere 和 /var/lib/zookeeper目录。


然后点击“Deploy”:

dcos-gui-postflight.png



最后是“Run Post-Flight”。完成后会看到登录界面:



dcos-gui-login.png


使用自己的Github账号登录进去,就可以领略云数据中心内核的风采啦:




wKiom1dzP7eBSYYxAAHf1RfC3yY094.png-wh_50



wKiom1dzP7jT2sxqAAB92kpDN3g932.png-wh_50



wKioL1dzP7miNTfHAAIrWzBhaxg552.png-wh_50



wKiom1dzP7njM9YHAADZxiwsXE0849.png-wh_50



wKioL1dzP7rirTGuAAEDDtdEEo0331.png-wh_50



至此DC/OS就只用了两台Bluemix的公有云机器搭建完成了,赞一下我老东家IBM家的服务很稳定,高性能,服务响应快。



参考连接:

https://dcos.io/docs/1.7/administration/installing/custom/gui/

https://github.com/dcos/dcos

https://dcos.io/docs/1.7/usage/





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值