Centos7.2 install dcos

Source: Internet
Author: User
Tags tar xz mesosphere

Centos7.2 install dcos
1. Preface

For the container orchestration system, we mainly studied kubernetes some time ago. Now we need dcos in the lab. Therefore, we have built this system on the lab cluster. the dcos version is 1.8.6.
The system used is centos7.2. The machine usage is shown in the following table. The lab cluster has no Internet connection.

Machine ip AddressFunction10.107.18.35 a single boot node 10.107.19.1 a single master node 10.107.13.1504 Server Load balancer nodes 10.107.19.24 Server Load balancer nodes 10.107.19.34 Server Load balancer nodes 10.107.18.394 Server Load balancer nodes

To avoid the need to restart the system when installation fails, complete section 7th. After Docker is installed, back up the system of all machines and restore the system to the backup point when a problem occurs. It is necessary to re-Synchronize the time in step 1 after restoration. System backup reference http://blog.csdn.net/yuanfang_way/article/details/54383616

2. Analysis content

1. Disable firewalld and selinux
2. ssh password-free Login
3. Time Synchronization
4. Install the overlay Module
5. Install docker
6. Install dcos

3. Disable firewalld and selinux.
  • Execute systemctl stop firewalld & systemctl disable firewalld on all machines
    Run firewall-cmd -- status to check whether firewalld is successfully disabled. The not running status is displayed.
  • Execute setenforce 0, sed-I s/SELINUX = enforcing/SELINUX = disabled/g/etc/selinux/config on all machines. After restarting, enter sestatus to view the selinux status. At this time, deabled is displayed.
4. ssh password-free Login

Run ssh-keygen-t rsa on the boot node to generate the key
Run ssh-copy-id-I 10.107.x.x to copy the private key to another machine that wants to log on without a key.

5. Time Synchronization

Reference http://blog.csdn.net/yuanfang_way/article/details/53959591

6. Install the overlay Module

Execute Command

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

Restart and load the overlay module into the system, and execute lsmod | grep overlay to check whether the load is successful. If the load is successful, overlay 42451 0 is displayed.

7. Install docker

First, install docker through rpm or yum install. If there is no network, download the relevant rpm package for docker installation first. Then, set docker storage to overlay, execute the following script:

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

After changing the configuration, run the systemctl daemon-reload command to make the configuration take effect. Then you can start docker as follows:

systemctl start dockersystemctl enable docker

Finally, run the docker info command to check whether docker is installed normally and the storage uses overlay. The correct information is displayed, as shown in figure

8. Install dcos
  1. Download the dcos installer: dcos_generate_config.sh (about 726 MB) on the boot node, and create a genconf directory under the same directory as the dcos_generate_config.sh file, I created mkdir-p genconf cd genconf IN THE/home/dcos directory.
  2. Create an ip-detect file in genconf to detect the ip addresses of nodes in the cluster. The file content is

    #!/bin/bashecho $(ip addr s | grep inet | grep 10.107 | awk -F' ' '{print $2}'|  awk -F'/' '{print $1}')

    You cannot write an error here, because the file content will eventually be copied to/opt/mesosphere/bin/detect_ip on the master and agent nodes, which is used to detect ip addresses when the dcos service is started in step 1. If an error is entered, the cluster cannot be started normally and the following error is reported:

    time="2017-01-13T00:57:22+08:00" level=info msg="/opt/mesosphere/etc/endpoints_config.json not found" time="2017-01-13T00:57:22+08:00" level=error msg="Could not detect IP: fork/exec /opt/mesosphere/bin/detect_ip: exec format error" time="2017-01-13T00:57:22+08:00" level=error msg="Could not get mesos node id: Get http://:5051/state: dial tcp :5051: getsockopt: connection refused" time="2017-01-13T00:57:22+08:00" level=fatal msg="Found unhealthy systemd units" 
  3. Create config in genconf. the yaml file is used for cluster master and agent node configuration. The cluster configuration I use is: agent_list: <ul> <li> 10.107.19.2 </li> <li> 10.107.19.3 </li> <li> 10.107.18.39 </li> <li> 10.107.13.150 auth_enabled: false bootstrap_url: file: /// opt/dcos_install_tmp cluster_name: DC/OS usage: static ip_detect_path: genconf/ip-detect master_discovery: static master_list: </li> <li> 10.107.19.1 process_timeout: 10000 resolvers: </li> <li> 8.8.8.8.8 </li> <li> 8.8.4.4 ssh_key_path: genconf/ssh_key ssh_port: 22 ssh_user: root telemetry_enabled: false oauth_enabled: false
  4. The genconf directory to which the SSH key is copied. The specific command is cp/root/. ssh/id_rsa genconf/ssh_key & chmod 0600 genconf/ssh_key
  5. Run the bash dcos_generate_config.ee.sh -- genconf command to create the installation file and extract the docker container that provides the file for the cluster. After this step is completed, the directory structure under dcos is as follows:
  6. Run bash dcos_generate_config.ee.sh -- install-prereqs to install the dependent environment required by dcos. However, if the cluster is not connected to the Internet, run yum install-y tar xz unzip curl ipset on the master and agent nodes before running this command. Otherwise, an error occurs. The screen output after this step is successful is shown in figure. The red error is prompted because the cluster is not connected to the Internet and can be ignored directly.
  7. Check whether all nodes have met all the requirements for installing and deploying dcos bash dcos_generate_config.ee.sh -- preflight. The boot node checks whether the system environment characters of other nodes do not meet the installation requirements and whether there is a configuration error, or the package is missing or the version is incorrect. After running successfully, it is proved that each machine meets the requirements for deploying dcos. The screen output is as follows. The red error is still caused by no network connection and can be ignored.
  8. Officially install bash dcos_generate_config.ee.sh -- deploy. After the successful environment check in the previous step, execute deploy to deliver the installation image to each node from the boot node, this step is normal in the previous step. After running successfully, dcos has been successfully installed on each machine. If the screen output is shown in red, the error is still ignored.
  9. Make sure that the service is started and bash dcos_generate_config.ee.sh -- postflight runs properly. In this step, boot goes to each node to pull the docker image, those components of DCOS, such as mesos master, slave, marathon, and mesos-dns, are all running in docker. In addition, the specific configuration information is also used by the boot node to help you inject environment variables, this step will not cause any problems. After the dcos service is started successfully, the screen output is shown as follows. The color protection error is still ignored.
  10. Dcos service monitoring and monitoring dcos service URL is http: // <master-public-ip>: 8181/exhibitor/v1/ui/index.html, as shown in, when the status icon of the circle in front of the Hostname is green, it indicates that the DC/OS interface is available.
  11. The interface for logging on to DC/OS to log on to the DC/OS system is http: // <public-master-ip>/. The interface shown in figure

Note: if an error occurs during installation and you need to reinstall it, you need to clear the installed files. The specific method is to create a new uninstall. sh file with the following content. Change the file to an executable file and then execute it.

/opt/mesosphere/bin/pkgpanda uninstall && \rm -rf /opt/mesosphere /var/lib/mesos /var/lib/dcos /var/lib/zookeeper /var/log/mesos /etc/mesosphere /var/lib/mesosphere && \rm -rf /etc/profile.d/dcos.sh /etc/systemd/journald.conf.d/dcos.conf /etc/systemd/system/dcos-cfn-signal.service /etc/systemd/system/dcos-download.service /etc/systemd/system/dcos-link-env.service /etc/systemd/system/dcos-setup.service /etc/systemd/system/multi-user.target.wants/dcos-setup.service /etc/systemd/system/multi-user.target.wants/dcos.target
9. Introduction by the author

Liang mingyuan, a fresh graduate from the National Key Laboratory of distributed computing (PDL) of the National Defense University of Science and Technology, started to contact docker at the beginning of 14 years, I am going to contribute my code to the open-source community of docker for the rest of the study time. After graduation, I am going to continue my research in this area. Email: liangmingyuanneo@gmail.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.