文章目录
一、更改主机名和网络配置
1. 更改主机名
controller节点:
#hostnamectl set-hostname controller
controller节点:
#hostnamectl set-hostname compute
2.修改网络配置文件
#vim /etc/sysconfig/network-scripts/ifcfg-eth*(以具体的网卡)文件
controller节点
eth0: 192.168.100.10
eth1: 192.168.200.10
compute节点:
eth0: 192.168.100.10
eth1: 192.168.200.10
注:此时需要重启网卡,才能使修改生效
service network restart
[root@controller hm]# service network restart
Restarting network (via systemctl): [ 确定 ]
3.添加网络映射
- 编辑映射文件
controller:
vim /etc/hosts
#添加以下映射地址
192.168.100.10 controller
192.168.200.10 compute
compute:
vim /etc/hosts
#添加以下映射地址
192.168.100.10 controller
192.168.200.10 compute
[root@compute hm]# ping controller
PING controller (192.168.100.10) 56(84) bytes of data.64 bytes from controller (192.168.100.10): icmp_seq=1 ttl=64 time=1.27 ms
64 bytes from controller (192.168.100.10): icmp_seq=2 ttl=64 time=1.07 ms
[root@controller hm]# ping compute
PING compute (192.168.200.10) 56(84) bytes of data.
64 bytes from compute (192.168.200.10): icmp_seq=1 ttl=64 time=0.056 ms
64 bytes from compute (192.168.200.10): icmp_seq=2 ttl=64 time=0.155 ms
能互相ping通说明成功了
二、配置ftp源
注:提前添加上这两个镜像
1.在/mnt目录下创建两个目录
mkdir /mnt/centos
mkdir /mnt/iaas
2.配置开机自动挂载
vim /etc/rc.d/rc.local
#添加以下语句
mount /dev/sr0/ /mnt/centos/
mount /dev/sr1/ /mnt/iaas/
sr0 代表 centos
sr1 代表 iaas
3.给文件添加权限
chmod +x /etc/rc.d/rc.local
controller和compute:
备份repos.d文件
#新建备份文件夹 mkdir /mnt/repos
#移动 mv /etc/yum.repos.d/* /mnt/repos
controller:
1.新建并编辑新文件
vim /etc/yum.re