DCOS/Install: Difference between revisions

From DER's LLC
Jump to navigation Jump to search
 
No edit summary
 
Line 1: Line 1:
==DER's Documentation==
= DCOS Installation Instructions =  
[[DERs/HomeLab|DER's HomeLab Documentation]]<br>


== LAB Setup ==
* Virtual Machine (2 CPU, 4G Memory, 50G HDD)
* CentOS 7 Minimal
* IP Address Assigned
* Hostname Assigned
* DNS Assigned


[[DERs/Harbor|DER's Docker Repository Setup]] <br>
Master-01:
[[DERs/DERS-DB|DER's MongoDB Documentation]]<br>
hostnamectl set-hostname Master-01.dersllc.com
[[DERs/DERS-DB1|DER's MySQL DB Documentation]]<br>
sed -i 's/172.16.99.150/172.16.99.160/' /etc/sysconfig/network-scripts/ifcfg-ens192
[[DERs/PhotonOS|DER's PhotonOS Documentation]]<br>
yum -y install open-vm-tools
[[DERs/Docker|DER's Docker Documentation]]<br>
yum update -y
[[DERs/DCOS|DER's DCOS Documentation]]<br>
[[DERs/3D|DER's 3D Printer Documentation]]<br>
Slave-01:
[[DERs/MAC|DER's MAC Documentation]]<br>
hostnamectl set-hostname Slave-01.dersllc.com
[[DERs/Horizon|DER's Horizon Documentation]]<br>
sed -i 's/172.16.99.150/172.16.99.161/' /etc/sysconfig/network-scripts/ifcfg-ens192
[[DERs/Templates|DER's Template Documentation]]<br>
yum -y install open-vm-tools
[[DERs/vRA|DER's vRA 8 Documentation]]<br>
yum update -y
[[DERs/K8s|DER's Kubernetes Documentation]]<br>
Web-01:
hostnamectl set-hostname Web-01.dersllc.com
sed -i 's/172.16.99.150/172.16.99.170/' /etc/sysconfig/network-scripts/ifcfg-ens192
yum update -y
yum install -y httpd open-vm-tools
systemctl enable httpd
systemctl start httpd


== Configuration Creation ==
* SSH to <b>Web-01</b>
Install and configure Docker:
yum install -y docker wget
mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/http-proxy.conf << "EOF"
  [Service]
  Environment="HTTPS_PROXY=https://192.168.1.73:3128/"
  Environment="HTTP_PROXY=http://192.168.1.73:3128/"
  Environment="FTP_PROXY=ftp://192.168.1.73:3128/"
  Environment="NO_PROXY=localhost,127.0.0.0/8,dersllc.com"
EOF
cat <<EOF | sudo tee -a /etc/sysconfig/docker
  http_proxy="http://192.168.1.73:3128/"
  https_proxy="https://192.168.1.73:3128/"
  ftp_proxy="ftp://192.168.1.73:3128/"
  no_proxy="localhost,127.0.0.0/8,dersllc.com"
EOF
sudo sed -i '/\[Service\]/a EnvironmentFile=/etc/sysconfig/docker' /usr/lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker


Create GENCONF directory in Apache Directory:
cd /var/www/html
mkdir -p genconf


Download dcos_generate_config.sh file from DCOS.io:
wget https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh


Create admin password hash:
./dcos_generate_config.sh --hash-password <PASSWORD>


<HR>
Create Configuration File and copy in superuser password:
cat > genconf/config.yaml  << "EOF"
  bootstrap_url: http://web-01.dersllc.com/genconf/serve
  cluster_name: LAB
  superuser_username: admin
  superuser_password_hash: $6$rounds=656000$dOTsAHKtm/yBuOCF$iC9m16rE38eZ/iaDLoIgeFSPS9cb1NoBJGmEkHxghAvVkreyq9/Tl.CvYwUQDzot8iO6v6fVIWx7Nx0.yZjOA.
  exhibitor_storage_backend: static
  master_discovery: static
  ip_detect_public_filename: genconf/ip-detect
  master_list:
  - 172.16.99.160
  resolvers:
  - 172.16.87.5
  - 172.16.87.1
  security: 'disabled'
  use_proxy: 'true'
  http_proxy: http://192.168.1.73:3128
  https_proxy: https://192.168.1.73:3128
  no_proxy:
  - 'dersllc.com'
  enable_ipv6: 'false'
EOF


==DREN Documentation ==
Create IP detection script:
[[DREN|DREN Documentation]] <BR>
cat > genconf/ip-detect << "EOF"
<HR>
  #!/usr/bin/env bash
==DevNet Documentation ==
  set -o nounset -o errexit
[[DevNet| DevNet Documentation]] <BR>
  export PATH=/usr/sbin:/usr/bin:$PATH
<HR>
  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


==TDKC Documentation ==
Run Configuration Generator:
[[TDKC|TDKC Documentation]] <BR>
./dcos_generate_config.sh
<HR>
systemctl restart httpd
==VMware Documentation==
 
[[VMware|VMware Documentation]] <BR>
== Master / Slave Prerequisites ==
echo "proxy=http://192.168.1.73:3128" >> /etc/yum.conf                                                                          <b># ONLY REQUIRED FOR DERSLLC ENVIRONMENT</b>
yum -y install ipset tar xz unzip curl docker docker-selinux chrony&> /dev/null
yum -y upgrade &> /dev/null
systemctl start chronyd
systemctl enable chronyd
cat > /etc/chrony.conf  << "EOF"
  server 192.168.1.73
  server 0.vmware.pool.ntp.org
  server 1.vmware.pool.ntp.org
  server 2.vmware.pool.ntp.org
  server 3.vmware.pool.ntp.org
  allow 192.168.1.0/24
EOF
systemctl restart chronyd
mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/http-proxy.conf << "EOF"
  [Service]
  Environment="HTTPS_PROXY=https://192.168.1.73:3128/"
  Environment="HTTP_PROXY=http://192.168.1.73:3128/"
  Environment="FTP_PROXY=ftp://192.168.1.73:3128/"
  Environment="NO_PROXY=localhost,127.0.0.0/8,dersllc.com"
EOF
cat <<EOF | sudo tee -a /etc/sysconfig/docker
  http_proxy="http://192.168.1.73:3128/"
  https_proxy="https://192.168.1.73:3128/"
  ftp_proxy="ftp://192.168.1.73:3128/"
  no_proxy="localhost,127.0.0.0/8,dersllc.com"
EOF
sudo sed -i '/\[Service\]/a EnvironmentFile=/etc/sysconfig/docker' /usr/lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker
grep -q Restart=on-failure /usr/lib/systemd/system/docker.service && printf 'Restart function is already set in systemd script' || sed -i '/MountFlags=slave/aRestart=on-failure' /usr/lib/systemd/system/docker.service
systemctl daemon-reload 
systemctl enable docker.service
systemctl start docker.service
systemctl disable firewalld          <b># DCOS requires this firewall to be shut off. https://docs.mesosphere.com/1.7/administration/installing/custom/system-requirements/</b>
systemctl stop firewalld
mkdir -p /var/{lib,log}/mesos
chown nobody /var/{lib,log}/mesos
touch /var/marathon.ip
chown /var/marathon.ip
groupadd nogroup -g 9999
groupadd docker
mkdir -p /tmp/dcos && cd /tmp/dcos
curl -s http://web-01.dersllc.com/genconf/serve/dcos_install.sh > dcos_install.sh                          <b> # Change this to the Web Server hosting the Configuration</b>
 
== Master Installation ==
* SSH to <b>Master-01</b>
# Creating installDCOS.sh script
echo "setenforce 0"  > /root/installDCOS.sh
echo "sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/sysconfig/selinux" >> /root/installDCOS.sh
echo "/bin/bash /tmp/dcos/dcos_install.sh master" >> /root/installDCOS.sh
echo "mkdir -p /var/log/mesos/archive" >> /root/installDCOS.sh
echo "echo 'ENABLE_CHECK_TIME=false' >> /opt/mesosphere/environment" >> /root/installDCOS.sh
echo "curl -fLsS --retry 20 -Y 100000 -y 60 https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-1.12/dcos -o dcos"  >> /root/installDCOS.sh
echo "mv dcos /usr/local/bin"  >> /root/installDCOS.sh
echo "chmod +x /usr/local/bin/dcos"  >> /root/installDCOS.sh
echo "dcos config set core.dcos_url http://Master-01.dersllc.com"  >> /root/installDCOS.sh                        <b> # Replace the IP with the IP or DNS name of your Master host </b>
echo "sed -i 's/"clock_sync"\:/"clock_sync1"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
echo "sed -i '/"clock_sync"/d' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
echo "sed -i 's/"journald_dir_permissions",/"journald_dir_permissions"/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
echo "sed -i 's/"clock_sync1"\:/"clock_sync"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
chmod 777 /root/installDCOS.sh
# Running the DCOS Installation Script (AS ROOT)
/root/installDCOS.sh
 
== Slave Installation ==
* SSH to <b>Slave-01</b>
# Creating the Install Script
echo "setenforce 0"  > /root/installDCOS.sh
echo "sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/sysconfig/selinux" >> /root/installDCOS.sh
echo "/bin/bash /tmp/dcos/dcos_install.sh slave" >> /root/installDCOS.sh
echo "DCOS_CONFIG=\`grep -ir 'MESOS_HOSTNAME_LOOKUP=false' /opt/mesosphere/packages/dcos-config* | grep mesos-slave-common | cut -d ':' -f 1\`"  >> /root/installDCOS.sh
echo "for i in \$DCOS_CONFIG; do sed -i 's~MESOS_HOSTNAME_LOOKUP=.*~MESOS_HOSTNAME_LOOKUP=true~' \$i; done"  >> /root/installDCOS.sh
echo "rm -rf /var/lib/mesos/slave/meta/slaves/latest" >> /root/installDCOS.sh
echo "echo 'ENABLE_CHECK_TIME=false' >> /opt/mesosphere/environment" >> /root/installDCOS.sh
echo "sed -i 's/"clock_sync"\:/"clock_sync1"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
echo "sed -i '/"clock_sync"/d' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
echo "sed -i 's/"journald_dir_permissions",/"journald_dir_permissions"/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
echo "sed -i 's/"clock_sync1"\:/"clock_sync"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh
chmod 777 /root/installDCOS.sh
# Running the DCOS Installation Script (AS ROOT)
/root/installDCOS.sh

Latest revision as of 19:20, 2 June 2023

DCOS Installation Instructions

LAB Setup

  • Virtual Machine (2 CPU, 4G Memory, 50G HDD)
  • CentOS 7 Minimal
  • IP Address Assigned
  • Hostname Assigned
  • DNS Assigned

Master-01:

hostnamectl set-hostname Master-01.dersllc.com
sed -i 's/172.16.99.150/172.16.99.160/' /etc/sysconfig/network-scripts/ifcfg-ens192
yum -y install open-vm-tools
yum update -y

Slave-01:

hostnamectl set-hostname Slave-01.dersllc.com
sed -i 's/172.16.99.150/172.16.99.161/' /etc/sysconfig/network-scripts/ifcfg-ens192 
yum -y install open-vm-tools
yum update -y

Web-01:

hostnamectl set-hostname Web-01.dersllc.com
sed -i 's/172.16.99.150/172.16.99.170/' /etc/sysconfig/network-scripts/ifcfg-ens192
yum update -y
yum install -y httpd open-vm-tools
systemctl enable httpd
systemctl start httpd

Configuration Creation

  • SSH to Web-01

Install and configure Docker:

yum install -y docker wget
mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/http-proxy.conf << "EOF"
 [Service]
 Environment="HTTPS_PROXY=https://192.168.1.73:3128/"
 Environment="HTTP_PROXY=http://192.168.1.73:3128/"
 Environment="FTP_PROXY=ftp://192.168.1.73:3128/"
 Environment="NO_PROXY=localhost,127.0.0.0/8,dersllc.com"
EOF

cat <<EOF | sudo tee -a /etc/sysconfig/docker
 http_proxy="http://192.168.1.73:3128/"
 https_proxy="https://192.168.1.73:3128/"
 ftp_proxy="ftp://192.168.1.73:3128/"
 no_proxy="localhost,127.0.0.0/8,dersllc.com"
EOF

sudo sed -i '/\[Service\]/a EnvironmentFile=/etc/sysconfig/docker' /usr/lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker

Create GENCONF directory in Apache Directory:

cd /var/www/html
mkdir -p genconf

Download dcos_generate_config.sh file from DCOS.io:

wget https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh

Create admin password hash:

./dcos_generate_config.sh --hash-password <PASSWORD>

Create Configuration File and copy in superuser password:

cat > genconf/config.yaml  << "EOF"
 bootstrap_url: http://web-01.dersllc.com/genconf/serve
 cluster_name: LAB
 superuser_username: admin
 superuser_password_hash: $6$rounds=656000$dOTsAHKtm/yBuOCF$iC9m16rE38eZ/iaDLoIgeFSPS9cb1NoBJGmEkHxghAvVkreyq9/Tl.CvYwUQDzot8iO6v6fVIWx7Nx0.yZjOA.
 exhibitor_storage_backend: static
 master_discovery: static
 ip_detect_public_filename: genconf/ip-detect
 master_list:
 - 172.16.99.160
 resolvers:
 - 172.16.87.5
 - 172.16.87.1
 security: 'disabled'
 use_proxy: 'true'
 http_proxy: http://192.168.1.73:3128
 https_proxy: https://192.168.1.73:3128
 no_proxy:
 - 'dersllc.com'
 enable_ipv6: 'false'
EOF

Create IP detection script:

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

Run Configuration Generator:

./dcos_generate_config.sh
systemctl restart httpd

Master / Slave Prerequisites

echo "proxy=http://192.168.1.73:3128" >> /etc/yum.conf                                                                           # ONLY REQUIRED FOR DERSLLC ENVIRONMENT
yum -y install ipset tar xz unzip curl docker docker-selinux chrony&> /dev/null
yum -y upgrade &> /dev/null
systemctl start chronyd
systemctl enable chronyd 
cat > /etc/chrony.conf  << "EOF"
 server 192.168.1.73
 server 0.vmware.pool.ntp.org
 server 1.vmware.pool.ntp.org
 server 2.vmware.pool.ntp.org
 server 3.vmware.pool.ntp.org
 allow 192.168.1.0/24
EOF

systemctl restart chronyd
mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/http-proxy.conf << "EOF"
 [Service]
 Environment="HTTPS_PROXY=https://192.168.1.73:3128/"
 Environment="HTTP_PROXY=http://192.168.1.73:3128/"
 Environment="FTP_PROXY=ftp://192.168.1.73:3128/"
 Environment="NO_PROXY=localhost,127.0.0.0/8,dersllc.com"
EOF

cat <<EOF | sudo tee -a /etc/sysconfig/docker
 http_proxy="http://192.168.1.73:3128/"
 https_proxy="https://192.168.1.73:3128/"
 ftp_proxy="ftp://192.168.1.73:3128/"
 no_proxy="localhost,127.0.0.0/8,dersllc.com"
EOF

sudo sed -i '/\[Service\]/a EnvironmentFile=/etc/sysconfig/docker' /usr/lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker
grep -q Restart=on-failure /usr/lib/systemd/system/docker.service && printf 'Restart function is already set in systemd script' || sed -i '/MountFlags=slave/aRestart=on-failure' /usr/lib/systemd/system/docker.service
systemctl daemon-reload  
systemctl enable docker.service
systemctl start docker.service
systemctl disable firewalld           # DCOS requires this firewall to be shut off. https://docs.mesosphere.com/1.7/administration/installing/custom/system-requirements/
systemctl stop firewalld
mkdir -p /var/{lib,log}/mesos
chown nobody /var/{lib,log}/mesos
touch /var/marathon.ip
chown /var/marathon.ip
groupadd nogroup -g 9999
groupadd docker

mkdir -p /tmp/dcos && cd /tmp/dcos
curl -s http://web-01.dersllc.com/genconf/serve/dcos_install.sh > dcos_install.sh                            # Change this to the Web Server hosting the Configuration

Master Installation

  • SSH to Master-01
# Creating installDCOS.sh script
echo "setenforce 0"  > /root/installDCOS.sh
echo "sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/sysconfig/selinux" >> /root/installDCOS.sh
echo "/bin/bash /tmp/dcos/dcos_install.sh master" >> /root/installDCOS.sh
echo "mkdir -p /var/log/mesos/archive" >> /root/installDCOS.sh
echo "echo 'ENABLE_CHECK_TIME=false' >> /opt/mesosphere/environment" >> /root/installDCOS.sh
echo "curl -fLsS --retry 20 -Y 100000 -y 60 https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-1.12/dcos -o dcos"  >> /root/installDCOS.sh
echo "mv dcos /usr/local/bin"  >> /root/installDCOS.sh
echo "chmod +x /usr/local/bin/dcos"  >> /root/installDCOS.sh
echo "dcos config set core.dcos_url http://Master-01.dersllc.com"  >> /root/installDCOS.sh                          # Replace the IP with the IP or DNS name of your Master host 
echo "sed -i 's/"clock_sync"\:/"clock_sync1"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
echo "sed -i '/"clock_sync"/d' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
echo "sed -i 's/"journald_dir_permissions",/"journald_dir_permissions"/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
echo "sed -i 's/"clock_sync1"\:/"clock_sync"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
chmod 777 /root/installDCOS.sh

# Running the DCOS Installation Script (AS ROOT) 
/root/installDCOS.sh

Slave Installation

  • SSH to Slave-01
# Creating the Install Script
echo "setenforce 0"  > /root/installDCOS.sh
echo "sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/sysconfig/selinux" >> /root/installDCOS.sh
echo "/bin/bash /tmp/dcos/dcos_install.sh slave" >> /root/installDCOS.sh
echo "DCOS_CONFIG=\`grep -ir 'MESOS_HOSTNAME_LOOKUP=false' /opt/mesosphere/packages/dcos-config* | grep mesos-slave-common | cut -d ':' -f 1\`"  >> /root/installDCOS.sh
echo "for i in \$DCOS_CONFIG; do sed -i 's~MESOS_HOSTNAME_LOOKUP=.*~MESOS_HOSTNAME_LOOKUP=true~' \$i; done"  >> /root/installDCOS.sh
echo "rm -rf /var/lib/mesos/slave/meta/slaves/latest" >> /root/installDCOS.sh
echo "echo 'ENABLE_CHECK_TIME=false' >> /opt/mesosphere/environment" >> /root/installDCOS.sh
echo "sed -i 's/"clock_sync"\:/"clock_sync1"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
echo "sed -i '/"clock_sync"/d' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
echo "sed -i 's/"journald_dir_permissions",/"journald_dir_permissions"/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
echo "sed -i 's/"clock_sync1"\:/"clock_sync"\:/' /opt/mesosphere/etc/dcos-diagnostics-runner-config.json"  >> /root/installDCOS.sh 
chmod 777 /root/installDCOS.sh

# Running the DCOS Installation Script (AS ROOT) 
/root/installDCOS.sh