码迷,mamicode.com
首页 > 其他好文 > 详细

openstack O版 基础环境的搭建

时间:2019-07-10 20:10:29      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:grep   ESS   mis   you   bin   -o   pymysql   mys   man   

配置说明:
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
[root@compute ~]# setenforce 0
[root@compute ~]# cat /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
2.NTP服务的搭建
Controller
安装chrony时间同步服务(系统默认是安装),如果没有安装就安装。
[root@controller ~]# rpm -qa | grep chrony
chrony-2.1.1-4.el7.centos.x86_64
[root@controller ~]#yum -y install chrony
[root@controller ~]# vi /etc/chrony.conf
安装好后,需要修改配置文件,如下所示:
技术图片
启动ntp服务
[root@controller ~]# systemctl start chronyd.service 启动ntp服务
[root@controller ~]# systemctl status chronyd.service 查看时间同步状态
[root@controller ~]# chronyc sources -v 查看时间同步源
[root@controller ~]# chronyc sourcestats -v 查看时间同步源状态
技术图片
Compute ntp的安装和部署
安装同上一样,安装好后修改配置文件
[root@compute ~]# vi /etc/chrony.conf
技术图片
启动服务和查看是否正常同上。
############################ controller Openstack包安装和部署##########################
一.MYSQL服务
[root@controller ~]# yum -y install mariadb mariadb-server python2-PyMySQL 安装46个包
[root@controller ~]# cd /etc/my.cnf.d/
[root@controller my.cnf.d]# vi mariadb-openstack.cnf
[root@controller 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
[root@controller ~]# systemctl enable mariadb.service
[root@controller ~]# systemctl start mariadb.service
[root@controller ~]# netstat -anpult | grep mysqld
tcp 0 0 192.168.0.111:3306 0.0.0.0: LISTEN 2990/mysqld
初始化数据库
[root@controller ~]# mysql_secure_installation
Enter current password for root (enter for none): 选择回车
Set root password? [Y/n] y
设置密码及初始化
密码 devops ,一路y回车
[root@controller ~]# mysql -uroot -pdevops
创建数据库
[root@controller ~]# 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服务的安装
[root@controller ~]# yum -y install erlang
[root@controller ~]# yum install -y rabbitmq-server
[root@controller ~]# systemctl enable rabbitmq-server.service
[root@controller ~]# systemctl start rabbitmq-server.service
[root@controller ~]# systemctl status rabbitmq-server.service
[root@controller ~]# systemctl list-unit-files |grep rabbitmq-server.service
[root@controller ~]# rabbitmqctl add_user openstack devops 用户名为:openstack 密码:devops
Creating user "openstack" ...
[root@controller ~]# rabbitmqctl set_user_tags openstack administrator 设置openstack为管理员
Setting tags for user "openstack" to [administrator] ...
[root@controller ~]# rabbitmqctl set_permissions openstack ".
" "." "."
Setting permissions for user "openstack" in vhost "/" ...
[root@controller ~]# rabbitmq-plugins list 查看支持的插件
[root@controller ~]# rabbitmq-plugins enable rabbitmq_management 启动插件
Plugin configuration unchanged.
Applying plugin configuration to rabbit@controller... started 6 plugins.
[root@controller ~]# systemctl restart rabbitmq-server.service
[root@controller ~]# lsof -i :15672
测试rabbitMQ是否正常
技术图片

openstack O版 基础环境的搭建

标签:grep   ESS   mis   you   bin   -o   pymysql   mys   man   

原文地址:https://blog.51cto.com/343614597/2419098

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!