Multi-node Mesosphere DC/OS 1.7 on CentOS 7.x

Setup: CentOS 7.2 Minimal + SELINUX Disabled + Firewall Disabled + IPv6 Disabled

— DEPRECATED (may work; not tested lately) —
— Stay tuned for v1.8 instructions —

mesos-boot          2 CPU, 4GB RAM, 60GB HDD
mesos-master-01     2 CPU, 4GB RAM, 60GB HDD + 200GB HDD
mesos-master-02     2 CPU, 4GB RAM, 60GB HDD + 200GB HDD
mesos-master-03     2 CPU, 4GB RAM, 60GB HDD + 200GB HDD
mesos-node-01       4 CPU, 16GB RAM, 200GB HDD
mesos-node-02       4 CPU, 16GB RAM, 200GB HDD
mesos-node-03       4 CPU, 16GB RAM, 200GB HDD
mesos-node-04       4 CPU, 16GB RAM, 200GB HDD
mesos-node-05       4 CPU, 16GB RAM, 200GB HDD
mesos-node-06       4 CPU, 16GB RAM, 200GB HDD
mesos-node-07       2 CPU, 4GB RAM, 60GB HDD (public)

Common script – To be run on every machine

# add docker repo and install docker
cat > /etc/yum.repos.d/docker.repo << '__EOF__'
[docker]
name=Docker Repository - Centos $releasever
baseurl=http://yum.dockerproject.org/repo/main/centos/$releasever
enabled=1
gpgcheck=1
gpgkey=http://yum.dockerproject.org/gpg
__EOF__
 
yum install -y docker-engine-1.11.2 docker-engine-selinux-1.11.2 tar xz unzip curl ipset nfs-utils
yum clean all
 
groupadd nogroup
 
mkdir -p /etc/systemd/system/docker.service.d 
 
cat > /etc/systemd/system/docker.service.d/override.conf << '__EOF__'
[Service] 
ExecStart= 
ExecStart=/usr/bin/docker daemon --storage-driver=overlay --insecure-registry mesos-boot:5000 -H fd:// 
__EOF__
 
systemctl daemon-reload
systemctl enable docker
 
systemctl start docker
 
tee -a /etc/hosts << '__EOF__'
 
192.168.0.160 mesos-boot
 
192.168.0.161 mesos-master-01
192.168.0.162 mesos-master-02
192.168.0.163 mesos-master-03
 
192.168.0.164 mesos-agent-01
192.168.0.165 mesos-agent-02
192.168.0.166 mesos-agent-03
192.168.0.167 mesos-agent-04
192.168.0.168 mesos-agent-05
192.168.0.169 mesos-agent-06
 
192.168.0.170 mesos-agent-07
 
__EOF__

### To be run on bootstrap host | mesos-boot

#=== mesos-bootstrap-generate_config ===

# this URL gets you v1.7 
mkdir /opt/dcos-setup && cd /opt/dcos-setup && curl -O https://downloads.dcos.io/dcos/EarlyAccess/commit/14509fe1e7899f439527fb39867194c7a425c771/dcos_generate_config.sh
 
mkdir -p genconf
 
# this is working for LAB setup; 192.168.x.x
# check other options at https://dcos.io/docs/1.8/administration/installing/custom/advanced/
 
cat > genconf/ip-detect << '__EOF__'
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
echo $(ip addr show ens192 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
__EOF__
 
chmod 755 genconf/ip-detect
 
# your custom config file
cat > genconf/config.yaml << '__EOF__'
---
bootstrap_url: http://mesos-boot:8888       
cluster_name: dcos
exhibitor_storage_backend: static
master_discovery: static
ip_detect_filename: genconf/ip-detect
master_list:
- 192.168.0.161
- 192.168.0.162
- 192.168.0.163
resolvers:
- 8.8.4.4
- 8.8.8.8
__EOF__
 
bash dcos_generate_config.sh

#=== mesos-bootstrap-install-nginx ===

docker run -d --restart=unless-stopped -p 8888:80 -v /opt/dcos-setup/genconf/serve:/usr/share/nginx/html:ro --name=dcos-bootstrap-nginx nginx:alpine

#=== mesos-bootstrap-install-dcos-cli (it can be skipped or done later)

yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm -y
 
yum install python python-pip python-virtualenv python34 -y
 
pip install --upgrade pip
pip install --upgrade virtualenv
 
mkdir -p /opt/dcos
cd /opt/dcos
virtualenv --python=python3.4 --quiet .
 
source bin/activate && pip install --upgrade pip dcoscli httpie
 
dcos config set core.dcos_url http://192.168.0.161
dcos auth login

#=== mesos-bootstrap-nfs-server (it can be skipped or done later)

#yum install nfs-utils
mkdir /var/nfs_share
chmod -R 777 /var/nfs_share
 
tee -a /etc/exports << '__EOF__'
/var/nfs_share    192.168.0.160/28(rw,sync,no_root_squash,no_all_squash)
__EOF__
 
systemctl enable rpcbind
systemctl enable nfs-server
systemctl start rpcbind
systemctl start nfs-server

#=== mesos-master-install ===

mkdir /tmp/dcos && cd /tmp/dcos && curl -O http://mesos-boot:8888/dcos_install.sh && bash dcos_install.sh master

or

for n in 01 02 03; do
    ssh mesos-master-${n} "mkdir /tmp/dcos && cd /tmp/dcos && curl -O http://mesos-boot:8888/dcos_install.sh && bash dcos_install.sh master"
done

URLs
http://192.168.0.161:8181/exhibitor/v1/ui/index.html (check installation status here while masters are baking)

dcos-exhibitor

http://192.168.0.161/ (check installation status here while nodes are baking)

dcos-v1.7

FYI: You won’t see nodes yet.

#=== mesos-slave-node-install ===

mkdir -p /tmp/dcos && cd /tmp/dcos && curl -O http://mesos-boot:8888/dcos_install.sh && bash dcos_install.sh slave

or

for n in 01 02 03 04 05 06; do
    ssh mesos-agent-${n} "mkdir -p /tmp/dcos && cd /tmp/dcos && curl -O http://mesos-boot:8888/dcos_install.sh && bash dcos_install.sh slave"
done

#=== mesos-slave-public-node-install ===

mkdir -p /tmp/dcos && cd /tmp/dcos && curl -O http://mesos-boot:8888/dcos_install.sh && bash dcos_install.sh slave_public && exit

or

for n in 07; do
    ssh mesos-agent-${n} "mkdir -p /tmp/dcos && cd /tmp/dcos && curl -O http://mesos-boot:8888/dcos_install.sh && bash dcos_install.sh slave_public"
done

#=== mesos-all-nodes-nfs-install ===

And mount them on agents if we’ve shared NFS on the boot-node

for n in 01 02 03 04 05 06 07; do
    ssh mesos-agent-${n} "yum install nfs-utils -y && yum clean all && mkdir -p /mnt/nfs && echo "mesos-boot:/var/nfs_share /mnt/nfs nfs hard,bg,tcp,nointr,noac 0 0" >> /etc/fstab && mount /mnt/nfs"
done

#=== node-uninstall ===

/opt/mesosphere/bin/pkgpanda uninstall && rm -fr /opt/mesosphere

3 thoughts on “Multi-node Mesosphere DC/OS 1.7 on CentOS 7.x”

  1. What do you see in exhibitor UI? Please start from here – http://master_ip:8181/

    I had lots of issue when VMs were not big enough or ESX was too much over-subscribed. So many things can go wrong at platform levels and logs.

    Will try to publish v1.8 instructions this weekend; please try that.

    Regards,

Leave a Reply

Your email address will not be published. Required fields are marked *