OpenStack环境部署详解篇

一、【基础环境配置】

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 
  • 5
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值