swapoff -a # 临时关闭,close all swap devices
# 修改/etc/fstab,注释掉swap那行,持久化生效
# sudo vim /etc/fstab
step 5:端口开放设置(ubuntu防火墙默认是没有的,所以不用特殊处理)
##########################################################################
# file name: firewall-port-manager.sh
# author: xianqiu_li
# mail: xianqiu_li@163.com
# created time: thu 17 sep 2020 10:41:54 am cst
#########################################################################
#!/bin/zsh# open tcp/6443 for all
# iptables -a input -p tcp --dport 6443 -j accept# open tcp/$port for all
# firewall-cmd --zone=public --add-port=$port/tcp --permanent
# firewall-cmd --reload# open tcp/6443 for one specific ip
# 这条命令不能通过远端执行(需要sudo权限),说以需要去具体的机器上run
if [ $# -lt 2 ]; thenecho "usage: $0 "exit 1
fi
host=$1
port=$2
# ssh arthur@192.168.1.110 iptables -a input -p tcp -s 192.168.1.197 --dport 2379 -j accept
iptables -a input -p tcp -s $host --dport $port -j accept## open tcp/port for one specific ip
#firewall-cmd --permanent --zone=public --add-rich-rule='
# rule family="ipv4"
# source address="$host/32"
# port protocol="tcp" port="$port" accept'
#firewall-cmd --reload
warn[0296] [etcd] host [192.168.1.110] failed to check etcd health: failed to get /health for host [192.168.1.110]: get https://192.168.1.110:2379/health: net/http: tls handshake timeout
warn[0343] [etcd] host [192.168.1.197] failed to check etcd health: failed to get /health for host [192.168.1.197]: get https://192.168.1.197:2379/health: net/http: tls handshake timeout
fata[0343] [etcd] failed to bring up etcd plane: etcd cluster is unhealthy: hosts [192.168.1.110,192.168.1.197] failed to report healthy. check etcd container logs on each host for more information2020-09-21 04:29:26.085053 i | embed: rejected connection from "192.168.1.197:56164" (error "remote error: tls: bad certificate", servername "")
2020-09-21 04:29:26.085560 i | embed: rejected connection from "192.168.1.197:56166" (error "remote error: tls: bad certificate", servername "")
2020-09-21 04:29:26.185396 i | embed: rejected connection from "192.168.1.197:56168" (error "remote error: tls: bad certificate", servername "")
2020-09-21 04:29:26.186002 i | embed: rejected connection from "192.168.1.197:56170" (error "remote error: tls: bad certificate", servername "")
2020-09-21 04:29:26.285123 i | embed: rejected connection from "192.168.1.197:56174" (error "remote error: tls: bad certificate", servername "")