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 <host> <port>"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 "")