目录
一、OpenStack基础环境配置
配置项:所有节点上都需配置
1.1.1、修改主机名、防火墙、核心防护和免交互(所有节点)
1、主机名(所有节点)
[root@localhost ~]# hostnamectl set-hostname ct
[root@localhost ~]# bash
[root@localhost ~]#hostnamectl set-hostname c1
[root@localhost ~]# bash
[root@localhost ~]#hostnamectl set-hostname c2
[root@localhost ~]# bash
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
vim /etc/sysconfig/selinux
SELINUX=disabled
#o免交互
ssh-keygen -t rsa
ssh-copy-id ct
ssh-copy-id c1
ssh-copy-id c2
1.1.2、基础环境依赖包(所有节点)
yum -y install net-tools bash-completion vim gcc gcc-c++ make pcre pcre-devel expat-devel cmake bzip2
yum -y install centos-release-openstack-train python-openstackclient openstack-selinux openstack-utils
#openstack的train版本仓库源安装包
#openstack客户端
#openstack核心防护
#openstack管理工具
1.1.3、配置Hosts和DNS(所有节点)
vi /etc/hosts
192.168.100.133 ct
192.168.100.134 c1
192.168.100.135 c2
vim /etc/resolv.conf
nameserver 114.114.114.114
1.1.4、控制节点网卡配置(ct)
Nat网卡:
[root@ct ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPV4_ROUTE_METRIC=90 ###调由优先级,NAT网卡优先
IPADDR=192.168.100.133
NETMASK=255.255.255.0
GATEWAY=192.168.100.2
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=4a9a6455-626c-461b-bfe8-118604af9fdd
DEVICE=ens33
ONBOOT=yes
内网卡:
[root@ct ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens34
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.10.50
NETMASK=255.255.255.0
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens34
UUID=b7d4870c-bb50-4664-b6a0-5897f869ac8a
DEVICE=ens34
ONBOOT=yes
1.1.5、控制节点ct时间同步配置
[root@ct ~]# yum install chrony -y
[root@ct ~]# vim /etc/chrony.conf
#Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#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 ntp6.aliyun.com iburst #添加阿里云时间同步
allow 192.168.100.0/24 #允许100网段同步自己的时间
# Record the rate at which the system clock gains/losses time.driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).rtcsync
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
# Allow NTP client access from local network.
#allow 192.168.0.0/16
# Serve time even if not synchronized to a time source.
#local stratum 10
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
# Specify directory for log files.logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking
[root@ct ~]# systemctl enable chronyd
[root@ct ~]# systemctl restart chronyd
使用 chronyc sources 命令查询时间同步信息
[root@ct ~]# chronyc sources
chronyc sources210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample ===============================================================================^* 203.107.6.88 2 7 377 67 +2522us[+2963us] +/- 25ms
设置周期性任务
crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@ct ~]# crontab -l
*/30 * * * * /usr/bin/chronyc sources >> /var/log/chronyc.log
二、系统环境配置
配置服务(控制节点):
2.2.1、一、安装、配置MariaDB
yum -y install mariadb mariadb-server python2-PyMySQL
2.2.2、此包用于openstack的控制端连接mysql所需要的模块,如果不安装,则无法连接数据库;此包只安装在控制端
yum -y install libibverbs