Mesosphere DCOS的安装方式bash install。安装环境如下:
主要分为Workstation, Master, and slave installation.
Workstation在安装过程中,所扮演的角色主要有:
# install the necessary packages sudo yum -y install tar xz unzip curl docker
# start docker service sudo systemctl enable docker sudo systemctl start docker
# pull nginx image from the docker hub sudo docker pull nginx
# launch a container running zookeeper for shared storage sudo docker run -d -p 2181:2181 -p 2888:2888 -p 3888:3888 --name =dcos_int_zk jplock/zookeeper
接下来需要准备安装所需的脚本等文件
mkdir -p dcos/genconf touch dcos/genconf/ip-detect chmod +x dcos/genconf/ip-detect
可以直接使用下述shell代码获取i:
#!/usr/bin/env bash set -o nounset -o errexit export PATH=/usr/sbin:/usr/bin:$PATH echo $(ip addr show eth0 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
DCOS的安装需要(zoues)配置文件(现在是yaml文件),这个可以多看看官方文档:
touch dcos/genconf/config.json
将以下代码输入到config.json中去。
{ "bootstrap_url":"http://<workstation_ip>:<your_port>", "cluster_name": "<cluster-name>", "exhibitor_storage_backend": "zookeeper", "exhibitor_zk_hosts": "<host1>:<port1>", "exhibitor_zk_path": "/dcos", "master_discovery":"static", "master_list": "[\"<master-ip-1>\",\"<master-ip-2>\",\"<master-ip-3>\"]", "resolvers": "[\"<dns-resolver-1>\"]" }
我自己的config.json如下:
{ “bootstrap_url”: "http://10.134.29.179:8088", "cluster_name": "DCOS zoues", "exhibitor_storage_backend": "zookeeper", "exhibitor_zk_hosts": "10.134.29.179:2181", "exhibitor_zk_path": "/dcos", "master_discovery":"static", "master_list": "[\"10.134.29.134\",\"10.134.29.135\",\"10.134.29.136\"]", "resolvers": "[\"10.134.29.134\",\"10.134.29.135\",\"10.134.29.136\"]" }
然后就是:
cd dcos sudo bash dcos_generate_config.sh
执行完成后,会生成genconf文件夹,最后启动nginx,以完成后续的安装工作。workstation firewall需要开启端口port,80, 8088, 2181, 2888, 3888
sudo docker run -p 8088:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx
Master节点的安装
# install the necessary packages sudo yum install -y tar xz unzip curl docker
# start docker service sudo systemctl enable docker
# create the necessary group sudo groupadd nogroup
# configure SELinux sudo sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config
sudo reboot
完成上述步骤以后,进行Master正式安装。
mkdir /tmp/dcos cd /tmp/dcos curl -O http://<workstation-ip>:<your_port>/dcos_install.sh sudo bash dcos_install.sh master
就是先前我们在Installation of Workstation中所设定的。我的是10.134.29.179:8088。
注意:Workstation的firewalld的端口开启port,53, 5050, 5051,8080, 8181, 2181, 2888, 3888
在三个Master安装完成后,我们可以登陆到URL上进行查看(http://<master-ip>:8181/exhibitor/v1/ui/index.html)。如果看到三個节点,且都亮灯亮着就代表成功了。
和Master node的安装步骤类似,只是将master改成slave。
sudo bash dcos_install.sh slave
注意:端口问题
这样Mesosphere DCOS 就安装完成了,最新的安装文档可以查看mesosphere官网!谢谢
查看原文:http://www.zoues.com/index.php/2016/03/07/mesosphere-dcos-zoues/