DC/OS

原创哈,上个星期无意间发现了一个可以好东西

DC/OS

https://dcos.io 这个是官网哈

然后就痛苦的折磨了一个多星期;

基本是参照到https://dcos.io/docs/1.7/administration/installing/custom/advanced/ 这个来弄的,中间遇到不少坑

基本的docker 那些自行安装哈,只写一些细节上面的东西

复制代码
mkdir /tmp/dcos && cd /tmp/dcos
curl -O https://downloads.dcos.io/dcos/EarlyAccess/dcos_generate_config.sh #这个有点久哈 550M
复制代码

然后创建对应的目录:

复制代码
├── dcos-genconf.14509fe1e7899f4395-3a2b7e03c45cd615da.tar
├── dcos_generate_config.sh
└── genconf
    ├── config.yaml
    └── ip-detect
复制代码

genconf 这个文件夹的内容我放在github上面了 https://github.com/jackluo2012/dcos-genconf

先看看config.yaml 中的内容:

复制代码
---
bootstrap_url: http://192.168.1.58:8080 #这个是配置服务器的地址,等会要从这里面下载内容
cluster_name: 'DC/OS' #名称
exhibitor_storage_backend: static #存储方式
ip_detect_filename: /genconf/ip-detect #路由检测,应该是哈
master_list:
- 192.168.1.100 #主机地址
resolvers:
- 192.168.1.254 #这个是dns
- 119.6.6.6 #这个是
oauth_enabled: 'false' #这个是验证,最好关闭,因为是内网,读者可以开启哈,
telemetry_enabled: 'false'#这个也是验证
复制代码
ip-detect

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

然后就是

复制代码
bash dcos_generate_config.sh #放生全局的配置信息
docker run -d -p 8080:80 --name nginx -v $PWD/genconf/serve:/usr/share/nginx/html:ro index.alauda.cn/library/nginx #这个是放到容器里面了
########这个可以测试一下,可以问题了不,我映射的是8080端口,服务器的地址是 192.168.1.58:8080 这个是主服务器的配置地址

复制代码

下面来配置 master:

$ ssh root@192.168.1.100 #连接到master上面
$ mkdir /tmp/dcos && cd /tmp/dcos #放到临时目录下面哈
$ curl -O http://192.168.1.58:8080/dcos_install.sh #下载刚才的文件

然后就是

复制代码
[root@localhost dcos]# bash dcos_install.sh master
Starting DC/OS Install Process
Running preflight checks
Checking if DC/OS is already installed: PASS (Not installed)
PASS Is SELinux disabled?
Checking if docker is installed and in PATH: PASS 
Checking docker version requirement (>= 1.6): PASS (1.9.1)
Checking if curl is installed and in PATH: PASS 
Checking if bash is installed and in PATH: PASS 
Checking if ping is installed and in PATH: PASS 
Checking if tar is installed and in PATH: PASS 
Checking if xz is installed and in PATH: PASS 
Checking if unzip is installed and in PATH: PASS 
Checking if ipset is installed and in PATH: PASS 
Checking if systemd-notify is installed and in PATH: PASS 
Checking if systemd is installed and in PATH: PASS 
Checking systemd version requirement (>= 200): PASS (219)
Checking if group 'nogroup' exists: PASS 
Checking if port 80 (required by mesos-ui) is in use: PASS 
Checking if port 53 (required by mesos-dns) is in use: PASS 
Checking if port 15055 (required by dcos-history) is in use: PASS 
Checking if port 5050 (required by mesos-master) is in use: PASS 
Checking if port 2181 (required by zookeeper) is in use: PASS 
Checking if port 8080 (required by marathon) is in use: PASS 
Checking if port 3888 (required by zookeeper) is in use: PASS 
Checking if port 8181 (required by exhibitor) is in use: PASS 
Checking if port 8123 (required by mesos-dns) is in use: PASS 
Checking Docker is configured with a production storage driver: FAIL (devicemapper, /dev/loop0)

Docker is configured to use the devicemapper storage driver with a loopback
device behind it. This is highly recommended against by Docker and the
community at large for production use[0][1]. See the docker documentation on
selecting an alternate storage driver, or use alternate storage than loopback
for the devicemapper driver.

[0] https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/
[1] http://www.projectatomic.io/blog/2015/06/notes-on-fedora-centos-and-docker-storage-drivers/
#上面是做一些环境检查,如果没有自行安装软件,还有端口检查,因为我是在虚拟机面装的,注意上面有一个FAIL,怎么办呢,动态改了一下shell脚本,把
那个==改成 != ,如果不知道怎么改,留言吧,

294 if [[ "${data_file}" != /dev/loop* ]]; then #在 294行哈

 
复制代码
复制代码
[root@localhost dcos]# bash dcos_install.sh master
Starting DC/OS Install Process
Running preflight checks
Checking if DC/OS is already installed: PASS (Not installed)
PASS Is SELinux disabled?
Checking if docker is installed and in PATH: PASS 
Checking docker version requirement (>= 1.6): PASS (1.9.1)
Checking if curl is installed and in PATH: PASS 
Checking if bash is installed and in PATH: PASS 
Checking if ping is installed and in PATH: PASS 
Checking if tar is installed and in PATH: PASS 
Checking if xz is installed and in PATH: PASS 
Checking if unzip is installed and in PATH: PASS 
Checking if ipset is installed and in PATH: PASS 
Checking if systemd-notify is installed and in PATH: PASS 
Checking if systemd is installed and in PATH: PASS 
Checking systemd version requirement (>= 200): PASS (219)
Checking if group 'nogroup' exists: PASS 
Checking if port 80 (required by mesos-ui) is in use: PASS 
Checking if port 53 (required by mesos-dns) is in use: PASS 
Checking if port 15055 (required by dcos-history) is in use: PASS 
Checking if port 5050 (required by mesos-master) is in use: PASS 
Checking if port 2181 (required by zookeeper) is in use: PASS 
Checking if port 8080 (required by marathon) is in use: PASS 
Checking if port 3888 (required by zookeeper) is in use: PASS 
Checking if port 8181 (required by exhibitor) is in use: PASS 
Checking if port 8123 (required by mesos-dns) is in use: PASS 
Checking Docker is configured with a production storage driver: PASS (devicemapper /dev/loop0)
Creating directories under /etc/mesosphere
Creating role file for master
Configuring DC/OS
Setting and starting DC/OS
复制代码

这样应该就安装好了,可以访问 http://192.168.1.100/这个了

slave 的略了,唯一下载的时候,就用

sudo bash dcos_install.sh slave
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值