重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
云计算
配置说明:
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是否正常
所有的配置文件在百度云盘中:
链接:https://pan.baidu.com/s/1CnmKkFMTemv199ctgb5Oig
提取码:27om
复制这段内容后打开百度网盘手机App,操作更方便哦