openstack O版 基础环境的搭建
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack O版 基础环境的搭建相关的知识,希望对你有一定的参考价值。
配置说明:controller IP:192.168.0.111
Compute IP: 192.168.0.112
1.网络配置.
Controller
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.0.111
PREFIX0=24
GATEWAY=192.168.0.254
DNS1=192.168.0.254
Compute
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.0.112
PREFIX0=24
GATEWAY=192.168.0.254
DNS1=192.168.0.254
关闭两台服务器的iptables 和 selinux
(1)关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
(2)关闭selinux
setenforce 0
[[email protected] ~]# setenforce 0
[[email protected] ~]# cat /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
2.NTP服务的搭建
Controller
安装chrony时间同步服务(系统默认是安装),如果没有安装就安装。
[[email protected] ~]# rpm -qa | grep chrony
chrony-2.1.1-4.el7.centos.x86_64
[[email protected] ~]#yum -y install chrony
[[email protected] ~]# vi /etc/chrony.conf
安装好后,需要修改配置文件,如下所示:
启动ntp服务
[[email protected] ~]# systemctl start chronyd.service 启动ntp服务
[[email protected] ~]# systemctl status chronyd.service 查看时间同步状态
[[email protected] ~]# chronyc sources -v 查看时间同步源
[[email protected] ~]# chronyc sourcestats -v 查看时间同步源状态
Compute ntp的安装和部署
安装同上一样,安装好后修改配置文件
[[email protected] ~]# vi /etc/chrony.conf
启动服务和查看是否正常同上。
############################ controller Openstack包安装和部署##########################
一.mysql服务
[[email protected] ~]# yum -y install mariadb mariadb-server python2-PyMySQL 安装46个包
[[email protected] ~]# cd /etc/my.cnf.d/
[[email protected] my.cnf.d]# vi mariadb-openstack.cnf
[[email protected] my.cnf.d]# cat mariadb-openstack.cnf
[mysqld]
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = ‘SET NAMES utf8‘
character-set-server = utf8
bind-address = 192.168.0.111
[[email protected] ~]# systemctl enable mariadb.service
[[email protected] ~]# systemctl start mariadb.service
[[email protected] ~]# netstat -anpult | grep mysqld
tcp 0 0 192.168.0.111:3306 0.0.0.0: LISTEN 2990/mysqld
初始化数据库
[[email protected] ~]# mysql_secure_installation
Enter current password for root (enter for none): 选择回车
Set root password? [Y/n] y
设置密码及初始化
密码 devops ,一路y回车
[[email protected] ~]# mysql -uroot -pdevops
创建数据库
[[email protected] ~]# mysql -uroot -pdevops
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.1.20-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE keystone;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone. TO ‘keystone‘@‘localhost‘ IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone. TO ‘keystone‘@‘%‘ IDENTIFIED BY ‘devops‘;
二.RabbitMQ服务的安装
[[email protected] ~]# yum -y install erlang
[[email protected] ~]# yum install -y rabbitmq-server
[[email protected] ~]# systemctl enable rabbitmq-server.service
[[email protected] ~]# systemctl start rabbitmq-server.service
[[email protected] ~]# systemctl status rabbitmq-server.service
[[email protected] ~]# systemctl list-unit-files |grep rabbitmq-server.service
[[email protected] ~]# rabbitmqctl add_user openstack devops 用户名为:openstack 密码:devops
Creating user "openstack" ...
[[email protected] ~]# rabbitmqctl set_user_tags openstack administrator 设置openstack为管理员
Setting tags for user "openstack" to [administrator] ...
[[email protected] ~]# rabbitmqctl set_permissions openstack "." "." "."
Setting permissions for user "openstack" in vhost "/" ...
[[email protected] ~]# rabbitmq-plugins list 查看支持的插件
[[email protected] ~]# rabbitmq-plugins enable rabbitmq_management 启动插件
Plugin configuration unchanged.
Applying plugin configuration to [email protected] started 6 plugins.
[[email protected] ~]# systemctl restart rabbitmq-server.service
[[email protected] ~]# lsof -i :15672
测试rabbitMQ是否正常
以上是关于openstack O版 基础环境的搭建的主要内容,如果未能解决你的问题,请参考以下文章
openstack篇 openstack原生环境配置(t版)
openstack篇 openstack原生环境配置(t版)