当前位置:   article > 正文

OpenStack部署(1)_控制节点和计算节点配置需要一样么

控制节点和计算节点配置需要一样么

目录

一、节点规划

二、控制节点部署

3、关闭SELINUX和防火墙

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

三、计算节点部署


一、节点规划

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

二、控制节点部署

1、网络部署:

①、修改网卡配置

②、要求能够访问外网

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

  1. [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
  2. [root@localhost ~]# nmcli connection down ens33
  3. [root@localhost ~]# nmcli connection up ens33
  4. [root@localhost ~]# ping qq.com
  5. PING qq.com (203.205.254.157) 56(84) bytes of data.
  6. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=1 ttl=128 time=409 ms
  7. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=2 ttl=128 time=434 ms
  8. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=3 ttl=128 time=401 ms
  9. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=4 ttl=128 time=412 ms
  10. ^C
  11. --- qq.com ping statistics ---
  12. 4 packets transmitted, 4 received, 0% packet loss, time 3027ms
  13. rtt min/avg/max/mdev = 401.681/414.384/434.033/12.033 ms
  14. [root@localhost ~]# cat >>/etc/hosts<<EOF
  15. 10.0.0.10 computer
  16. 10.0.0.20 controller
  17. EOF
  18. [root@localhost ~]# cat /etc/hosts
  19. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  20. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  21. 10.0.0.10 computer
  22. 10.0.0.20 controller

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

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

  1. [root@localhost ~]# yum install wget net-tools bash-completion vim -y
  2. [root@localhost ~]# source /usr/share/bash-completion/bash_completion
  3. [root@localhost ~]# hostnamectl set-hostname controller && bash

3、关闭SELINUX和防火墙

①、SELINUX重启验证

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

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

①、修改配置文件

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

  1. [root@controller ~]# yum install chrony -y
  2. [root@controller ~]# vim /etc/chrony.conf
  3. 1 # Use public servers from the pool.ntp.org project.
  4. 2 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
  5. 3 server s1c.time.edu.cn iburst ==>添加该项
  6. 4
  7. 5 # Record the rate at which the system clock gains/losses time.
  8. 6 driftfile /var/lib/chrony/drift
  9. 7
  10. 8 # Allow the system clock to be stepped in the first three updates
  11. 9 # if its offset is larger than 1 second.
  12. 10 makestep 1.0 3
  13. 11
  14. 12 # Enable kernel synchronization of the real-time clock (RTC).
  15. 13 rtcsync
  16. 14
  17. 15 # Enable hardware timestamping on all interfaces that support it.
  18. 16 #hwtimestamp *
  19. [root@controller ~]# systemctl start chronyd.service
  20. [root@controller ~]# systemctl enable chronyd.service
  21. [root@controller ~]# chronyc sources
  22. 210 Number of sources = 1
  23. MS Name/IP address Stratum Poll Reach LastRx Last sample
  24. ===============================================================================
  25. ^? 202.112.7.150 0 7 0 - +0ns[ +0ns] +/- 0ns

三、计算节点部署

1、网络部署:

①、修改网卡配置

②、要求能够访问外网

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

  1. [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
  2. [root@localhost ~]# nmcli connection down ens33
  3. [root@localhost ~]# nmcli connection up ens33
  4. [root@localhost ~]# ping qq.com
  5. PING qq.com (203.205.254.157) 56(84) bytes of data.
  6. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=1 ttl=128 time=409 ms
  7. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=2 ttl=128 time=434 ms
  8. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=3 ttl=128 time=401 ms
  9. 64 bytes from 203.205.254.157 (203.205.254.157): icmp_seq=4 ttl=128 time=412 ms
  10. ^C
  11. --- qq.com ping statistics ---
  12. 4 packets transmitted, 4 received, 0% packet loss, time 3027ms
  13. rtt min/avg/max/mdev = 401.681/414.384/434.033/12.033 ms
  14. [root@localhost ~]# cat >>/etc/hosts<<EOF
  15. 10.0.0.10 computer
  16. 10.0.0.20 controller
  17. EOF

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

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

  1. [root@localhost ~]# yum install wget net-tools bash-completion vim -y
  2. [root@localhost ~]# source /usr/share/bash-completion/bash_completion
  3. [root@localhost ~]# hostnamectl set-hostname computer && bash

3、关闭SELINUX和防火墙

①、SELINUX重启验证

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

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

①、修改配置文件

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

  1. [root@computer ~]# yum install chrony -y
  2. [root@computer ~]# vim /etc/chrony.conf
  3. 1 # Use public servers from the pool.ntp.org project.
  4. 2 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
  5. 3 server controller iburst ==>添加该项
  6. 4
  7. 5 # Record the rate at which the system clock gains/losses time.
  8. 6 driftfile /var/lib/chrony/drift
  9. 7
  10. 8 # Allow the system clock to be stepped in the first three updates
  11. 9 # if its offset is larger than 1 second.
  12. 10 makestep 1.0 3
  13. 11
  14. 12 # Enable kernel synchronization of the real-time clock (RTC).
  15. 13 rtcsync
  16. 14
  17. 15 # Enable hardware timestamping on all interfaces that support it.
  18. 16 #hwtimestamp *
  19. [root@computer ~]# systemctl start chronyd.service
  20. [root@computer ~]# systemctl enable chronyd.service
  21. [root@computer ~]# chronyc sources
  22. 210 Number of sources = 1
  23. MS Name/IP address Stratum Poll Reach LastRx Last sample
  24. ===============================================================================
  25. ^? controller 0 10 0 - +0ns[ +0ns] +/- 0ns

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/217323
推荐阅读
相关标签
  

闽ICP备14008679号