硬件要求:
- 控制器节点:1个处理器、4 GB内存和5 GB存储 IP:10.0.0.11 controller
- 计算节点:1个处理器、2 GB内存和10 GB存储 IP:10.0.0.31 compute1
软件版本:
- centos7.6_1810
- openstack_stein 公有云
系统环境:
- 一个网卡
- NTP服务
- 关闭firewall,selinux, NetworkManager
- 安装基础服务
- 修改网卡名称
- 设备hosts
所有节点操作:
修改网卡名称:
这里自己写的一个shell脚本,也可自行搜索修改方法。
case:
#!/bin/sh
a=`ifconfig |grep mtu |cut -f1 -d ':'`
b=0
for i in $a
do
if [ $i != 'lo' ]
then
echo -e "033[40;32m ===================================start edit eth$b================================================================================033[0m"
sed -i "s/^NAME.*$/NAME=eth${b}/g" /etc/sysconfig/network-scripts/ifcfg-$i
sed -i "s/^BOOTPROTO.*$/BOOTPROTO=static/g" /etc/sysconfig/network-scripts/ifcfg-$i
#sed -i "s/^ONBOOT.*$/ONBOOT=yes/g" /etc/sysconfig/network-scripts/$i
sed -i "s/^DEVICE.*$/DEVICE=eth${b}/g" /etc/sysconfig/network-scripts/ifcfg-$i
sed -i '/PROXY_METHO|BROWSER_ONLY|DEFROUTE|IPV4_FAILURE_FATAL|IPV6*|UUID/d' /etc/sysconfig/network-scripts/ifcfg-$i
mv /etc/sysconfig/network-scripts/ifcfg-$i /etc/sysconfig/network-scripts/ifcfg-eth$b
((b++))
sleep 2
else
echo "skip $i"
fi
done
sed -i 's/rhgb/net.ifnames=0 biosdevname=0 &/' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
echo -e "033[40;32m ===================================edit network finish===========================================================================033[0m"
重启设备。
网卡配置:
根据实际环境配置IP。
case:
echo >/etc/sysconfig/network-scripts/ifcfg-eth0
cat >/etc/sysconfig/network-scripts/ifcfg-eth0 <
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.0.0.11
NETMASK=255.255.255.0
GATEWAY=10.0.0.254
DNS=8.8.8.8
EOF
systemctl restart network
关闭firewall,selinux,NetworkManager:
关闭防火墙:
systemctl stop firewalld
systemctl disable firewalld
关闭selinux:
setenforce 0
sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
关闭网络管理:
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
安装基础服务:
yum install -y bash-completion.noarch net-tools vim wget tree screen lsof tcpdump
设备hosts:
cat >> /etc/hosts <
10.0.0.11 controller
10.0.0.31 compute1
EOF
NTP服务:
如果没有请安装。
yum -y install chrony
vim /etc/chrony.conf
控制节点:
新增:allow 10.0.0.0/24
计算节点:
修改:server 10.0.0.11 iburst
其余的server删除即可
systemctl restart chronyd
基础环境已经调试完成~~~