安装DCOS CE
-
创建4个CentOS虚拟机(Bootstrap/Master/Slave*2),如果要安装本地源的话需要至少60GB硬盘
-
选择安装软件-Infrastruction server - Sys Admin Tools/Performance Tools:
准备阶段
准备所有节点环境
- 修改/etc/sysconfig/network-scripts/ifcfg-ens33使网络生效,ping baidu.com是否联通。
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPADDR=192.168.42.100
MASK=255.255.255.0
GATEWAY=192.168.42.1
DNS1=114.114.114.114
DNS2=223.5.5.5
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=ens33
UUID=42f67155-056d-4955-83b5-394646af847a
DEVICE=ens33
ONBOOT=yes
- 安装docker
# yum install docker -y
查看live-restore是否打开,如果打开了需要关闭,改成false。
# cat /etc/docker/daemon.json
{
"live-restore": true
}
- enable docker
# systemctl enable docker && systemctl start docker
- 检查docker是否使用OverlayFS,建议使用:
[root@localhost ~]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 1.13.1
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
- 检查NTP是否启用
# timedatectl
准备Bootstrap节点
- 下载dcos安装脚本,https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh
- 安装NGINX
# sudo docker pull nginx
- disable SELINUX模式
Configure SELINUX=disabled in the /etc/selinux/config file and then reboot! Be ensure the selinux is disabled by the command #getenforce.
准备Cluster节点(所有节点)
- 安装文件解压工具:
# yum install -y tar xz unzip curl ipset
- 查看Linux模式:
# sestatus
如果Current mode是enforcing的模式,需要改成premissive模式。
# sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
如果Current mode是enforcing并且Loaded policy name不是target模式的话,需要改成target模式。
# sed -i 's/SELINUXTYPE=.*/SELINUXTYPE=targeted/g' /etc/selinux/config
- 增加用户:
# groupadd nogroup && groupadd docker
- 修改/etc/hosts:
cat <<EOF >>/etc/hosts
192.168.42.100 bootstrap
192.168.42.110 master_1
192.168.42.120 worker_1
192.168.42.121 worker_2
EOF
- 修改hostname:
# hostnamectl set-hostname <hostname>
- 重新启动
# reboot
准备Slave节点
- 关闭防火墙
# sudo systemctl stop firewalld && sudo systemctl disable firewalld
- 关闭DNSmasq
# systemctl stop dnsmasq && sudo systemctl disable dnsmasq.service
安装DCOS
准备bootstrap
- 准备安装目录
# mkdir /tmp/dcos
# mkdir /tmp/dcos/genconf
- 在genconf目录中建立config.yaml安装配置
bootstrap_url: http://192.168.42.100:8081
cluster_name: Test
exhibitor_storage_backend: static
master_discovery: static
log_directory: /genconf/logs
master_list:
- 192.168.42.110
agent_list:
- 192.168.42.120
- 192.168.42.121
resolvers:
- 114.114.114.114
- 233.5.5.5
- 在genconf目录中建立ip-detect文件
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
echo $(ip addr show ens33 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
- 启动安装docker镜像
# docker run -d -p 8081:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx
安装Master节点
- 建立目录
# mkdir /tmp/dcos && cd /tmp/dcos
- 抓取安装脚本
# curl -O http://192.168.42.100:8081/dcos_install.sh
- 安装Master
# bash dcos_install.sh master
安装Slave节点
- 建立目录
# mkdir /tmp/dcos && cd /tmp/dcos
- 抓取安装脚本
# curl -O http://192.168.42.100:8081/dcos_install.sh
- 安装Master
# bash dcos_install.sh slave
网友评论