Skip to content

计算节点配置

计算节点基本配置

修改主机名为"compute"

hostnamectl set-hostname compute

配置静态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="eedb493c-a9a3-4c24-8239-497b618e3ac4"
DEVICE="ens33"
ONBOOT="yes"
IPADDR="192.168.10.165"
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.175"
NETMASK="255.255.255.0"
GATEWAY="192.168.20.2"

重启网卡

systemctl restart network 

配置DNS服务器

echo 'nameserver 192.168.20.2' >> /etc/resolv.conf

安装时间同步服务

yum install -y chrony net-tools telnet telnet-server 

修改时间同步服务文件(第三行),多的三个删掉

[root@compute1 ~]# vi /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server controller iburst

重启时间同步服务

systemctl restart chronyd.service

查看时间同步服务状态,^*表示成功,^?表示没有成功(记得重启服务器)

[root@compute1 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* controller                    3   6    17    25  -6192us[ -190ms] +/-   44ms

添加本地解析,查看本地解析情况

echo 192.168.10.160 controller >> /etc/hosts
echo 192.168.10.165 compute >> /etc/hosts
[root@compute1 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.10.160 controller
192.168.10.165 compute

测试内网连通性

ping controller

关闭防火墙

systemctl stop firewalld.service && systemctl disable firewalld.service

关闭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

重启

reboot

所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自linlink~文档