OpenStack Rocky 版本部署之一——基础环境配置

本文档详细介绍了如何在两台服务器上配置OpenStack环境,包括初始化CentOS系统,设置阿里云yum源,安装OpenStack各个组件如keystone、glance、nova、neutron和cinder,以及配置数据库mariadb、消息队列rabbitmq和缓存系统memcache等。同时,还涉及到防火墙端口的开放以及数据库用户的创建和权限设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本文章旨在记录自己安装过程,有关其他知识请移步官方网站,本实例鉴于初登OpenStack的人使用。

环境介绍本次用到两台服务器。

为方便使用需要初始化环境。yum源位置使用阿里云。

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

[cloud]
name=CentOS-$releasever - cloud - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos/$releasever/cloud/$basearch/openstack-rocky/
gpgcheck=0
enabled=1

[kvm]
name=CentOS-$releasever - kvm - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos/$releasever/virt/$basearch/kvm-common/
gpgcheck=0
enabled=1 

一、基础环境

#关防火墙,关selinux,永久修改主机名。

#添加地址解析。

    192.168.44.10 IP1 controller   #控制节点

    192.168.44.11 IP2 compute    #计算节点

# 修改完成后执行重新执行以下命令

# yum clean all && yum repolist

客户端及其依赖环境

# yum install python-openstackclient -y

# yum install openstack-selinux -y

 # yum -y install libibverbs

2安装OpenStack应用组件

(1)认证服务 keystone

# yum install openstack-keystone httpd mod_wsgi -y

(2)镜像服务 glance

# yum install openstack-glance -y

(3)计算服务 nova

# yum install openstack-nova-api openstack-nova-conductor \

openstack-nova-console openstack-nova-novncproxy \

openstack-nova-scheduler openstack-nova-placement-api -y

(4)网络服务 neutron

# yum install openstack-neutron openstack-neutron-ml2 \

openstack-neutron-linuxbridge ebtables -y

(5)块存储服务cinder

# yum install openstack-cinder -y

3、安装其他必须模块

(1)消息队列 rabbitmq

# yum install rabbitmq-server -y

(2)缓存服务memcache

# yum install -y memcached python-memcached

(3)数据库mariadb

# yum install mariadb mariadb-server python2-PyMySQL -y

(4)安装LVM模块

# yum install lvm2 device-mapper-persistent-data targetcli -y

4、添加防火墙放行

 以下为OpenStack模块用到的端口(测试实验可以关闭防火墙)

firewall-cmd --permanent --add-port=15672/tcp
firewall-cmd --permanent --add-port=5672/tcp
firewall-cmd --permanent --add-port=5000/tcp
firewall-cmd --permanent --add-port=11211/tcp
firewall-cmd --permanent --add-port=6080/tcp
firewall-cmd --permanent --add-port=9292/tcp
firewall-cmd --permanent --add-port=9696/tcp
firewall-cmd --permanent --add-port=8778/tcp
firewall-cmd --permanent --add-port=8774/tcp
firewall-cmd --permanent --add-port=3306/tcp
firewall-cmd --reload

二、配置非OpenStack组件

1、数据库mariadb

提供OpenStack平台数据存储

(1)创建数据库配置文件 vim /etc/my.cnf.d/openstack.cnf

[mysqld]
bind-address = 0.0.0.0
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

(2)启动服务:

# systemctl enable mariadb.service

# systemctl start mariadb.service

(3)执行mysql安全配置

# mysql_secure_installation

(4)使用root用户登录并创建数据库、用户、配置权限

create database keystone;

create database glance;

create database nova;

create database nova_api;

create database nova_cell0;

create database placement;

create database neutron;

create database cinder;

grant all on keystone.* to 'keystone'@'localhost' identified by 'keystone';

grant all on keystone.* to 'keystone'@'%' identified by 'keystone';

grant all on glance.* to 'glance'@'localhost' identified by 'glance';

grant all on glance.* to 'glance'@'%' identified by 'glance';

grant all on nova.* to 'nova'@'localhost' identified by 'nova';

grant all on nova.* to 'nova'@'%' identified by 'nova';

grant all on nova_api.* to 'nova'@'localhost' identified by 'nova';

grant all on nova_api.* to 'nova'@'%' identified by 'nova';

grant all on neutron.* to 'neutron'@'localhost' identified by 'neutron';

grant all on neutron.* to 'neutron'@'%' identified by 'neutron';

grant all on cinder.* to 'cinder'@'localhost' identified by 'cinder';

grant all on cinder.* to 'cinder'@'%' identified by 'cinder';

grant all on nova_cell0.* to 'nova'@'localhost' identified by 'nova';

grant all on nova_cell0.* to 'nova'@'%' identified by 'nova';

grant all on placement.* to 'placement'@'localhost' identified by 'placement';

grant all on placement.* to 'placement'@'%' identified by 'placement';

2、消息队列rabbitmq

    解决OpenStack资源管理组件使用过程中资源争抢问题。

(1)启动消息队列,并设置开机自启:

# systemctl enable rabbitmq-server.service

# systemctl start rabbitmq-server.service

(2)rabbitmq创建OpenStack组件访问的用户

# rabbitmqctl add_user openstack openstack

(3)授权:授予openstack对所有资源的配置、写、读权限。

# rabbitmqctl set_permissions openstack ".*" ".*" ".*"

 (4)启动rabbitmq_management用于消息队列web界面管理

# rabbitmq-plugins list

启消息队列web界面管理

# rabbitmq-plugins enable rabbitmq_management

 再次查看

5)查看服务是否启动

# netstat -anutpl | grep 5672

15672:访问 RabbitMQ 的Web管理界面,默认账号密码:guest  guest

25672:集群通讯端口

5672:客户端连接使用

3缓存系统memcache

    提高OpenStack组件间访问速度

(1)修改配置文件制定监听地址

# vim /etc/sysconfig/memcached

(2)启动服务并设置开机自启

# systemctl enable memcached.service

# systemctl start memcached.service

(3)查看监听端口

在考虑部署OpenStack Rocky时,选择使用阿里云YUM源的CentOS作为操作系统平台是一个明智的选择,因为它能保证软件包的稳定性和安全性。为了帮助你完成这一任务,这里推荐《手动部署OpenStack Rocky:详细指南》。这份资料将为你提供一个详尽的部署流程,确保你能够理解并实施每一个步骤。 参考资源链接:[手动部署OpenStack Rocky:详细指南](https://wenku.csdn.net/doc/646311ad543f8444889ab71d?spm=1055.2569.3001.10343) 首先,确保你的CentOS系统是最新的,并配置好了阿里云的YUM源。接下来,关闭SELinux以避免安全策略干扰OpenStack服务。关闭SELinux可以通过临时执行setenforce 0命令或永久修改/etc/selinux/config文件实现。 接下来,开始安装OpenStack Rocky的各个组件。这包括安装Nova、Cinder、Neutron和Glance等关键模块。每个组件的安装都需要配置相应的服务文件,并且需要确保服务之间的通信设置正确。在此过程中,你将需要设置数据库和消息队列服务,创建认证服务Keystone,并且配置用户角色和服务之间的网络。 完成安装后,需要进行测试和验证,确保所有OpenStack服务都能够正常运行并且相互之间能够正确通信。这包括检查各个服务的状态和日志,以及验证虚拟机的创建和管理功能。 在《手动部署OpenStack Rocky:详细指南》中,你将找到关于如何配置网络、如何设置服务之间的通信,以及如何进行系统测试的详细信息。这份资料不仅包含了OpenStack部署的核心步骤,还提供了大量背景知识和高级配置技巧,帮助你深入理解OpenStack的架构及其模块的作用,为你的云计算平台建设打下坚实的基础。 参考资源链接:[手动部署OpenStack Rocky:详细指南](https://wenku.csdn.net/doc/646311ad543f8444889ab71d?spm=1055.2569.3001.10343)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值