OpenStack部署(公版)
目录
Yum 软件包服务
yum search ifconfig
yum list net-*
yum -y install net-tools
YUM源
[root@controller ~]# cd /etc/yum.repos.d/
[root@controller yum.repos.d]# ls
CentOS-Base.repo CentOS-OpenStack-train.repo CentOS-Ceph-Nautilus.repo CentOS-QEMU-EV.repo CentOS-CR.repo CentOS-Sources.repo CentOS-Debuginfo.repo CentOS-Storage-common.repo CentOS-fasttrack.repo CentOS-Vault.repo CentOS-Media.repo CentOS-x86_64-kernel.repo CentOS-NFS-Ganesha-28.repo
mv CentOS-* ~/
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
yum repolist
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com repo id repo name status base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072 extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 518 updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 5,367 repolist: 15,957
主机名管理与域名解析
主机名管理
查看主机名:
hostname
更改主机名:
hostnamectl set-hostname controller
exit 重新登陆之后生效
本地域名解析
vi /etc/hosts:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.100.10 controller 192.168.100.20 compute
ping controller
ping compute
防火墙管理
systemctl status firewalld
◠firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-11-01 23:40:10 CST; 15h ago Docs: man:firewalld(1) Main PID: 709 (firewalld) CGroup: /system.slice/firewalld.service └─709 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --... Nov 01 23:40:10 controller systemd[1]: Starting firewalld - dynamic .... Nov 01 23:40:10 controller systemd[1]: Started firewalld - dynamic f.... Nov 01 23:40:11 controller firewalld[709]: WARNING: AllowZoneDrifting... Hint: Some lines were ellipsized, use -l to show in full.
[root@controller ~]# systemctl stop firewalld
[root@controller ~]#systemctl start firewalld
[root@controller ~]# systemctl enable firewalld
基础支持服务
Chrony时间同步服务
yum -y update
yum -y install chrony
配置文件:
vi /etc/chrony.conf
server ntp.aliyun.com iburst local stratum 1 allow 192.168.100.0/24
重启服务:
systemctl restart chronyd
设置开机启动:
systemctl enable chronyd
查看当前客户端与NTP连接情况:
chronyc sources
210 Number of sources = 1 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 203.107.6.88 2 6 17 14 -688us[-2639us] +/- 25ms
chronyc add server time1.cloud.tencent.com
chronyc sources
210 Number of sources = 2 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 203.107.6.88 2 6 17 52 -688us[-2639us] +/- 25ms ^? 106.55.184.199 2 6 1 5 +7731us[+7731us] +/- 69ms
OpenStack云计算平台框架
安装OpenStack云计算平台框架
安装:
yum -y install centos-release-openstack-train
yum upgrade -y
yum -y install python-openstackclient
openstack --version
openstack 4.0.2