Skip to content

Commit

Permalink
minor 文档更新
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Jul 23, 2018
1 parent dd19fa4 commit fd4816b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
23 changes: 20 additions & 3 deletions docs/op/cluster_restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ k8s 集群可能因为软硬件故障或者误操作出现了不可自愈的问

首先用kubeasz 搭建一个测试集群,部署几个测试deployment,验证集群各项正常后,进行一次备份:

- 1.在一个etcd节点上执行数据备份,把生产的备份文件`snapshot.db`复制到所有etcd集群节点
- 1.在一个etcd节点上执行数据备份,把产生的备份文件`snapshot.db`复制到所有etcd集群节点

``` bash
$ mkdir -p /backup/k8s/ && cd /backup/k8s
Expand Down Expand Up @@ -90,15 +90,32 @@ $ ansible-playbook /etc/ansible/tools/change_k8s_network.yml
$ ansible-playbook /etc/ansible/23.backup.yml
```

执行完毕可以在目录 `/etc/ansible/roles/cluster-backup/files`下检查备份情况
执行完毕可以在目录 `/etc/ansible/roles/cluster-backup/files`下检查备份情况,示例如下:

``` bash
roles/cluster-backup/files/
├── ca # 集群CA 相关备份
│   ├── ca-config.json
│   ├── ca.csr
│   ├── ca-csr.json
│   ├── ca-key.pem
│   └── ca.pem
├── hosts # ansible hosts备份
│   ├── hosts # 最近的备份
│   └── hosts-201807231642
├── readme.md
└── snapshot # etcd 数据备份
├── snapshot-201807231642.db
└── snapshot.db # 最近的备份
```

- 二.模拟集群故障

``` bash
$ ansible-playbook /etc/ansible/99.clean.yml
```

因为步骤一中已经备份了,为了模拟集群彻底崩溃,这里清理整个集群;实际操作中,在有备份前提下,也建议彻底清理集群后再尝试去恢复
**注意** 为了模拟集群彻底崩溃,这里清理整个集群;实际操作中,在有备份前提下,也建议彻底清理集群后再尝试去恢复

- 三.集群恢复

Expand Down
2 changes: 1 addition & 1 deletion tools/change_ip_aio.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 敬告:本脚本仅作测试交流使用
# 敬告:本脚本仅作测试交流使用,详细操作说明请参阅docs/op/change_ip_allinone.md
# 此脚本仅用于allinone部署情况下,需要修改host ip地址使用(比如,虚机装完allinone部署,克隆或者复制分享给别人测试使用)
#
# ------- 前提 :一个运行正常的allinone部署在虚机,关机后复制给别人使用,新虚机开机后如果需要修改IP,请执行如下步骤
Expand Down
1 change: 1 addition & 0 deletions tools/change_k8s_network.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 重置k8s pod网络脚本,使用请仔细阅读 docs/op/change_k8s_network.md
- hosts:
- kube-master
- new-master
Expand Down
3 changes: 2 additions & 1 deletion tools/clean_one_node.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 警告:此脚本将清理单个node节点,如果该节点为kube-node节点,请先执行kubectl drain
# 警告:此脚本将清理单个node节点,使用请详细参阅 docs/op/del_one_node.md
# 如果该节点为kube-node节点,请先执行kubectl drain
# 请三思后运行此脚本,特别的:如果有pod使用了本地存储类型,请自行判断重要性
# 参考 docs/op/del_one_node.md说明
# 使用:
Expand Down
2 changes: 2 additions & 0 deletions tools/yc-ssh-key-copy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# 此脚本为批量部署服务器ssh key使用

#set -x

# check args count
Expand Down

0 comments on commit fd4816b

Please sign in to comment.