千家信息网

DC/OS On-Premises下CLI怎么安装

发表于:2025-02-14 作者:千家信息网编辑
千家信息网最后更新 2025年02月14日,这篇文章主要介绍了DC/OS On-Premises下CLI怎么安装,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。###环境OS:Ce
千家信息网最后更新 2025年02月14日DC/OS On-Premises下CLI怎么安装

这篇文章主要介绍了DC/OS On-Premises下CLI怎么安装,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

###环境

OS:CentOS 7.2 64bit         Kernel:4.3.3IP:     DCOSBootstrap           172.30.250.175  DCOSmaster1                     172.30.250.210  DCOSmaster2                     172.30.250.211  DCOSmaster3                     172.30.250.178DCOSnode1                       172.30.250.18   DCOSnode2                       172.30.250.181DCOSnode3                       172.30.250.182

本地平台只支持centos和coreos,其他操作系统不支持,我用的是centos7.2,自己升的4.3.3的内核,默认3.10的内核也可以,需要支持overlay模块的内核。 七台机器分为三种类型:

Bootstrap:用于DC/OS安装master:运行DC/OSnode:运行服务

安装有三种模式,GUI,CLI,高级模式,这里采用在虚拟机上使用CLI方式安装。

#开始安装

##第一步,配置引导节点ssh到所有节点免密码

1.所有节点生成ssh密钥

$ssh-genkey

2.引导节点上执行以下命令,实现可免密码ssh到远程节点

$ssh-copy-id -i ~/.ssh/id_rsa.pub $remote-host$ssh $remote-host

##第二步,引导节点安装docker

1.升级内核,关防火墙,安装依赖包,添加用户组

$sudo yum update $sudo systemctl stop firewalld && sudo systemctl disable firewalld$sudo yum install -y tar xz unzip curl ipset$sudo sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config $sudo groupadd nogroup

2.生成三个文件,分别是开启overlay,配置SYSTEMD,添加Docker仓库

$ sudo tee /etc/modules-load.d/overlay.conf <<-'EOF'overlayEOF
$ 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
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'[dockerrepo]name=Docker Repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpgEOF

3.重启,查看overlay模块是否已载,显示overlay表示已加载

$ reboot$ lsmod | grep overlayoverlay

4.安装docker,启动docker,要确保所有节点上docker都是启动的

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

##第三步,配置引导节点

首先要确保docker是运行的

1.登陆到引导节点~目录下,下载安装文件,创建安装目录,复制密钥到安装目录

$ curl -O https://downloads.dcos.io/dcos/EarlyAccess/dcos_generate_config.sh$ mkdir -p genconf$ cp ~/.ssh/id_rsa genconf/ssh_key && chmod 0600 genconf/ssh_key

安装文件dcos_generate_config.sh有500多M

2.在genconf目录下创建两个文件 ##genconf/config.yaml 这个文件里写明要安装的所有节点的信息,登陆的用户名密码等:

bootstrap_url: http://183.131.54.102:9001cluster_name: dcoscluster-nameexhibitor_storage_backend: staticip_detect_filename: /genconf/ip-detectmaster_list:- 172.30.250.211- 172.30.250.210- 172.30.250.178resolvers:- 192.168.250.190- 114.255.243.230agent_list:- 172.30.250.181- 172.30.250.182- 172.30.250.18ssh_port: 22ssh_user: rootsuperuser_password:  superuser_username: chenaizhen@qiniu.com

官网的安装指导里resolvers写的是google的DNSservers地址8.8.8.8和8.8.4.4,我这里写的是自己公司的地址。

##genconf/ip-detect 官网的手册上提供了四种ip-detect的方式,下面这种要求主机只能有一个ip,这个文件表示通过节点指定的ip来发现,这个文件执行的结果就是本机的IP。

#!/usr/bin/env bashset -o nounset -o errexitexport PATH=/usr/sbin:/usr/bin:$PATHecho $(ip addr show eth0 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)

3.定制DC/OS 下面这个命令会根据前面写在genconf里两个文件定制创建DC/OS

$ sudo bash dcos_generate_config.sh --genconf

结束后的文件目录:

4.为DC/OS的所有节点安装Docker,配置SELinux等。可以通过以下命令自动的准备所有节点:

$ sudo bash dcos_generate_config.sh --install-prereqsRunning mesosphere/dcos-genconf docker with BUILD_DIR set to /root/genconf====> EXECUTING INSTALL PREREQUISITES====> START install_prereqs====> STAGE install_prereqs====> STAGE install_prereqs====> STAGE install_prereqs====> STAGE install_prereqs====> STAGE install_prereqs====> STAGE install_prereqs====> OUTPUT FOR install_prereqs====> END install_prereqs with returncode: 0====> SUMMARY FOR install_prereqs6 out of 6 hosts successfully completed install_prereqs stage.====> END OF SUMMARY FOR install_prereqs

以上命令可加-v参数显示安装过程,可以看到有如下信息:

#/bin/sh# setenforce is in this pathPATH=$PATH:/sbindist=$(cat /etc/*-release | sed -n 's@^ID="\(.*\)"$@\1@p')if ([ x$dist != 'xrhel' ] && [ x$dist != 'xcentos' ]); then  echo "$dist is not supported. Only RHEL and CentOS are supported" >&2  exit 0fiversion=$(cat /etc/*-release | sed -n 's@^VERSION_ID="\(.*\)"$@\1@p')if [ $version -lt 7 ]; then  echo "$version is not supported. Only >= 7 version is supported" >&2  exit 0fisudo setenforce 0 && sudo sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinuxsudo tee /etc/yum.repos.d/docker.repo <<-'EOF'[dockerrepo]name=Docker Repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpgEOFsudo yum -y updatesudo mkdir -p /etc/systemd/system/docker.service.dsudo tee /etc/systemd/system/docker.service.d/override.conf <<- EOF[Service]ExecStart=ExecStart=/usr/bin/docker daemon --storage-driver=overlay -H fd://EOFsudo yum install -y docker-enginesudo systemctl start dockersudo systemctl enable dockersudo yum install -y wgetsudo yum install -y gitsudo yum install -y unzipsudo yum install -y curlsudo yum install -y xzsudo yum install -y ipsetsudo getent group nogroup || sudo groupadd nogroup

5.安装前验证所有节点是可以安装的

$ sudo bash dcos_generate_config.sh --preflight====> EXECUTING PREFLIGHT====> START run_preflight====> STAGE preflight====> STAGE preflight====> STAGE preflight====> STAGE preflight====> STAGE preflight====> STAGE preflight_cleanup====> STAGE preflight_cleanup====> STAGE preflight_cleanup====> STAGE preflight_cleanup====> STAGE preflight_cleanup====> STAGE preflight====> STAGE preflight_cleanup====> OUTPUT FOR run_preflight====> END run_preflight with returncode: 0====> SUMMARY FOR run_preflight6 out of 6 hosts successfully completed run_preflight stage.====> END OF SUMMARY FOR run_preflight

6.安装DC/OS到所有节点

¥sudo bash dcos_generate_config.sh --deployRunning mesosphere/dcos-genconf docker with BUILD_DIR set to /root/genconf====> EXECUTING DC/OS INSTALLATION====> START install_dcos====> STAGE deploy====> STAGE deploy_cleanup====> STAGE deploy====> STAGE deploy====> STAGE deploy_cleanup====> STAGE deploy_cleanup====> STAGE deploy====> STAGE deploy_cleanup====> STAGE deploy====> STAGE deploy_cleanup====> STAGE deploy====> STAGE deploy_cleanup====> OUTPUT FOR install_dcos====> END install_dcos with returncode: 0====> SUMMARY FOR install_dcos6 out of 6 hosts successfully completed install_dcos stage.====> END OF SUMMARY FOR install_dcos

7.确认服务是否启动正常

Running mesosphere/dcos-genconf docker with BUILD_DIR set to /home/centos/genconf====> dcos_installer.action_lib.prettyprint:: ====> EXECUTING POSTFLIGHT====> dcos_installer.action_lib.prettyprint:: ====> START run_postflight====> dcos_installer.action_lib.prettyprint:: ====> STAGE postflight====> dcos_installer.action_lib.prettyprint:: ====> STAGE postflight====> dcos_installer.action_lib.prettyprint:: ====> STAGE postflight_cleanup====> dcos_installer.action_lib.prettyprint:: ====> STAGE postflight_cleanup====> dcos_installer.action_lib.prettyprint:: ====> END run_postflight with returncode: 0====> dcos_installer.action_lib.prettyprint:: ====> SUMMARY====> dcos_installer.action_lib.prettyprint:: 6 out of 6 hosts successfully completed run_postflight stage.

##最后,登陆 ###zookeeper的监控管理页面 任意选一个master节点的ip都可以登,地址:http://183.131.54.89:8181/exhibitor/v1/ui/index.html

###DC/OS的登陆页面 任意选一个master节点的ip,如http://183.131.54.89,用户名密码为config.yaml里配置的,登陆后的页面

Tip:183.131.54.89是节点172.30.250.177的外网ip ##端口说明:

port 80  mesos-uiport 53  mesos-dnsport 15055 dcos-historyport 5050 mesos-master port 2181 zookeeperport 8080 marathonport 3888 zookeeper port 8181 exhibitorport 8123 mesos-dns

感谢你能够认真阅读完这篇文章,希望小编分享的"DC/OS On-Premises下CLI怎么安装"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!

节点 文件 目录 登陆 配置 内核 命令 密码 篇文章 支持 地址 用户 页面 运行 两个 信息 密钥 方式 模块 模式 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 11g数据库导出给11g 天津市服务器回收价格 用友数据库后台模块 数据库怎么做成日报表 小型erp系统服务器配置 网络安全法律法规讲解视频 数据库模型主要有概念模型 网络技术工程师发展前景 数据库代码用什么符号注释掉 数控系统软件开发工程师 国际版基岩生存服务器 中国百强互联网科技企业 南充免费的外贸数据库哪家提供 万得面试软件开发的薪资 树莓派垃圾分类服务器 珠海mac软件开发 信用社软件开发岗位面试 神经网络技术自动答题答案三年级 通过网络技术炸电脑可能吗 民居建筑数据库 白琦 出租传奇服务器犯法吗 奈菲影视代理服务器出问题怎么办 redhat 服务器远程下载 南昌高新软件开发招聘 余额宝网络安全风险与对策 中科曙光服务器管理密码 广州番禺游戏软件开发公司 线上哪里学软件开发好 烟台市文登区公安局网络安全 专业软件开发服务商
0