环境准备
首先准备3台linux节点。配好静态ip
我的配置是:
master:192.168.112.111
node1:192.168.112.112
node2:192.168.112.113
设置主机名与时区
timedatectl set-timezone Asia/Shanghai #都要执行hostnamectl set-hostname master #111执行hostnamectl set-hostname node1 #112执行hostnamectl set-hostname node2 #113执行
添加hosts网络主机配置
三台虚拟机都要设置
vim /etc/hosts192.168.112.111 master192.168.112.112 node1192.168.112.113 node2
配好之后,互相ping通即可。
关闭防火墙
三台虚拟机都要设置,生产环境跳过这一步
# 关闭SELINUX -> linux 内置安全模块sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config# 设置为 临时生效setenforce 0# 关闭防火墙systemctl disable firewalldsystemctl stop firewalld
