Openstack架构详解

OpenStack架构

学习openstack的部署和运维之前,应当熟悉其架构和运行机制 openStack作为开源、可扩展、富有弹性的云操作系统;某设计基本原则如下:
按照不同的功能和通用性划分不同项目,拆分子系统
按照逻辑计划、规范子系统之间的通信
通过分层设计整个系统架构
不同的功能子系统间提供统一的API接口

OpenStack组件通信关系

基于AMQF协议的通信

用于每个项目内部各个组件之间的通信。

基于sQL的通信

用于各个项目内部的通信,

OpenStack环境部署

环境需求

控制节点ct:8g内存,300G硬盘,双网卡192.168.235.121,192.168.100.169,centos7最小化安装
控制节点c1:8g内存,300G硬盘,双网卡192.168.235.122,192.168.100.170,centos7最小化安装
控制节点c2:8g内存,300G硬盘,双网卡192.168.235.123,192.168.100.171,centos7最小化安装

安装

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

配置host

[root@ct ~]# vi /etc/hosts
192.168.100.169 ct
192.168.100.170  c1
192.168.100.171 c2

三台设备免交互

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

设置时间同步

[root@ct ~]# yum -y install chrony
[root@ct ~]# vi /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			##注释掉
server ntp6.aliyun.com iburst				##配置阿里云

[root@ct ~]# systemctl enable chronyd   ##永久开启时间同步服务器
[root@ct ~]# systemctl restart chronyd  ##重启时间同步服务器
[root@ct ~]# chronyc sources  ##使用 chronyc sources 命令查询时间同步信息
[root@ct ~]# crontab -e							##配置计划任务
*/2 * * * * /usr/bin/chronyc sources >>/var/log/chronyc.log
[root@ct ~]# crontab -l
*/2 * * * * /usr/bin/chronyc sources >> /var/log/chronyc.log

配置控制节点

安装mariadb

yum -y install mariadb mariadb-server python2-PyMySQL ##控制端连接mysql所需的模块
yum -y install libibverbs

[root@ct ~]# vim /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.100.169
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

执行mariadb的配置脚本

[root@ct my.cnf.d]# mysql_secure_installation

Openstack架构详解_第1张图片
Openstack架构详解_第2张图片

安装rabbitmq:控制端发送rabiitmq,node节点监听rabbitmq

[root@ct ~]# yum -y install rabbitmq-server
[root@ct ~]# systemctl enable rabbitmq-server.service
[root@ct ~]# systemctl start rabbitmq-server.service

创建消息队列用户,用于controler和计算节点连接rabbitmq

rabbitmqctl add_user openstack RABBIT_PASS
Creating user “openstack”

配置OpenStack用户操作权限

[root@ct ~]# rabbitmqctl set_permissions openstack “." ".” “.*”

[root@ct my.cnf.d]# rabbitmqctl add_user openstack RABBIT_PASS
Creating user "openstack"
[root@ct my.cnf.d]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/"
[root@ct my.cnf.d]# rabbitmq-plugins list  #查看插件列表

Openstack架构详解_第3张图片

查看端口

[root@ct ~]# ss -natp | grep 5672

Openstack架构详解_第4张图片
可访问192.168.235.156:15672
默认账号密码均为guest
Openstack架构详解_第5张图片

安装memcached

[root@ct ~]# yum install -y memcached python-memcached

修改Memcached配置文件

[root@ct ~]# cat /etc/sysconfig/memcached

Openstack架构详解_第6张图片

[root@ct my.cnf.d]# vi /etc/sysconfig/memcached 
[root@ct my.cnf.d]# systemctl enable memcached
Created symlink from /etc/systemd/system/multi-user.target.wants/memcached.service to /usr/lib/systemd/system/memcached.service.
[root@ct my.cnf.d]# systemctl start memcached
[root@ct my.cnf.d]# netstat -nautp | grep 11211
tcp        0      0 192.168.100.60:11211    0.0.0.0:*               LISTEN      31875/memcached     
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      31875/memcached     
tcp6       0      0 ::1:11211               :::*                    LISTEN      31875/memcached

安装etcd

[root@ct ~]# yum -y install etcd
[root@ct ~]# cd /etc/etcd/
[root@ct etcd]# vim etcd.conf

ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.100.169:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.100.169:2379"	
ETCD_NAME="ct"	
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.100.169:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.100.169:2379"
ETCD_INITIAL_CLUSTER="ct=http://192.168.100.11:2380"	
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"		
ETCD_INITIAL_CLUSTER_STATE="new"   
[root@ct ~]# systemctl enable etcd.service
[root@ct ~]# systemctl start etcd.service
[root@ct ~]# netstat -anutp |grep 2379
[root@ct ~]# netstat -anutp |grep 2380

Openstack架构详解_第7张图片

你可能感兴趣的:(Openstack架构详解)