控制节点基本配置
配置静态ip
vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="d6084321-b13a-43b9-a474-26cb3ca78413"
DEVICE="ens33"
ONBOOT="yes"
IPV6_PRIVACY="no"
IPADDR="192.168.10.160"
NETMASK="255.255.255.0"
生成第二张网卡信息,以ens36为例子,如果是ens34或者其它请修改下面相对应的地方
nmcli con add con-name ens36 type ethernet ifname ens36
vi /etc/sysconfig/network-scripts/ifcfg-ens36
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="d6084321-b13a-43b9-a474-26cb3ca78413"
DEVICE="ens33"
ONBOOT="yes"
IPV6_PRIVACY="no"
IPADDR="192.168.20.170"
NETMASK="255.255.255.0"
GATEWAY="192.168.20.2"
配置DNS服务器,找个屁的dns,直接填网关(=学校的dns(如果你在学校并且连接校园网))就行
echo 'nameserver 192.168.20.2' >> /etc/resolv.conf
重启网卡
systemctl restart network
修改主机名为”controller“
hostnamectl set-hostname controller
关闭防火墙
systemctl stop firewalld && systemctl disable firewalld
关闭SeLinux(这个绝对重要),让SELINUX=disabled
vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
添加本地解析,ip不要乱填,填自己的
echo 192.168.10.160 controller >> /etc/hosts
echo 192.168.10.165 compute >> /etc/hosts
重启
reboot