OpenStack环境部署

一、部署环境

主机名 内存 CPU 硬盘 网卡 系统
ct 8G 双核双线程-CPU虚拟化开启 300G+300G VM1:192.168.100.90 NAT:20.0.0.90 Centos7.6(1810)-最小化安装
c1 8G 双核双线程-CPU虚拟化开启 300G+300G VM1:192.168.100.70 NAT:20.0.0.70 Centos7.6(1810)-最小化安装
c2 8G 双核双线程-CPU虚拟化开启 300G+300G VM1:192.168.100.80 NAT:20.0.0.80 Centos7.6(1810)-最小化安装

二、基础环境配置(ct,c1,c2)
2.1、修改主机名

[root@server1 ~]#  hostnamectl set-hostname ct
[root@server1 ~]#  su

[root@server2 ~]#  hostnamectl set-hostname c1
[root@server2 ~]#  su

[root@server3 ~]#  hostnamectl set-hostname c2
[root@server3 ~]#  su

2.2、基础环境依赖包

[root@ct ~]# yum -y install net-tools bash-completion vim gcc gcc-c++ make pcre  pcre-devel expat-devel cmake  bzip2 
[root@ct ~]# yum -y install centos-release-openstack-train python-openstackclient openstack-selinux openstack-utils

2.3、配置Hosts

[root@ct ~]# vi /etc/hosts
192.168.100.90  ct
192.168.100.70  c1
192.168.100.80  c2

[root@ct ~]# systemctl stop firewalld
[root@ct ~]# systemctl disable firewalld
[root@ct ~]# setenforce 0
[root@ct ~]# vim /etc/sysconfig/selinux
SELINUX=disabled

2.4、免交互(非对称密钥)

[root@ct ~]#  ssh-keygen -t rsa         
[root@ct ~]#  ssh-copy-id ct
[root@ct ~]#  ssh-copy-id c1
[root@ct ~]#  ssh-copy-id c2

2.5、配置DNS

[root@ct ~]# vim /etc/resolv.conf
nameserver 8.8.8.8

2.6、控制节点ct时间同步配置

[root@ct ~]# yum install chrony -y
[root@ct ~]# vim /etc/chrony.conf
#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
将这4行注释掉,并添加两行
server ntp6.aliyun.com iburst
allow 192.168.100.0/24
其他两个节点也是注释掉上面4行,但之添加一行
server ct iburst
[root@ct ~]# systemctl enable chronyd
[root@ct ~]# systemctl restart chronyd
[root@ct ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* 203.107.6.88                  2   9   377    73  -2993us[-4411us] +/-   19ms

设置周期性任务
[root@ct ~]# crontab -e
*/30 * * * * /usr/bin/chronyc sources >> /var/log/chronyc.log
[root@ct ~]# crontab -l
*/2 * * * * /usr/bin/chronyc sources >> /var/log/chronyc.log

三、配置服务(控制节点)
3.1、安装、配置MariaDB

[root@ct ~]# yum -y install mariadb mariadb-server python2-PyMySQL
root@ct ~]# yum -y install libibverbs

添加MySQL子配置文件,增加如下内容
[root@ct ~]# vim /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.100.90   #控制节点局域网地址
default-storage-engine = innodb    #默认存储引擎
innodb_file_per_table = on            #每张表独立表空间文件
max_connections = 4096                 #最大连接数
collation-server = utf8_general_ci    #默认字符集
character-set-server = utf8
[root@ct my.cnf.d]# systemctl enable mariadb
[root@ct my.cnf.d]# systemctl start mariadb
[root@ct yum.repos.d]#  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 anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

3.2、安装RabbitMQ
所有创建虚拟机的指令,控制端都会发送到rabbitmq,node节点监听rabbitmq

[root@ct yum.repos.d]# yum -y install rabbitmq-server
[root@ct yum.repos.d]# systemctl enable rabbitmq-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.
[root@ct yum.repos.d]# systemctl start rabbitmq-server.service
[root@ct yum.repos.d]# rabbitmqctl add_user openstack RABBIT_PASS
Creating user "openstack"
[root@ct yum.repos.d]# rabbitmqctl set_pe
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值