一、CentOS 8.3 XXX Cluster Initialization Configuration
1 节点规划
官方建议节点数量为奇数个
hostname | IP | 节点规划 | 角色 |
---|---|---|---|
maset01 | 192.168.80.31 | Master01(主节点) | 主库 |
slave01 | 192.168.80.32 | Slaver01(从节点) | 从库 |
slave02 | 192.168.80.33 | Slaver02(从节点) | 从库 |
2 设置主机名
sudo hostnamectl set-hostname master01
sudo hostnamectl set-hostname slave01
sudo hostnamectl set-hostname slave02
3 配置hosts本地解析
cat > /etc/hosts <<EOF
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.80.31 master01
192.168.80.32 slave01
192.168.80.33 slave02
EOF
4 关闭防火墙 / Selinux
# 关闭防火墙
systemctl stop firewalld
systemctl disable --now firewalld
# 关闭Selinux
# 永久关闭
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
# 临时关闭
setenforce 0
# 检查
cat /etc/selinux/config
/usr/sbin/sestatus -v
5 互相免密
Master 节点执行免密操作
ssh-keygen -t rsa
# 定义 master 列表
MASTER_LIST=(
192.168.80.32
192.168.80.33
)
# 配置免密登录
for i in ${MASTER_LIST[@]};do
ssh-copy-id -i /root/.ssh/id_rsa.pub root@$i
done
# yes
# 输入密码
标签:8.3,sudo,CentOS,Initialization,hostname,192.168,set,关闭,节点 From: https://www.cnblogs.com/huaxiayuyi/p/16862622.html