一、构建实验:(yuanjian)openstack-compute(nova)(实验专题)
### --- openstack-compute(nova)(实验专题)
~~~ 安装和配置controller节点scheduler服务上,scheduler服务会分机,
~~~ 如果指定了对应的主机,直接发起请求。
~~~ 若果没有指定对应的主机,会进行一个权重的计算,
~~~ 怎么样会合理的调用对应的节点上,数据库的资源会合理的调用到每台主机之中,
~~~ scheduler会获取到当前的使用状态。
~~~ 怎样保证当前消耗的资源不会太大,又会合理的去调度当前的数据呢,
~~~ 定时每一分钟或每五分钟去更新一下数据库。
~~~ 如有人在我们compute中写入数据的话,我们快速同步到当前的数据库
~~~ 确认环境条件是否配置正常:在openstack-controller节点配置部署
二、在openstack-controller节点确定基础环境
### --- 在openstack-controller节点确定基础环境
~~~ 确认环境条件是否配置正常:在openstack-controller节点配置部署
[root@controller ~]# systemctl status NetworkManager.service
NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled)
Active: inactive (dead)
[root@controller ~]# systemctl status firewall.service
firewall.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
[root@controller ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@controller ~]# getenforce
Disabled
~~~ 配置时间同步服务器
[root@compute ~]# yum install -y ntp
[root@compute ~]# vim /etc/ntp.conf
restrict 192.168.222.0 mask 255.255.255.0 nomodify notrap
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
fudge 127.127.1.0 stratum 10
[root@controller ~]# systemctl start ntpd.service
[root@controller ~]# systemctl enable ntpd.service
ln -s '/usr/lib/systemd/system/ntpd.service' '/etc/systemd/system/multi-user.target.wants/ntpd.service'
[root@controller ~]# systemctl status ntpd.service
ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
Active: active (running) since Mon 2021-01-11 02:40:20 CST; 4min 42s ago
Main PID: 11854 (ntpd)
CGroup: /system.slice/ntpd.service
└─11854 /usr/sbin/ntpd -u ntp:ntp -g
[root@controller ~]# systemctl status mariadb.service
三、在openstack-compute节点确认基础环境
### --- 在openstack-compute节点确认基础环境
[root@compute ~]# systemctl status firewall.service
firewall.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
[root@compute ~]# systemctl status NetworkManager.service
NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled)
Active: inactive (dead)
[root@compute ~]# getenforce
Disabled
~~~ 更改它的主机名为:compute1.nice.com
[root@compute ~]# hostnamectl set-hostname compute1.nice.com
[root@compute ~]# cat /etc/hostname
compute1.nice.com
~~~ 在controller节点把hosts文件发送到compute1节点下
[root@controller ~]# scp /etc/hosts root@192.168.222.10:/etc/host
192.168.222.5 controller.nice.com
192.168.222.6 network.nice.com
192.168.222.10 compute1.nice.com
192.168.222.20 block1.nice.com
~~~ ping一下我们的域名是否配置正确
[root@compute ~]# ping controller.nice.com
64 bytes from controller.nice.com (192.168.222.5): icmp_seq=1 ttl=64 time=0.401 ms
### --- 配置时间同步服务器的相关配置:
~~~ 更新过yum源,删除centos的官方yum源文件
[root@compute yum.repos.d]# ls
back CentOS-Base.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Sources.repo CentOS-Vault.repo ftp.repo
[root@compute yum.repos.d]# rm -rf CentOS-*
[root@compute yum.repos.d]# ls
back ftp.repo
[root@compute ~]# yum clean all
~~~ 安装ntpdate工具;时间同步服务器的客户端
~~~ 配置客户端同步时间服务的地址
[root@compute ~]# yum install -y ntpdate
[root@compute ~]# /sbin/ntpdate -u controller.nice.com
11 Jan 03:00:32 ntpdate[11182]: step time server 192.168.222.5 offset -70457.883365 sec
~~~ 每一分钟去同步时间,/dev/null是垃圾箱,可以无限制的丢进数据,而不被保存
[root@compute ~]# crontab -e
*/1 * * * * /sbin/ntpdate -u controller.nice.com &> /dev/null
[root@compute ~]# systemctl restart crond.service
[root@compute ~]# systemctl enable crond.service
[root@compute ~]# hostname
compute1.nice.com