(1)通过3台机器进行测试
机器IP,角色信息如下:
10.124.3.32 boot
10.124.3.109 master
10.124.3.107 agent
提前在每个节点上做以下操作:
- boot节点与其他节点配置免密
-
yum install -y ipset
- 安装docker 配置overlay
- ...
(2)安装DCOS1.8.8
- 采用命令行模式安装,新建文件夹,准备安装文件
mkdir -p dcos-1.8.8/genconf && cd dcos-1.8.8
-
下载安装包 dcos_generate_config.sh 地址:https://dcos.io/releases/
-
在genconf文件夹中包含以下三个文件
config.yaml
ip-detect
ssh_key
3.1 config.yaml 内容如下:
agent_list:
- 10.124.3.107
auth_enabled: false
bootstrap_url: file:///opt/dcos_install_tmp
cluster_name: DC/OS
exhibitor_storage_backend: static
ip_detect_path: genconf/ip-detect
master_discovery: static
master_list:
- 10.124.3.109
process_timeout: 10000
resolvers:
- 8.8.8.8
- 8.8.4.4
ssh_key_path: genconf/ssh_key
ssh_port: 22
ssh_user: root
telemetry_enabled: false
oauth_enabled: false
3.2 ip-detect 内容如下:(网卡名,根据主机情况不同)
#!/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)
3.3 生成ssh_key
cp /root/.ssh/id_rsa genconf/ssh_key && chmod 0600 genconf/ssh_key
- 树状结构如下图所示
5.依次执行以下命令
bash dcos_generate_config.sh --genconf
bash dcos_generate_config.sh --install-prereqs
bash dcos_generate_config.sh --preflight
bash dcos_generate_config.sh --deploy
bash dcos_generate_config.sh --postflight
6.安装成功后,查看exhibitor和DCOS界面一切正常,发布一个服务进行测试。
安装成功并发布一个应用http://10.124.3.109:8181/exhibitor/v1/ui/index.html
http://10.124.3.109/
(3)升级到1.9.3
前提
- 所有服务组件都健康;
- 参考官网说明;
开始升级
1. 准备升级文件包
升级前目录结构建目录:
mkdir -p dcos-1.8.8-upgrade-to-1.9.3/genconf && cd dcos-1.8.8-upgrade-to-1.9.3/
下载1.9.3安装包:
wget https://downloads.dcos.io/dcos/stable/1.9.3/dcos_generate_config.sh
复制旧文件到新路径:
cp dcos-1.8.8/genconf/config.yaml dcos-1.8.8-upgrade-to-1.9.3/genconf/
cp dcos-1.8.8/genconf/ip-detect dcos-1.8.8-upgrade-to-1.9.3/genconf/
树状结构如下图所示:
2.开始升级
boot节点
1.修改config.yaml文件
修改前
bootstrap_url: file:///opt/dcos_install_tmp
修改后
bootstrap_url: http://10.124.3.32:9527
- 执行以下命令
cd dcos-1.8.8-upgrade-to-1.9.3
sh dcos_generate_config.sh --generate-node-upgrade-script 1.8.8
结果如下图所示:
boot节点执行1
3.启动nginx
cd dcos-1.8.8-upgrade-to-1.9.3/genconf
sudo docker run -d -p 9527:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx
master节点
- 依次执行以下命令
master节点升级成功curl -O http://10.124.3.32:9527/upgrade/d9620348700f4f7fae84e2a91b096584/dcos_node_upgrade.sh
sudo bash dcos_node_upgrade.sh
- 依次查看以下链接判断是否成功
看exhibitor是否可访问
http://10.124.3.109:8181/exhibitor/v1/ui/index.html
看mesos master的metrics中registrar/log/recovered的值
image.png
http://10.124.3.109:5050/metrics/snapshot
看 mesos的版本,DCOS1.8.8 mesos版本是1.0.3; DCOS1.9.3 mesos的版本是1.2.2;
image.png
http://10.124.3.109/mesos
- master节点升级完成,依次升级其他节点。
agent节点
- 依次执行一下命令
agent节点升级成功curl -O http://10.124.3.32:9527/upgrade/d9620348700f4f7fae84e2a91b096584/dcos_node_upgrade.sh
sudo bash dcos_node_upgrade.sh
- 依次查看一下链接判断是否成功
查看mesos agent metrics
mesos agent metrics
http://10.124.3.107:5051/metrics/snapshot
查看mesos agent的版本
image.png
http://10.124.3.107:5051/version
查看mesos UI 查看是否重新加入agent节点
image.png
http://10.124.3.109/mesos/#/agents
最后
查看DCOS UI界面,发现UI已经更改
(4)参考链接
dcos官: https://dcos.io/docs/1.9/installing/upgrading/#docs-article
mesosphere官: https://docs.mesosphere.com/1.9/installing/upgrading/
google论坛,如果是用命令行安装的想要后续升级可以参考: https://groups.google.com/a/dcos.io/forum/#!searchin/users/Upgrading$20/users/J8VtHwSJ9w8/rp_cGrezCQAJ
网友评论