OpenStack部署(1)

目录

一、节点规划

二、控制节点部署

3、关闭SELINUX和防火墙

4、NTP(网络时间协议)服务部署

三、计算节点部署


一、节点规划

主机名IP地址硬盘大小运行内存操作系统
controller10.0.0.20/2440G4GCentOS 7
computer10.0.0.10/2440G1GCentOS 7

二、控制节点部署

1、网络部署:

①、修改网卡配置

②、要求能够访问外网

③、配置hosts文件实现主机名之间映射

[root@localhost ~]# nmcli connection modify ens33 connection.autoconnect yes ipv4.addresses 10.0.0.20/24 ipv4.gateway 10.0.0.2 ipv4.dns 8.8.8.8 ipv4.method manual 
[root@localhost ~]# nmcli connection down ens33
[root@localhost ~]# nmcli connection up ens33

[root@localhost ~]# ping qq.com
PING qq.com (203.205.254.157) 56(84) bytes of data.
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=1 ttl=128 time=409 ms
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=2 ttl=128 time=434 ms
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=3 ttl=128 time=401 ms
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=4 ttl=128 time=412 ms
^C
--- qq.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3027ms
rtt min/avg/max/mdev = 401.681/414.384/434.033/12.033 ms

[root@localhost ~]# cat >>/etc/hosts<<EOF
10.0.0.10 computer
10.0.0.20 controller
EOF

[root@localhost ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.10 computer
10.0.0.20 controller

2、安装命令、修改主机名:

①、安装wget、net-tools(ifconfig)、bash-completion(命令填充脚本)、vim

[root@localhost ~]# yum install wget net-tools bash-completion vim -y
[root@localhost ~]# source /usr/share/bash-completion/bash_completion 

[root@localhost ~]# hostnamectl set-hostname controller && bash

3、关闭SELINUX和防火墙

①、SELINUX重启验证

[root@controller ~]# sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
[root@controller ~]# systemctl stop firewalld.service 
[root@controller ~]# systemctl disable firewalld.service 
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@controller ~]# getenforce 
Permissive

4、NTP(网络时间协议)服务部署

①、修改配置文件

②、要求两台主机之间可以通过NTP实现时钟同步

[root@controller ~]# yum install chrony -y
[root@controller ~]# vim /etc/chrony.conf 

  1 # Use public servers from the pool.ntp.org project.
  2 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
  3 server s1c.time.edu.cn iburst ==>添加该项
  4 
  5 # Record the rate at which the system clock gains/losses time.
  6 driftfile /var/lib/chrony/drift
  7 
  8 # Allow the system clock to be stepped in the first three updates
  9 # if its offset is larger than 1 second.
 10 makestep 1.0 3
 11 
 12 # Enable kernel synchronization of the real-time clock (RTC).
 13 rtcsync
 14 
 15 # Enable hardware timestamping on all interfaces that support it.
 16 #hwtimestamp *

[root@controller ~]# systemctl start chronyd.service
[root@controller ~]# systemctl enable chronyd.service
[root@controller ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^? 202.112.7.150                 0   7     0     -     +0ns[   +0ns] +/-    0ns

三、计算节点部署

1、网络部署:

①、修改网卡配置

②、要求能够访问外网

③、配置hosts文件实现主机名之间映射

[root@localhost ~]# nmcli connection modify connection.autoconnect yes ens33 ipv4.addresses 10.0.0.10/24 ipv4.gateway 10.0.0.2 ipv4.dns 8.8.8.8 ipv4.method manual 
[root@localhost ~]# nmcli connection down ens33
[root@localhost ~]# nmcli connection up ens33

[root@localhost ~]# ping qq.com
PING qq.com (203.205.254.157) 56(84) bytes of data.
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=1 ttl=128 time=409 ms
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=2 ttl=128 time=434 ms
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=3 ttl=128 time=401 ms
64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=4 ttl=128 time=412 ms
^C
--- qq.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3027ms
rtt min/avg/max/mdev = 401.681/414.384/434.033/12.033 ms


[root@localhost ~]# cat >>/etc/hosts<<EOF
10.0.0.10 computer
10.0.0.20 controller
EOF

2、安装命令、修改主机名:

①、安装wget、net-tools(ifconfig)、bash-completion(命令填充脚本)、vim

[root@localhost ~]# yum install wget net-tools bash-completion vim -y
[root@localhost ~]# source /usr/share/bash-completion/bash_completion 

[root@localhost ~]# hostnamectl set-hostname computer && bash

3、关闭SELINUX和防火墙

①、SELINUX重启验证

[root@computer ~]# sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
[root@computer ~]# systemctl stop firewalld.service 
[root@computer ~]# systemctl disable firewalld.service 
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@computer ~]# getenforce 
Permissive

4、NTP(网络时间协议)服务部署

①、修改配置文件

②、要求两台主机之间可以通过NTP实现时钟同步

[root@computer ~]# yum install chrony -y
[root@computer ~]# vim /etc/chrony.conf 

  1 # Use public servers from the pool.ntp.org project.
  2 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
  3 server controller iburst ==>添加该项
  4 
  5 # Record the rate at which the system clock gains/losses time.
  6 driftfile /var/lib/chrony/drift
  7 
  8 # Allow the system clock to be stepped in the first three updates
  9 # if its offset is larger than 1 second.
 10 makestep 1.0 3
 11 
 12 # Enable kernel synchronization of the real-time clock (RTC).
 13 rtcsync
 14 
 15 # Enable hardware timestamping on all interfaces that support it.
 16 #hwtimestamp *

[root@computer ~]# systemctl start chronyd.service
[root@computer ~]# systemctl enable chronyd.service

[root@computer ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^? controller                    0  10     0     -     +0ns[   +0ns] +/-    0ns

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值