goodrain / rainbond-install

Saltstack recipe to deploy Rainbond (abandoned)
Apache License 2.0
20 stars 14 forks source link

grctl init 能否分步执行? #165

Closed php-cpm closed 6 years ago

php-cpm commented 6 years ago

问题是这样的,init 脚本执行中第一步会修改/etc/resolv.conf

  Name: /etc/resolv.conf - Function: file.replace - Result: Changed Started: - 17:15:04.101317 Duration: 17.156 ms
  Name: /etc/resolv.conf - Function: file.append - Result: Changed Started: - 17:15:04.118943 Duration: 3.203 ms
  Name: /etc/resolv.conf - Function: file.append - Result: Clean Started: - 17:15:04.122408 Duration: 1.905 ms
  Name: /etc/resolv.conf - Function: file.append - Result: Changed Started: - 17:15:04.124620 Duration: 2.565 ms
  Name: /etc/resolv.conf - Function: file.replace - Result: Clean Started: - 17:15:04.127445 Duration: 15.119 ms
  Name: /etc/resolv.conf - Function: file.replace - Result: Changed Started: - 17:15:04.143000 Duration: 16.974 ms

我手工编辑/etc/resolv.conf 指定 dns 之后重新 init 又会被改掉。

导致域名解析失败,后续的第四步 docker pull 拉镜像就失败,卡住了,没法继续。

ranbond 最新版 3.7.2 centos 7.2

一方面想了解一下能否分步执行,另外还想问一下安装的脚本下载到哪个目录了,能否直接修改后执行

ysicing commented 6 years ago

正常情况下会新增一个本机ip 类似

nameserver 10.10.10.36 #本机
nameserver 100.100.2.136 #原先默认dns

你可以修改/etc/resolv.conf

nameserver  <ns1>
nameserver  <ns2>

@php-cpm

ysicing commented 6 years ago

分布执行可以看下 setup.sh脚本。手动执行

git clone --depth 1 -b v3.7 https://github.com/goodrain/rainbond-install.git /opt/rainbond/install
cd /opt/rainbond/install
./setup.sh
php-cpm commented 6 years ago

是这样的,这个机器原本 dns 如下

nameserver 10.9.255.1 #内网主 dns
nameserver 10.9.255.2 #内网备 dns
nameserver 114.114.114.114 #公网 dns
search xxx-xxx

由于主 dns 出问题了,我编辑/etc/resolv.conf只保留了10.9.255.2 执行 init 之后10.9.255.1又回来了

./install/salt/install/files/health/local-dns.sh
./install/salt/common/dns.sls

这两个文件编辑注释后,执行 setup.sh 没有效果

ysicing commented 6 years ago

检查一下 /srv/pillar/rainbond.sls 关于dns配置

可以把 /srv/ 目录删除了或者直接修改/srv/salt目录下的相关文件

php-cpm commented 6 years ago

怎么能卸载重装呢,由于之前步骤已经安装完毕,重复执行了 grctl init 之后 执行 grctl cluster


500:Get https://region.goodrain.me:8443/v2/cluster: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "rainbond")
ysicing commented 6 years ago

证书的问题 grctl reset 还需要把 /root/.kube/config 删了

php-cpm commented 6 years ago
rm -rf /root/.kube/ # 删除配置
rm -rf /root/.rbd/
grctl reset  # 重置
vim /etc/resolv.conf  #修改还原 dns
rm -rf /srv #删除安装配置
rm -rf /grdata/*
rm -rf /grlocaldata/*
rm -rf  /opt/rainbond/*
yum remove -y gr-docker*

删除环境,是否还有疏漏?

ysicing commented 6 years ago

还有kubelet等相关二进制在/usr/local/bin/ 目录下

php-cpm commented 6 years ago

追加

rm -rf /usr/local/bin/kube*
rm -rf /usr/local/bin/gr*
docker  ps -q|xargs -l docker stop
docker  ps -a -q|xargs -l docker rm