开始前完成DC/OS部署前准备
链接: https://www.jianshu.com/p/38bcc98258fb
boot节点上操作
生成genconf目录
# mkidr /opt/mesosphere/genconf && cd /opt/mesosphere/genconf
设置自定义安装配置
配置路径 /opt/mesosphere/genconf/config.yaml
# cat config.yaml
agent_list:
- 192.168.22.192
- 192.168.22.193
bootstrap_url: http://192.168.22.190:8080
cluster_name: test
exhibitor_storage_backend: static
master_discovery: static
master_list:
- 192.168.22.191
resolvers:
- 8.8.4.4
- 8.8.8.8
ssh_port: 22
ssh_user: centos
dcos_overlay_enable: true
dcos_overlay_mtu: 9001
dcos_overlay_config_attempts: 6
dcos_overlay_network:
vtep_subnet: 44.128.0.0/20
vtep_mac_oui: 70:B3:D5:00:00:00
overlays:
- name: dcos
subnet: 9.0.0.0/8
prefix: 26
- name: dcos-1
subnet: 192.168.0.0/16
prefix: 24
构建IP Detect脚本
配置路径 /opt/mesosphere/genconf/ip-detect
# cat ip-detect
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
echo $(ip addr show ens32 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
下载DC/OS Installer
# cd /opt/mesosphere
# curl -O https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh
生成自定义集群安装包
# bash dcos_generate_config.sh
通过HTTP发布serve目录
通过Nginx容器镜像或其它手段将./genconf/serve/目录通过HTTP开放给待装节点访问。
# docker run -d -p 8080:80 -v /opt/mesosphere/genconf/serve:/usr/share/nginx/html:ro nginx
master-01节点操作
安装master节点
# mkdir /tmp/dcos && cd /tmp/dcos
# wget http://192.168.22.190:8080/dcos_install.sh
# bash dcos_install.sh master
node-01 node-02 节点上操作
安装agent节点
# mkdir /tmp/dcos && cd /tmp/dcos
# wget http://192.168.22.190:8080/dcos_install.sh
# bash dcos_install.sh slave
登录Exhibitor控制台确认ZK服务正常
http://192.168.22.191:8181/exhibitor/v1/ui/index.html
登录DC/OS WEB UI查看集群状态
http://192.168.22.191
登录Marathon UI
http://192.168.22.191:8080