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

本文章旨在记录自己安装过程,有关其他知识请移步官方网站,本实例鉴于初登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)查看监听端口

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值