Apache Mesos

来自开放百科 - 灰狐
2018年4月28日 (六) 09:56Allen (讨论 | 贡献)的版本

跳转到: 导航, 搜索
Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Apache Mesos Thanks, Wikipedia.

Apache Mesos 是一个分布式、集群管理系统和框架,被称为是分布式系统的内核。

目录

新闻

简介

Mesos是分布式操作系统内核,Mesos是以与Linux内核同样的原则而创建的,不同点仅仅是在于抽象的层面。Mesos内核运行在每一个机器上,同时通过 API 为各种应用提供跨数据中心和云的资源管理调度能力。这些应用包括HadoopSparkKafkaElasticsearch。还可配合框架 Marathon 来管理大规模的Docker等容器化应用。

Mesos特性:

  • 可扩展到10000个节点;
  • 使用 ZooKeeper 实现 Master 和 Slave 的容错;
  • 支持 Docker 容器;
  • 使用 Linux 容器实现本地任务隔离;
  • 多资源调度能力(内存,CPU、磁盘、端口);
  • 提供 JavaPythonC++等多种语言 APIs;
  • 通过 Web 界面查看集群状态;
  • 新版本将支持更多功能。

生态

Mesos ecosystem

指南

OS X

brew install mesos

演示

安装一个 mesos-demo 虚拟机

$ wget http://downloads.mesosphere.io/demo/mesos.box  // 注: 此文件有2.8G
$ vagrant box add --name mesos-demo mesos.box
$ git clone https://github.com/mesosphere/RENDLER.git
$ cd RENDLER
$ vagrant up
http://10.141.141.10:5050/ // Mesos
http://10.141.141.10:8080 // Marathon
$ vagrant ssh
$ cd hostfiles/python
$ python rendler.py http://mesosphere.io 127.0.1.1:5050 42
<Ctrl+C> to stop...
$ cd hostfiles
$ bin/make-pdf

发行版

DC/OS

版本

安装

可参考

本地安装DC/OS集群,可参考Getting Started with DC/OS on Vagrant

vagrant plugin install vagrant-hostmanager
git clone https://github.com/dcos/dcos-vagrant
cd dcos-vagrant
cp VagrantConfig-1m-1a-1p.yaml VagrantConfig.yaml
vagrant up 或 vagrant up --debug

/etc/hosts

192.168.65.90 m1.dcos
192.168.65.111 a1.dcos
192.168.65.60 p1.dcos
192.168.65.50 boot.dcos
ssh [email protected]
http://m1.dcos/
ci/dcos-install-cli.sh

常见问题,boot超时,调整config.vm.boot_timeout数值,修改Vagrantfile文件。

 Vagrant.configure("2") do |config|
 config.vm.boot_timeout = 600

An error occurred in the underlying SSH library that Vagrant uses.The error message is shown below. In many cases, errors from this library are caused by ssh-agent issues. Try disabling your SSH agent or removing some keys and try again.

升级VirtualBox到5.1.x以上,然后

vagrant destroy  
vagrant up

VirtualBox: mount.vboxsf: mounting failed with the error: No such device

vagrant plugin install vagrant-vbguest
vagrant vbguest

[boot] GuestAdditions versions on your host (5.1.30) and guest (5.1.18) do not match.

vagrant plugin install vagrant-vbguest 或 vagrant vbguest --do install
vagrant box update

访问master IPs的Private SSH Key在/Users/huihoo/.vagrant.d/insecure_private_key 或 dcos-vagrant/.vagrant/dcos/private_key_vagrant

cp <path-to-key> genconf/ssh_key && chmod 0600 genconf/ssh_key

运行 sudo bash dcos_generate_config.sh --postflight 出现的错误:detect_ip returned stderr: Device "eth0" does not exist

CentOS 7.x系统中网卡命名规则被重新定义,可能会是”enp0s8”等,CentOS下找不到eth0设备的解决方法

cd /etc/sysconfig/network-scripts/
sudo touch ifcfg-eth0 样本
NAME=eth0
DEVICE=eth0
IPADDR=192.168.65.111
NETMASK=255.255.255.0
NETWORK=192.168.65.0
GATEWAY=192.168.65.1
BROADCAST=192.168.65.255
ONBOOT=yes
USERCTL=yes
BOOTPROTO=static
HWADDR=08:00:27:c1:f9:cc

Unable to login to your DC/OS cluster. Clusters must be connected to the internet.

install_prereqs has been already executed on this host, exiting...

sudo rm -rf dcos-genconf.2d45a8f9e277a60007-5c14d12c3c8eecebcd.tar genconf/
sudo bash dcos_generate_config.sh --web -v

Docker is configured with a production storage driver, Docker存储问题

# systemctl stop docker
# rm -rf /var/lib/docker
vi /etc/sysconfig/docker
OPTIONS='--selinux-enabled=false'
vi /etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS= -s overlay
# systemctl start docker

Checking if port 53 (required by spartan) is in use: FAIL

# netstat -ntlp 53
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1567/dnsmasq

dnsmasq on virbr0 (libvirt) and network manager

virsh net-destroy default
virsh net-undefine default

Error executing DC/OS components health check: exit status 127

使用systemctl status去看相关服务的状态:

dcos-metrics-master.service // activating (auto-restart)
dcos-metrics-master.socket // active (listening)
dcos-metrics-agent.service // activating (start-pre)
dcos-metrics-agent.socket // active (listening)
$ ntptime
$ sudo service ntpd restart
$ ntptime
$ systemctl status dcos-navstar.service

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

将所有节点重启,再 sudo bash dcos_generate_config.sh --postflight

或Uninstall 所有节点 /opt/mesosphere/bin/pkgpanda uninstall && rm -fr /opt/mesosphere 再重新以GUI的方式安装。

并试下dcos-diagnostics工具

卸载

卸载DC/OS

Examples

DC/OS examples

命令行

$ dcos marathon app list
$ docker images
$ docker run mesosphere/mesos_exporter -master http://localhost:5050
$ docker run mesosphere/mesos_exporter -slave http://localhost:5051

Universe

安装、使用Mesosphere Universe包仓库。

构建本地Universe

$ wget https://downloads.mesosphere.com/universe/public/local-universe.tar.gz // 有9.1G
$ docker load < local-universe.tar.gz
...
$ dcos package repo add local-universe http://m1.dcos:8082/repo 
...

文档

Mesos设计文档

DC/OS官方文档

构建DC/OS文档 在build/和build-swagger/目录下会生成各个版本的文档,需要Node.js 8.1.2版本。

git clone https://github.com/mesosphere/dcos-docs-site
cd dcos-docs-site
npm install
make build-api
npm run dev
localhost:3000

常见问题

可能出现的问题:Error: Missing binding

$ npm rebuild node-sass

修改文档路径:webpack.config.js

path: __dirname + './build',

构建时缺少css, js和assets文件,从docs.mesosphere.com拷贝这些文件,并建立一个新的文档镜像:http://dcos.huihoo.comhttp://dcos.huihoo.com/swagger

DC/OS 无法获取PUBLIC_IP

项目

Mesos ecosystem

文档

用户

Apache Mesos 用户

图集

链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱