目录
一、【基础环境配置】
1、控制节点ct
CPU:双核双线程-CPU虚拟化开启
内存:8G 硬盘:300G+300G(CEPH块存储)
双网卡:VM1-(局域网)192.168.10.33 NAT-192.168.100.33
1.基础环境依赖包
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
2.时间同步+周期性计划任务
hostnamectl set-hostname ct
bash
3.控制节点配置
[root@ct ~]# cd /etc/sysconfig/network-scripts/
[root@ct network-scripts]# cp ifcfg-ens33 ifcfg-ens37
[root@ct network-scripts]#vi /etc/sysconfig/network-scripts/ifcfg-ens37
修改
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.10.33
NETMASK=255.255.255.0
#GATEWAY=192.168.10.2
注:UUID要删除
[root@ct network-scripts]#vi /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
IPV4_ROUTE_METRIC=90 ###调由优先级,NAT网卡优先
ONBOOT=yes
IPADDR=192.168.100.33
NETMASK=255.255.255.0
GATEWAY=192.168.100.2
systemctl restart network #重启网卡
4.配置Hosts
[root@ct ~]# vi /etc/hosts
192.168.10.33 ct
192.168.10.30 c1
192.168.10.32 c2
[root@ct ~]# vim /etc/sysconfig/selinux
SELINUX=disabled
5.三台节点做免交互
[root@ct ~]# ssh-keygen -t rsa
[root@ct ~]# ssh-copy-id ct
[root@ct ~]# ssh-copy-id c1
[root@ct ~]# ssh-copy-id c2
6.配置DNS(所有节点)
[root@ct ~]# vim /etc/resolv.conf
nameserver 114.114.114.114
二、安装基础环境包
1.控制节点ct时间同步配置
[root@ct ~]# yum install chrony -y
[root@ct ~]# vim /etc/chrony.conf ##添加以下
server ntp6.aliyun.com iburst
allow 192.168.10.0/24
[root@ct ~]# systemctl enable chronyd
[root@ct ~]# systemctl restart chronyd
2.使用 chronyc sources 命令查询时间同步信息
3.设置周期性任务
[root@ct ~]# crontab -e
*/30 * * * * /usr/bin/chronyc sources >> /var/log/chronyc.log
三、系统环境配置
1.安装、配置MariaDB
[root@ct ~]# yum -y install mariadb mariadb-server python2-PyMySQL ###此包用于openstack的控制端连接mysql所需要的模块,如果不安装,则无法连接数据库;此包只安装在控制端
[root@ct ~]# yum -y install libibverbs
2.添加MySQL子配置文件
添加
[mysqld]
bind-address = 192.168.10.33 #控制节点局域网地址
default-storage-engine = innodb #默认存储引擎
innodb_file_per_table = on #每张表独立表空间文件
max_connections = 4096 #最大连接数
collation-server = utf8_general_ci #默认字符集
character-set-server = utf8
开启服务
[root@ct ]# systemctl enable mariadb
[root@ct ]# systemctl start mariadb
3. 执行MariaDB 安全配置脚本
[root@ct ]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): ##回车
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an