OpenStack搭建之基础环境配置(一)
该页面的操作所有环境都要配置
一、环境信息
| Hostname | eth0(管理) | eth1(存储) | eth2 | en(VXLAN) | OS | 
|---|---|---|---|---|---|
| controller | 10.168.1.103 | 192.168.100.103 | vlan_flat | Trunk | centos7.9 | 
| compute01 | 10.168.1.104 | 192.168.100.104 | vlan_flat | Trunk | centos7.9 | 
| compute02 | 10.168.1.105 | 192.168.100.105 | vlan_flat | Trunk | centos7.9 | 
二、设置hosts
controller节点
hostnamectl set-hostname controller
cat <<EOF>>/etc/hosts
192.168.100.103 controller
192.168.100.104 compute01
192.168.100.105 compute02
EOFcompute01节点
hostnamectl set-hostname compute01
cat <<EOF>>/etc/hosts
192.168.100.103 controller
192.168.100.104 compute01
192.168.100.105 compute02
EOFcompute02节点
hostnamectl set-hostname compute02
cat <<EOF>>/etc/hosts
192.168.100.103 controller
192.168.100.104 compute01
192.168.100.105 compute02
EOF每个节点都测试下是否生效
ping -c1 controller
ping -c1 compute01
ping -c1 compute02
三、关闭防火墙和selinux
关闭防火墙和防火墙的开机启动
systemctl stop firewalld
systemctl disable firewalld关闭selinux
setenforce 0
sed -i '/SELINUX/s/enforcing/disabled/g' /etc/selinux/config四、关闭swap
sed -i '/swap/s/^/#/g' /etc/fstab
swapoff -a五、配置yum源并安装基础软件
设置yum base源为清华源
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g'          -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g'          -i.bak          /etc/yum.repos.d/CentOS-*.repo设置epel扩展源为清华源
sudo yum install -y epel-release
sudo sed -e 's!^metalink=!#metalink=!g' \
    -e 's!^#baseurl=!baseurl=!g' \
    -e 's!https\?://download\.fedoraproject\.org/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' \
    -e 's!https\?://download\.example/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' \
    -i /etc/yum.repos.d/epel*.repo重建yum索引
yum makecache
六、设置时间同步服务
安装ntpupdate服务
yum install -y ntpdate设置定时任务,五分钟执行一次时间同步
echo "*/5 * * * * /usr/sbin/ntpdate cn.pool.ntp.org">>/tmp/crontab.txt>>/var/spool/cron/root
ntpdate cn.pool.ntp.org七、配置OpenStack仓库
yum install -y centos-release-openstack-train
yum install -y python-openstackclient
yum install -y openstack-selinux
yum upgrade -y执行完上面的步骤之后需要重启下所有服务器,一定要重启!!!
reboot声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
       
       
                

