Carlos Vargas

Preparing CentOS Installation for Mesosphere Deployment

Blog Post created by Carlos Vargas on Aug 2, 2016

Introduction

In this guide we will go thru the configuration steps for your CentOS installation. If you don't have a CentOS installation yet you can follow this guide.

 

Set hostname to IP address. example 192-168-1-2

GitLab Repo

curl https://gitlab.com/carlosvargas/devops/raw/master/CentOS/hostname>/tmp/hostname && chmod +x /tmp/hostname && sudo cp /tmp/hostname /etc/dhcp/dhclient.d/


Github Repo

curl https://gist.github.com/containerking/d95cf8634ab0aa12965f9362648178e2 > /tmp/hostname && chmod +x /tmp/hostname && sudo cp /tmp/hostname /etc/dhcp/dhclient.d/

 

Install Required Packages

curl https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm>/tmp/epel-release-latest-7.noarch.rpm

sudo rpm -iUvh /tmp/epel-release-latest-7.noarch.rpm

sudo yum update -y

sudo yum install python python-pip wget tar xz unzip curl ipset open-vm-tools expect ansible -y

sudo pip install virtualenv

 

Setup SSH

mkdir -p ~/.ssh

chown 600 ~/.ssh

ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -P ""

cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

 

Disable Services in CentOS

sudo systemctl stop firewalld && sudo systemctl disable firewalld

 

Configure Docker Repo in CentOS

sudo yum upgrade --assumeyes --tolerant

sudo yum update --assumeyes

sudo tee /etc/modules-load.d/overlay.conf <<-'EOF'

overlay

EOF


sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'

[dockerrepo]

name=Docker Repository

baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/

enabled=1

gpgcheck=1

gpgkey=https://yum.dockerproject.org/gpg

EOF

 

OverlayFS Config #1 (If this fail try next step)

sudo mkdir -p /etc/systemd/system/docker.service.d && sudo tee /etc/systemd/system/docker.service.d/override.conf <<- EOF [Service] ExecStart= ExecStart=/usr/bin/docker daemon --storage-driver=overlay -H fd:// EOF

 

OverlayFS Config #2

/etc/docker/daemon.json configuration file containing; sudo echo "{"storage-driver":"overlay"}" > /etc/docker/daemon.json

 

Install Docker Engine

sudo yum install --assumeyes --tolerant docker-engine sudo systemctl start docker sudo systemctl enable docker

 

Add user to docker group

sudo usermod -G docker username

 

Add user to Wheel (sudo)

sudo usermod -G wheel username

 

Configure Cluster Permissions for DC/OS

sudo sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config && sudo groupadd nogroup && sudo reboot

 

Script to perform all steps described the post

curl https://gist.github.com/containerking/ac10fff2c8b468c9b487564cd3e514a8 > centos4mesos.sh | sudo sh


Code Snippets Available in: Preparing CentOS Installation for Mesosphere Deployment – Container King

Outcomes